Initial project stub
This commit is contained in:
commit
7b95dffd11
15 changed files with 235 additions and 0 deletions
9
.dockerignore
Normal file
9
.dockerignore
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
*
|
||||||
|
!/scripts/*
|
||||||
|
!/src/*
|
||||||
|
!/test/*
|
||||||
|
!/Nyangate.sln
|
||||||
|
src/*/bin
|
||||||
|
src/*/obj
|
||||||
|
test/*/bin
|
||||||
|
test/*/obj
|
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.vscode/
|
||||||
|
**/obj/
|
||||||
|
**/bin/
|
||||||
|
out/
|
3
.nyoki
Normal file
3
.nyoki
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"instanceId": "79b5f7e0-eeb6-441d-85f0-721e4ea92fb4"
|
||||||
|
}
|
55
Dockerfile
Normal file
55
Dockerfile
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
|
||||||
|
|
||||||
|
WORKDIR /source
|
||||||
|
|
||||||
|
COPY Nyangate.sln ./
|
||||||
|
|
||||||
|
COPY src/Nyangate/*.csproj ./src/Nyangate/
|
||||||
|
COPY src/Nyangate.Cli/*.csproj ./src/Nyangate.Cli/
|
||||||
|
COPY src/Nyangate.Lib/*.csproj ./src/Nyangate.Lib/
|
||||||
|
COPY test/Nyangate.Test/*.csproj ./test/Nyangate.Test/
|
||||||
|
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
COPY src/Nyangate/. ./src/Nyangate/
|
||||||
|
COPY src/Nyangate.Lib/. ./src/Nyangate.Lib/
|
||||||
|
|
||||||
|
RUN dotnet publish ./src/Nyangate/Nyangate.csproj --no-restore -c Release -o /build/nyangate
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS tests
|
||||||
|
|
||||||
|
WORKDIR /source
|
||||||
|
|
||||||
|
COPY test/Nyangate.Test/. ./test/Nyangate.Test/
|
||||||
|
RUN dotnet test
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS runtime
|
||||||
|
|
||||||
|
# Environment vars
|
||||||
|
|
||||||
|
ENV TLS_CERT_PUB=/etc/tls/certs/main.pem
|
||||||
|
ENV TLS_CERT_PRIVKEY=/etc/tls/certs/main.key.pem
|
||||||
|
|
||||||
|
RUN mkdir -p /srv/nyangate/config /etc/tls/certs
|
||||||
|
|
||||||
|
# Files
|
||||||
|
|
||||||
|
COPY --from=build /build/nyangate /srv/nyangate
|
||||||
|
|
||||||
|
#COPY ./scripts/chkhealth /usr/bin/
|
||||||
|
|
||||||
|
VOLUME [ "/srv/nyangate/config" ]
|
||||||
|
|
||||||
|
WORKDIR /srv/nyangate
|
||||||
|
|
||||||
|
# Net
|
||||||
|
|
||||||
|
EXPOSE 80/tcp
|
||||||
|
EXPOSE 443/tcp
|
||||||
|
|
||||||
|
# Process handling
|
||||||
|
|
||||||
|
STOPSIGNAL SIGTERM
|
||||||
|
#HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 CMD [ "/usr/bin/chkhealth" ]
|
||||||
|
|
||||||
|
ENTRYPOINT [ "dotnet", "/srv/nyangate/Nyangate.dll" ]
|
50
Nyangate.sln
Normal file
50
Nyangate.sln
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.31903.59
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9B32EA6C-F2D3-4A38-99FC-0C5F522B338A}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nyangate.Test", "test\Nyangate.Test\Nyangate.Test.csproj", "{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D389138A-1E17-4AFE-A0C8-D71DA9C2967B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nyangate.Cli", "src\Nyangate.Cli\Nyangate.Cli.csproj", "{8CCADE0F-436B-4CF0-A885-CEE0F96121D4}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nyangate", "src\Nyangate\Nyangate.csproj", "{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nyangate.Lib", "src\Nyangate.Lib\Nyangate.Lib.csproj", "{273954D9-C2DC-430F-A62D-DD55B908BA6C}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{8CCADE0F-436B-4CF0-A885-CEE0F96121D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8CCADE0F-436B-4CF0-A885-CEE0F96121D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8CCADE0F-436B-4CF0-A885-CEE0F96121D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8CCADE0F-436B-4CF0-A885-CEE0F96121D4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{273954D9-C2DC-430F-A62D-DD55B908BA6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{273954D9-C2DC-430F-A62D-DD55B908BA6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{273954D9-C2DC-430F-A62D-DD55B908BA6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{273954D9-C2DC-430F-A62D-DD55B908BA6C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{65ADE5CC-F1ED-4D18-A64E-7C4C625334D7} = {9B32EA6C-F2D3-4A38-99FC-0C5F522B338A}
|
||||||
|
{8CCADE0F-436B-4CF0-A885-CEE0F96121D4} = {D389138A-1E17-4AFE-A0C8-D71DA9C2967B}
|
||||||
|
{D1171FEB-30A7-4D0B-B1AF-2DF5857E25A1} = {D389138A-1E17-4AFE-A0C8-D71DA9C2967B}
|
||||||
|
{273954D9-C2DC-430F-A62D-DD55B908BA6C} = {D389138A-1E17-4AFE-A0C8-D71DA9C2967B}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
10
src/Nyangate.Cli/Nyangate.Cli.csproj
Normal file
10
src/Nyangate.Cli/Nyangate.Cli.csproj
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
1
src/Nyangate.Cli/Program.cs
Normal file
1
src/Nyangate.Cli/Program.cs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Console.WriteLine("meow~");
|
9
src/Nyangate.Lib/Nyangate.Lib.csproj
Normal file
9
src/Nyangate.Lib/Nyangate.Lib.csproj
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
9
src/Nyangate/Nyangate.csproj
Normal file
9
src/Nyangate/Nyangate.csproj
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
6
src/Nyangate/Program.cs
Normal file
6
src/Nyangate/Program.cs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.MapGet("/", () => "meow~");
|
||||||
|
|
||||||
|
app.Run();
|
37
src/Nyangate/Properties/launchSettings.json
Normal file
37
src/Nyangate/Properties/launchSettings.json
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:17984",
|
||||||
|
"sslPort": 44337
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "http://localhost:5178",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:7056;http://localhost:5178",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
src/Nyangate/appsettings.Development.json
Normal file
8
src/Nyangate/appsettings.Development.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
src/Nyangate/appsettings.json
Normal file
9
src/Nyangate/appsettings.json
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
24
test/Nyangate.Test/Nyangate.Test.csproj
Normal file
24
test/Nyangate.Test/Nyangate.Test.csproj
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||||
|
<PackageReference Include="xunit" Version="2.4.2" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
1
test/Nyangate.Test/Usings.cs
Normal file
1
test/Nyangate.Test/Usings.cs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
global using Xunit;
|
Loading…
Reference in a new issue