Compare commits
8 Commits
453faf853b
...
57f7cb28a5
Author | SHA1 | Date | |
---|---|---|---|
|
57f7cb28a5 | ||
|
fc5c75131c | ||
|
a62845291a | ||
|
a5bf29c00b | ||
|
afdaabce8f | ||
|
771b921638 | ||
|
6ac6cf007e | ||
|
ea585b0eda |
@ -2,6 +2,7 @@
|
|||||||
**/bin/
|
**/bin/
|
||||||
**/obj/
|
**/obj/
|
||||||
**/out/
|
**/out/
|
||||||
|
**/wwwroot/Content
|
||||||
|
|
||||||
# files
|
# files
|
||||||
Dockerfile*
|
Dockerfile*
|
||||||
@ -9,4 +10,5 @@ Dockerfile*
|
|||||||
**/*.md
|
**/*.md
|
||||||
**/*.ps1
|
**/*.ps1
|
||||||
**/*.cmd
|
**/*.cmd
|
||||||
**/*.sh
|
**/*.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>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
<meta name="description" content="" />
|
<meta name="description" content="Нижнее бельё ручной работы по вашим индивидуальным меркам.
|
||||||
<meta name="author" content="" />
|
Сошьём бельё мечты по вашим меркам за 4-7 дней. Находимся в Новороссийске. Доставляем по городу и РФ." />
|
||||||
|
<meta name="author" content="Екатерина Мануйлова" />
|
||||||
<meta property="og:title" content="My Darling Underwear" />
|
<meta property="og:title" content="My Darling Underwear" />
|
||||||
<meta property="og:url" content="https://mydarlingunderwear.ru/" />
|
<meta property="og:url" content="https://mydarlingunderwear.ru/" />
|
||||||
<meta property="og:description" content="Нижнее бельё ручной работы по вашим индивидуальным меркам" />
|
<meta property="og:description" content="Нижнее бельё ручной работы по вашим индивидуальным меркам" />
|
||||||
<meta property="og:image" content="https://mydarlingunderwear.ru/assets/img/bg-signup.jpg" />
|
<meta property="og:image" content="https://mydarlingunderwear.ru/assets/img/bg-signup.jpg" />
|
||||||
<title>My Darling Underwear - нижнее бельё ручной работы</title>
|
<title>My Darling Underwear - нижнее бельё ручной работы</title>
|
||||||
<link rel="shortcut icon" type="image/png" href="/assets/favicon.png" />
|
<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>
|
<script src="/lib/font-awesome/js/all.js"></script>
|
||||||
<link href="/lib/fancyapps-ui/fancybox.css" rel="stylesheet" />
|
<link href="/lib/fancyapps-ui/fancybox.css" rel="stylesheet" />
|
||||||
<link href="/css/styles.css" rel="stylesheet" />
|
<link href="/css/styles.css" rel="stylesheet" />
|
||||||
|
@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using MyDarling.Models;
|
using MyDarling.Models;
|
||||||
using MyDarling.Services;
|
using MyDarling.Services;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using MyDarling.Controllers;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
@ -28,6 +28,7 @@ builder.Services.Configure<IdentityOptions>( opts =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddTransient<IImageResizer, ImageResizer>();
|
builder.Services.AddTransient<IImageResizer, ImageResizer>();
|
||||||
|
builder.Services.AddScoped<IRobotsTxtGenerator, RobotsTxtGenerator>();
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
builder.Services.AddRazorPages();
|
builder.Services.AddRazorPages();
|
||||||
|
|
||||||
@ -38,6 +39,10 @@ app.MapControllers();
|
|||||||
app.MapDefaultControllerRoute();
|
app.MapDefaultControllerRoute();
|
||||||
app.MapRazorPages();
|
app.MapRazorPages();
|
||||||
|
|
||||||
|
var robotsScope = app.Services.CreateScope();
|
||||||
|
var robotsGenerator = robotsScope.ServiceProvider.GetService<IRobotsTxtGenerator>();
|
||||||
|
app.MapGet("/robots.txt", () => robotsGenerator!.GetRobotsText());
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
IdentitySeedData.CreateAdminAccount(app.Services, app.Configuration);
|
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:
|
services:
|
||||||
my-darling:
|
my-darling:
|
||||||
build: .
|
image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest
|
||||||
container_name: mydarling-dotnet
|
container_name: mydarling-dotnet
|
||||||
ports:
|
ports:
|
||||||
- "5050:5000"
|
- "5050:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- db:/app/Database
|
- db:/app/Database
|
||||||
- content:/app/wwwroot/content
|
- content:/app/wwwroot/Content
|
||||||
environment:
|
environment:
|
||||||
- ADMIN_PASSWORD=He110World!
|
- 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…
x
Reference in New Issue
Block a user