Skip to content

Commit

Permalink
chore: rename CTFServer -> GZCTF
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Jul 12, 2023
1 parent 1b44fe8 commit 37802b4
Show file tree
Hide file tree
Showing 194 changed files with 1,805 additions and 1,804 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
- name: Prebuild project
run: |
npm i -g pnpm
dotnet build "CTFServer.csproj" -c Release -o build
dotnet build "GZCTF.csproj" -c Release -o build
- name: Publish project
run: |
dotnet publish "CTFServer.csproj" -c Release -o publish/linux/amd64 -r linux-x64 --no-self-contained /p:PublishReadyToRun=true
dotnet publish "CTFServer.csproj" -c Release -o publish/linux/arm64 -r linux-arm64 --no-self-contained /p:PublishReadyToRun=true
dotnet publish "GZCTF.csproj" -c Release -o publish/linux/amd64 -r linux-x64 --no-self-contained /p:PublishReadyToRun=true
dotnet publish "GZCTF.csproj" -c Release -o publish/linux/arm64 -r linux-arm64 --no-self-contained /p:PublishReadyToRun=true
env:
VITE_APP_BUILD_TIMESTAMP: ${{ steps.datetime.outputs.time }}
VITE_APP_GIT_SHA: ${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Build with dotnet
run: |
dotnet build "CTFServer.csproj" -c Release -o build
dotnet build "GZCTF.csproj" -c Release -o build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ _Pvt_Extensions
.vscode/**

**/db/*
**/CTFServer.xml
**/GZCTF.xml
**/uploads/**
**/log/**
**/*.key
Expand Down
8 changes: 4 additions & 4 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ RUN npm i -g pnpm

COPY ["GZCTF", "/src/GZCTF/"]
WORKDIR "/src/GZCTF"
RUN dotnet restore "CTFServer.csproj"
RUN dotnet build "CTFServer.csproj" -c Release -o /app/build --no-restore
RUN dotnet restore "GZCTF.csproj"
RUN dotnet build "GZCTF.csproj" -c Release -o /app/build --no-restore

FROM build AS publish
RUN dotnet publish "CTFServer.csproj" -c Release -o /app/publish -r linux-x64 --no-self-contained /p:PublishReadyToRun=true
RUN dotnet publish "GZCTF.csproj" -c Release -o /app/publish -r linux-x64 --no-self-contained /p:PublishReadyToRun=true

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS final
WORKDIR /app
EXPOSE 80
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CTFServer.dll"]
ENTRYPOINT ["dotnet", "GZCTF.dll"]
2 changes: 1 addition & 1 deletion src/GZCTF.Test/AccountTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Xunit;
using Xunit.Abstractions;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class AccountTest : IClassFixture<TestWebAppFactory>
{
Expand Down
8 changes: 4 additions & 4 deletions src/GZCTF.Test/ConfigServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using CTFServer.Models.Internal;
using CTFServer.Services;
using GZCTF.Models.Internal;
using GZCTF.Services;
using Xunit;
using Xunit.Abstractions;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class ConfigServiceTest
{
Expand Down Expand Up @@ -31,4 +31,4 @@ public class TestConfig
public AccountPolicy AccoutPolicy { get; set; } = new();
public DockerConfig DockerConfig { get; set; } = new();
public EmailConfig EmailConfig { get; set; } = new();
}
}
6 changes: 3 additions & 3 deletions src/GZCTF.Test/ContainerServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CTFServer.Models.Internal;
using CTFServer.Services.Interface;
using GZCTF.Models.Internal;
using GZCTF.Services.Interface;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class ContainerServiceTest : IClassFixture<TestWebAppFactory>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GZCTF\CTFServer.csproj" />
<ProjectReference Include="..\GZCTF\GZCTF.csproj" />
<None Include="..\GZCTF\appsettings*" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/GZCTF.Test/SignatureTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Text;
using CTFServer.Utils;
using GZCTF.Utils;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
Expand All @@ -8,7 +8,7 @@
using Xunit;
using Xunit.Abstractions;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class SignatureTest
{
Expand Down Expand Up @@ -171,4 +171,4 @@ public void SHA512withRSATest()
output.WriteLine(verified ? "Signature verified" : "Signature not verified");
Assert.True(verified);
}
}
}
4 changes: 2 additions & 2 deletions src/GZCTF.Test/TestMailSender.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using CTFServer.Services.Interface;
using GZCTF.Services.Interface;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class TestMailSender : IMailSender
{
Expand Down
6 changes: 3 additions & 3 deletions src/GZCTF.Test/TestWebAppFactory.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Linq;
using CTFServer.Services.Interface;
using GZCTF.Services.Interface;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;

namespace CTFServer.Test;
namespace GZCTF.Test;

public class TestWebAppFactory : WebApplicationFactory<Program>
{
Expand All @@ -21,4 +21,4 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
services.AddTransient<IMailSender, TestMailSender>();
});
}
}
}
4 changes: 2 additions & 2 deletions src/GZCTF.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Dockerfile = Dockerfile
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CTFServer", "GZCTF\CTFServer.csproj", "{9AAEFC0F-73F3-44F0-B8AC-140640792603}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GZCTF", "GZCTF\GZCTF.csproj", "{9AAEFC0F-73F3-44F0-B8AC-140640792603}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CTFServer.Test", "GZCTF.Test\CTFServer.Test.csproj", "{A2B5B2F3-0861-4503-9AE4-2152701726DF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GZCTF.Test", "GZCTF.Test\GZCTF.Test.csproj", "{A2B5B2F3-0861-4503-9AE4-2152701726DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/.nswag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"runtime": "Net70",
"defaultVariables": "AssemblyPath=bin/GenAPI/net7.0/CTFServer.dll",
"defaultVariables": "AssemblyPath=bin/GenAPI/net7.0/GZCTF.dll",
"documentGenerator": {
"aspNetCoreToOpenApi": {
"isAspNetCore": true,
Expand Down
16 changes: 8 additions & 8 deletions src/GZCTF/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using System.Net.Mime;
using CTFServer.Extensions;
using CTFServer.Middlewares;
using CTFServer.Models.Internal;
using CTFServer.Models.Request.Account;
using CTFServer.Repositories.Interface;
using CTFServer.Services.Interface;
using CTFServer.Utils;
using GZCTF.Extensions;
using GZCTF.Middlewares;
using GZCTF.Models.Internal;
using GZCTF.Models.Request.Account;
using GZCTF.Repositories.Interface;
using GZCTF.Services.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.RateLimiting;
using Microsoft.Extensions.Options;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 用户账户相关接口
Expand Down
20 changes: 10 additions & 10 deletions src/GZCTF/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using System.Net.Mime;
using CTFServer.Extensions;
using CTFServer.Middlewares;
using CTFServer.Models.Internal;
using CTFServer.Models.Request.Account;
using CTFServer.Models.Request.Admin;
using CTFServer.Models.Request.Info;
using CTFServer.Repositories.Interface;
using CTFServer.Services.Interface;
using CTFServer.Utils;
using GZCTF.Extensions;
using GZCTF.Middlewares;
using GZCTF.Models.Internal;
using GZCTF.Models.Request.Account;
using GZCTF.Models.Request.Admin;
using GZCTF.Models.Request.Info;
using GZCTF.Repositories.Interface;
using GZCTF.Services.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 管理员数据交互接口
Expand Down
8 changes: 4 additions & 4 deletions src/GZCTF/Controllers/AssetsController.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.ComponentModel.DataAnnotations;
using System.Net.Mime;
using CTFServer.Middlewares;
using CTFServer.Repositories.Interface;
using CTFServer.Utils;
using GZCTF.Middlewares;
using GZCTF.Repositories.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 文件交互接口
Expand Down
18 changes: 9 additions & 9 deletions src/GZCTF/Controllers/EditController.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System.Net.Mime;
using CTFServer.Extensions;
using CTFServer.Middlewares;
using CTFServer.Models.Request.Edit;
using CTFServer.Models.Request.Game;
using CTFServer.Models.Request.Info;
using CTFServer.Repositories.Interface;
using CTFServer.Services.Interface;
using CTFServer.Utils;
using GZCTF.Extensions;
using GZCTF.Middlewares;
using GZCTF.Models.Request.Edit;
using GZCTF.Models.Request.Game;
using GZCTF.Models.Request.Info;
using GZCTF.Repositories.Interface;
using GZCTF.Services.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 数据修改交互接口
Expand Down
16 changes: 8 additions & 8 deletions src/GZCTF/Controllers/GameController.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Net.Mime;
using System.Security.Claims;
using System.Threading.Channels;
using CTFServer.Middlewares;
using CTFServer.Models.Request.Admin;
using CTFServer.Models.Request.Edit;
using CTFServer.Models.Request.Game;
using CTFServer.Repositories;
using CTFServer.Repositories.Interface;
using CTFServer.Utils;
using GZCTF.Middlewares;
using GZCTF.Models.Request.Admin;
using GZCTF.Models.Request.Edit;
using GZCTF.Models.Request.Game;
using GZCTF.Repositories;
using GZCTF.Repositories.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.RateLimiting;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 比赛数据交互接口
Expand Down
12 changes: 6 additions & 6 deletions src/GZCTF/Controllers/InfoController.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using CTFServer.Extensions;
using CTFServer.Models.Internal;
using CTFServer.Models.Request.Info;
using CTFServer.Repositories.Interface;
using CTFServer.Utils;
using GZCTF.Extensions;
using GZCTF.Models.Internal;
using GZCTF.Models.Request.Info;
using GZCTF.Repositories.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 全局信息接口
Expand Down
10 changes: 5 additions & 5 deletions src/GZCTF/Controllers/TeamController.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System.Net.Mime;
using System.Text.RegularExpressions;
using CTFServer.Middlewares;
using CTFServer.Models.Request.Info;
using CTFServer.Repositories.Interface;
using CTFServer.Utils;
using GZCTF.Middlewares;
using GZCTF.Models.Request.Info;
using GZCTF.Repositories.Interface;
using GZCTF.Utils;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.RateLimiting;
using Microsoft.EntityFrameworkCore;

namespace CTFServer.Controllers;
namespace GZCTF.Controllers;

/// <summary>
/// 队伍数据交互接口
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ WORKDIR /app
COPY --from=build /publish .

EXPOSE 80
ENTRYPOINT ["dotnet", "CTFServer.dll"]
ENTRYPOINT ["dotnet", "GZCTF.dll"]
6 changes: 3 additions & 3 deletions src/GZCTF/Extensions/ConfigurationBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using CTFServer.Providers;
using GZCTF.Providers;
using Microsoft.EntityFrameworkCore;

namespace CTFServer.Extensions;
namespace GZCTF.Extensions;

public static class ConfigurationBuilderExtensions
{
public static IConfigurationBuilder AddEntityConfiguration(this IConfigurationBuilder builder, Action<DbContextOptionsBuilder> optionsAction)
=> builder.Add(new EntityConfigurationSource(optionsAction));
}
}
6 changes: 3 additions & 3 deletions src/GZCTF/Extensions/OtherExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CTFServer.Utils;
using GZCTF.Utils;

namespace CTFServer.Extensions;
namespace GZCTF.Extensions;

public static class ListExtensions
{
Expand Down Expand Up @@ -32,4 +32,4 @@ public static ArrayResponse<T> ToResponse<T>(this IEnumerable<T> array, int? tot
T[] arr => new(arr, tot),
_ => new(array.ToArray(), tot)
};
}
}
Loading

0 comments on commit 37802b4

Please sign in to comment.