Compare commits
8 Commits
d3518d6bb5
...
469197db32
Author | SHA1 | Date | |
---|---|---|---|
469197db32 | |||
87f854bb15 | |||
a9eb0eb37d | |||
878ef4e6d3 | |||
9a02949235 | |||
4aac347867 | |||
|
4d1a5229e5 | ||
|
8195fd3720 |
@ -3,7 +3,7 @@
|
|||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"dotnet-ef": {
|
"dotnet-ef": {
|
||||||
"version": "7.0.2",
|
"version": "8.0.1",
|
||||||
"commands": [
|
"commands": [
|
||||||
"dotnet-ef"
|
"dotnet-ef"
|
||||||
]
|
]
|
||||||
|
29
.gitea/workflows/release.yml
Normal file
29
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Login to Gitea Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.cebotari.ru
|
||||||
|
username: chebser
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
- name: Build app
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: gitea.cebotari.ru/chebser/mydarlig-dotnet:latest
|
24
Dockerfile
24
Dockerfile
@ -1,19 +1,15 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
|
||||||
WORKDIR /app
|
WORKDIR /source
|
||||||
|
|
||||||
COPY . ./
|
COPY . .
|
||||||
RUN dotnet restore
|
RUN dotnet restore && \
|
||||||
RUN dotnet tool restore
|
dotnet tool restore && \
|
||||||
RUN dotnet libman restore
|
dotnet libman restore
|
||||||
RUN dotnet ef database update --context DataContext
|
RUN dotnet publish --property:OutputPath=/app
|
||||||
RUN dotnet ef database update --context IdentityContext
|
|
||||||
|
|
||||||
RUN dotnet publish -c Release -o out
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/out .
|
COPY --from=build /app .
|
||||||
COPY --from=build /app/Database ./Database
|
|
||||||
ENV ASPNETCORE_ENVIRONMENT Production
|
ENV ASPNETCORE_ENVIRONMENT Production
|
||||||
ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ]
|
ENTRYPOINT [ "./MyDarling", "--urls=http://0.0.0.0:5000" ]
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<InvariantGlobalization>false</InvariantGlobalization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.3" />
|
<PackageReference Include="SkiaSharp" Version="2.88.7" />
|
||||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.7" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
42
Pages/Feed.xml.cshtml
Normal file
42
Pages/Feed.xml.cshtml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
@page "/feed.yml"
|
||||||
|
@using Microsoft.AspNetCore.Http
|
||||||
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@inject MyDarling.Models.DataContext context
|
||||||
|
@{
|
||||||
|
var p =
|
||||||
|
new { Url = "https://mydarlingunderwear.ru/", LastUpdated = DateTime.Today };
|
||||||
|
Response.ContentType = "text/xml";
|
||||||
|
var products = context.Products
|
||||||
|
.Include(b => b.Figures)
|
||||||
|
.Where(b => b.Price != 0 && b.Figures.Count > 0);
|
||||||
|
await Response.WriteAsync("<?xml version='1.0' encoding='UTF-8' ?>");
|
||||||
|
var updateDate = p.LastUpdated.ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
<yml_catalog date="@updateDate">
|
||||||
|
<shop>
|
||||||
|
<name>My Darling Underwear</name>
|
||||||
|
<company>Екатерина Мануйлова</company>
|
||||||
|
<url>@p.Url</url>
|
||||||
|
<currencies>
|
||||||
|
<currency id="RUB" rate="1"></currency>
|
||||||
|
</currencies>
|
||||||
|
<categories>
|
||||||
|
<category id="1">Нижнее бельё</category>
|
||||||
|
</categories>
|
||||||
|
<offers>
|
||||||
|
@foreach (var product in products)
|
||||||
|
{
|
||||||
|
var figureUrl = $"{@p.Url}Content/{@product.Id}/{@product.Figures[0].Id}.jpg";
|
||||||
|
<offer id="@product.Id" available="true">
|
||||||
|
<url>@p.Url#@product.Id-1</url>
|
||||||
|
<price>@product.Price</price>
|
||||||
|
<currencyId>RUR</currencyId>
|
||||||
|
<categoryId>1</categoryId>
|
||||||
|
<name>@product.Name</name>
|
||||||
|
<picture>@figureUrl</picture>
|
||||||
|
</offer>
|
||||||
|
}
|
||||||
|
</offers>
|
||||||
|
</shop>
|
||||||
|
</yml_catalog>
|
@ -24,6 +24,11 @@
|
|||||||
<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" />
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Noto+Sans&family=Noto+Sans+Mono&family=Nunito&display=swap"
|
||||||
|
rel="stylesheet">
|
||||||
<!-- Yandex.Metrika counter -->
|
<!-- Yandex.Metrika counter -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function (m, e, t, r, i, k, a) {
|
(function (m, e, t, r, i, k, a) {
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
my-darling:
|
my-darling-test:
|
||||||
image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest
|
build: .
|
||||||
container_name: mydarling-dotnet
|
container_name: mydarling-dotnet
|
||||||
ports:
|
ports:
|
||||||
- "5050:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- db:/app/Database
|
- ./Database:/app/Database
|
||||||
- content:/app/wwwroot/Content
|
- ./wwwroot/Content:/app/wwwroot/Content
|
||||||
environment:
|
environment:
|
||||||
- ADMIN_PASSWORD=He110World!
|
- ADMIN_PASSWORD=He110World!
|
||||||
|
|
||||||
volumes:
|
|
||||||
db:
|
|
||||||
content:
|
|
@ -58,10 +58,10 @@
|
|||||||
--bs-black-rgb: 0, 0, 0;
|
--bs-black-rgb: 0, 0, 0;
|
||||||
--bs-body-color-rgb: 33, 37, 41;
|
--bs-body-color-rgb: 33, 37, 41;
|
||||||
--bs-body-bg-rgb: 255, 255, 255;
|
--bs-body-bg-rgb: 255, 255, 255;
|
||||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
--bs-font-sans-serif: 'Noto Sans', sans-serif;
|
||||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
--bs-font-monospace: 'Noto Sans Mono', monospace;
|
||||||
|
--bs-body-font-family: 'Nunito', sans-serif;
|
||||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||||
--bs-body-font-family: Nunito, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
|
||||||
--bs-body-font-size: 1rem;
|
--bs-body-font-size: 1rem;
|
||||||
--bs-body-font-weight: 400;
|
--bs-body-font-weight: 400;
|
||||||
--bs-body-line-height: 1.5;
|
--bs-body-line-height: 1.5;
|
||||||
@ -380,9 +380,7 @@ select:disabled {
|
|||||||
button,
|
button,
|
||||||
[type=button],
|
[type=button],
|
||||||
[type=reset],
|
[type=reset],
|
||||||
[type=submit] {
|
[type=submit]
|
||||||
-webkit-appearance: button;
|
|
||||||
}
|
|
||||||
button:not(:disabled),
|
button:not(:disabled),
|
||||||
[type=button]:not(:disabled),
|
[type=button]:not(:disabled),
|
||||||
[type=reset]:not(:disabled),
|
[type=reset]:not(:disabled),
|
||||||
@ -439,7 +437,6 @@ legend + * {
|
|||||||
|
|
||||||
[type=search] {
|
[type=search] {
|
||||||
outline-offset: -2px;
|
outline-offset: -2px;
|
||||||
-webkit-appearance: textfield;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rtl:raw:
|
/* rtl:raw:
|
||||||
@ -2492,8 +2489,7 @@ textarea.form-control-lg {
|
|||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
-webkit-print-color-adjust: exact;
|
-print-color-adjust: exact;
|
||||||
color-adjust: exact;
|
|
||||||
}
|
}
|
||||||
.form-check-input[type=checkbox] {
|
.form-check-input[type=checkbox] {
|
||||||
border-radius: 0.25em;
|
border-radius: 0.25em;
|
||||||
@ -4659,6 +4655,7 @@ textarea.form-control-lg {
|
|||||||
.card-body {
|
.card-body {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
padding: 1rem 1rem;
|
padding: 1rem 1rem;
|
||||||
|
box-shadow: 0 4px 5px rgba(0,0,0,0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user