chore: rename SharpbinV3 dir to SharpbinV3.Server

This commit is contained in:
2025-12-30 12:39:26 -05:00
parent 31142e0cf9
commit 1ec4877aad
45 changed files with 7 additions and 94 deletions
@@ -12,19 +12,19 @@ EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["SharpbinV3/SharpbinV3.csproj", "SharpbinV3/"]
RUN dotnet restore "./SharpbinV3/SharpbinV3.csproj"
COPY ["SharpbinV3.Server.csproj", "./"]
RUN dotnet restore "./SharpbinV3.Server.csproj"
COPY . .
WORKDIR "/src/SharpbinV3"
RUN dotnet build "./SharpbinV3.csproj" -c $BUILD_CONFIGURATION -o /app/build
RUN dotnet build "../SharpbinV3.Server.csproj" -c $BUILD_CONFIGURATION -o /app/build
# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./SharpbinV3.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
RUN dotnet publish "../SharpbinV3.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "SharpbinV3.dll"]
ENTRYPOINT ["dotnet", "SharpbinV3.Server.dll"]
@@ -7,7 +7,6 @@ namespace SharpbinV3.Server.Services
{
Task<User> CreateUser(string username, string password, string? email, string? displayName);
Task<JWTResult> GenerateJWTToken(User user);
Task<bool> ValidateJWTToken(string token);
Task<JWTResult> RefreshJWTToken(string token, string refreshToken);
Task<User> UpdateUser(User user);
Task UpdateLoginTime(User user);
@@ -10,7 +10,7 @@ namespace SharpbinV3.Server.Services
Task<bool> Exists(string id);
Task<bool> Exists(Guid uuid);
Task<bool> EditText(Paste paste, string text);
Task<Paste> Get(string id);
Task<Paste?> Get(string id);
Task<List<Paste>> GetList(int offset, int count, bool publicOnly = false);
Task<bool> ValidateSyntax(string syntax);
Task<bool> ValidateTitle(string title);
+1 -1
View File
@@ -1,3 +1,3 @@
<Solution>
<Project Path="SharpbinV3/SharpbinV3.Server.csproj" />
<Project Path="SharpbinV3.Server/SharpbinV3.Server.csproj" />
</Solution>
-12
View File
@@ -1,12 +0,0 @@
using Microsoft.EntityFrameworkCore;
using SharpbinV3.Server.Data.Entities;
namespace SharpbinV3.Server.Data
{
public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public DbSet<User> Users => Set<User>();
public DbSet<Paste> Pastes => Set<Paste>();
public DbSet<RefreshToken> RefreshTokens => Set<RefreshToken>();
}
}
-37
View File
@@ -1,37 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.Data.Entities
{
[Index(nameof(PID), IsUnique = true)]
[Index(nameof(UUID), IsUnique = true)]
[Index(nameof(ID), IsUnique = true)]
[Index(nameof(AuthorUUID))]
[Index(nameof(ExpiresAt))]
[Index(nameof(Views))]
[Index(nameof(Visibility))]
public sealed class Paste
{
[Key]
public int PID { get; set; }
public required Guid UUID { get; set; } // uuid v7 includes timestamp, this counts as created at
public required string ID { get; set; }
public string? Title { get; set; }
public required Guid AuthorUUID { get; set; } = Guid.Empty; // uuid of the user who created the paste, or Guid.Empty for anonymous pastes
public User? User { get; set; }
public long? EditedAt { get; set; }
public required byte[] Content { get; set; }
public long Size { get; set; } // stored size (may be compressed)
public long TrueSize { get; set; } // uncompressed size
public bool IsCompressed { get; set; } = false;
public int Views { get; set; }
public string? Syntax { get; set; }
public int Visibility { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private (encrypted pastes handled on frontend)
public long ExpiresAt { get; set; } // timestamp of when the paste expires, or 0 for never
}
}
-16
View File
@@ -1,16 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.Data.Entities
{
public sealed class RefreshToken
{
[Key]
public Guid UserUUID { get; set; }
public required string Token { get; set; }
public required string JwtId { get; set; }
public required long CreatedAt { get; set; }
public required long ExpiresAt { get; set; }
public bool Used { get; set; } = false;
public User? User { get; set; }
}
}
-21
View File
@@ -1,21 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.Data.Entities
{
[Index(nameof(UUID), IsUnique = true)]
public sealed class User
{
[Key]
public int UID { get; set; }
public required Guid UUID { get; set; } = Guid.CreateVersion7(); // uuid v7 includes timestamp
public required string Username { get; set; }
public required string PasswordHash { get; set; }
public string? Email { get; set; }
public string? DisplayName { get; set; }
public long? LastLogin { get; set; }
public int[] Roles { get; set; } = [0]; // 0 = regular user, 1 = moderator, 255 = admin
public int Visibility { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private
public List<Paste> Pastes { get; set; } = [];
}
}