Compare commits
8 Commits
453faf853b
...
57f7cb28a5
Author | SHA1 | Date | |
---|---|---|---|
|
57f7cb28a5 | ||
|
fc5c75131c | ||
|
a62845291a | ||
|
a5bf29c00b | ||
|
afdaabce8f | ||
|
771b921638 | ||
|
6ac6cf007e | ||
|
ea585b0eda |
@ -2,6 +2,7 @@
|
||||
**/bin/
|
||||
**/obj/
|
||||
**/out/
|
||||
**/wwwroot/Content
|
||||
|
||||
# files
|
||||
Dockerfile*
|
||||
@ -10,3 +11,4 @@ Dockerfile*
|
||||
**/*.ps1
|
||||
**/*.cmd
|
||||
**/*.sh
|
||||
**/Database/*.db
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"dotnet.defaultSolution": "MyDarling.sln"
|
||||
}
|
@ -4,14 +4,16 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<meta name="description" content="Нижнее бельё ручной работы по вашим индивидуальным меркам.
|
||||
Сошьём бельё мечты по вашим меркам за 4-7 дней. Находимся в Новороссийске. Доставляем по городу и РФ." />
|
||||
<meta name="author" content="Екатерина Мануйлова" />
|
||||
<meta property="og:title" content="My Darling Underwear" />
|
||||
<meta property="og:url" content="https://mydarlingunderwear.ru/" />
|
||||
<meta property="og:description" content="Нижнее бельё ручной работы по вашим индивидуальным меркам" />
|
||||
<meta property="og:image" content="https://mydarlingunderwear.ru/assets/img/bg-signup.jpg" />
|
||||
<title>My Darling Underwear - нижнее бельё ручной работы</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/assets/favicon.png" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/assets/favicon.ico" />
|
||||
<script src="/lib/font-awesome/js/all.js"></script>
|
||||
<link href="/lib/fancyapps-ui/fancybox.css" rel="stylesheet" />
|
||||
<link href="/css/styles.css" rel="stylesheet" />
|
||||
|
@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using MyDarling.Models;
|
||||
using MyDarling.Services;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
using MyDarling.Controllers;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@ -28,6 +28,7 @@ builder.Services.Configure<IdentityOptions>( opts =>
|
||||
});
|
||||
|
||||
builder.Services.AddTransient<IImageResizer, ImageResizer>();
|
||||
builder.Services.AddScoped<IRobotsTxtGenerator, RobotsTxtGenerator>();
|
||||
builder.Services.AddControllersWithViews();
|
||||
builder.Services.AddRazorPages();
|
||||
|
||||
@ -38,6 +39,10 @@ app.MapControllers();
|
||||
app.MapDefaultControllerRoute();
|
||||
app.MapRazorPages();
|
||||
|
||||
var robotsScope = app.Services.CreateScope();
|
||||
var robotsGenerator = robotsScope.ServiceProvider.GetService<IRobotsTxtGenerator>();
|
||||
app.MapGet("/robots.txt", () => robotsGenerator!.GetRobotsText());
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
IdentitySeedData.CreateAdminAccount(app.Services, app.Configuration);
|
||||
|
17
RobotsTxtGenerator.cs
Normal file
17
RobotsTxtGenerator.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Text;
|
||||
|
||||
namespace MyDarling.Controllers;
|
||||
|
||||
public class RobotsTxtGenerator : IRobotsTxtGenerator
|
||||
{
|
||||
public string GetRobotsText()
|
||||
{
|
||||
StringBuilder stringBuilder = new();
|
||||
stringBuilder.AppendLine("user-agent: *");
|
||||
stringBuilder.AppendLine("Disallow: /freedom");
|
||||
stringBuilder.AppendLine("Disallow: /Account/");
|
||||
stringBuilder.AppendLine("Disallow: /account/");
|
||||
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
8
Services/IRobotsTxtGenerator.cs
Normal file
8
Services/IRobotsTxtGenerator.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Text;
|
||||
|
||||
namespace MyDarling.Controllers;
|
||||
|
||||
public interface IRobotsTxtGenerator
|
||||
{
|
||||
public string GetRobotsText();
|
||||
}
|
@ -2,13 +2,13 @@ version: '3'
|
||||
|
||||
services:
|
||||
my-darling:
|
||||
build: .
|
||||
image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest
|
||||
container_name: mydarling-dotnet
|
||||
ports:
|
||||
- "5050:5000"
|
||||
volumes:
|
||||
- db:/app/Database
|
||||
- content:/app/wwwroot/content
|
||||
- content:/app/wwwroot/Content
|
||||
environment:
|
||||
- ADMIN_PASSWORD=He110World!
|
||||
|
||||
|
BIN
wwwroot/assets/favicon.ico
Normal file
BIN
wwwroot/assets/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
Loading…
Reference in New Issue
Block a user