Merge branch 'master' of http://192.168.195.14:3000/outsource/HaniBlindBox
This commit is contained in:
commit
258dde42fd
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace HoneyBox.Admin.Business.Models.Upload;
|
||||||
|
|
||||||
|
public class GetPresignedUrlRequest
|
||||||
|
{
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
public string? ContentType { get; set; }
|
||||||
|
public int ExpiresInSeconds { get; set; } = 600;
|
||||||
|
public long FileSize { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
namespace HoneyBox.Admin.Business.Models.Upload;
|
||||||
|
|
||||||
|
public class PresignedUrlResponse
|
||||||
|
{
|
||||||
|
public string? UploadUrl { get; set; }
|
||||||
|
public string? AccessUrl { get; set; }
|
||||||
|
public string? FileUrl { get; set; }
|
||||||
|
public string? ObjectKey { get; set; }
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
public int ExpiresIn { get; set; }
|
||||||
|
public string? StorageType { get; set; }
|
||||||
|
public Dictionary<string, string>? Headers { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace HoneyBox.Admin.Business.Models.Upload;
|
||||||
|
|
||||||
|
public class UploadResponse
|
||||||
|
{
|
||||||
|
public string? Url { get; set; }
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
public long Size { get; set; }
|
||||||
|
public long FileSize { get; set; }
|
||||||
|
public string? ContentType { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
namespace HoneyBox.Admin.Business.Models.Upload;
|
||||||
|
|
||||||
|
public class UploadResult
|
||||||
|
{
|
||||||
|
public bool Success { get; set; }
|
||||||
|
public string? Url { get; set; }
|
||||||
|
public string? ErrorMessage { get; set; }
|
||||||
|
|
||||||
|
public static UploadResult Ok(string url)
|
||||||
|
{
|
||||||
|
return new UploadResult
|
||||||
|
{
|
||||||
|
Success = true,
|
||||||
|
Url = url
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UploadResult Fail(string errorMessage)
|
||||||
|
{
|
||||||
|
return new UploadResult
|
||||||
|
{
|
||||||
|
Success = false,
|
||||||
|
ErrorMessage = errorMessage
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,16 @@
|
||||||
|
|
||||||
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
|
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble AS base
|
||||||
|
# Install SkiaSharp native dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libfontconfig1 \
|
||||||
|
libfreetype6 \
|
||||||
|
libx11-6 \
|
||||||
|
libxext6 \
|
||||||
|
libxrender1 \
|
||||||
|
libc6-dev \
|
||||||
|
libgdiplus \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
USER $APP_UID
|
USER $APP_UID
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
<!-- Image Processing for Captcha -->
|
<!-- Image Processing for Captcha -->
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||||
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
14
server/HoneyBox/src/HoneyBox.Admin/admin-web/Dockerfile
Normal file
14
server/HoneyBox/src/HoneyBox.Admin/admin-web/Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# 构建阶段
|
||||||
|
FROM node:20-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN rm -f package-lock.json && npm install
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# 生产阶段
|
||||||
|
FROM nginx:alpine
|
||||||
|
COPY --from=build /wwwroot /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
18
server/HoneyBox/src/HoneyBox.Admin/admin-web/nginx.conf
Normal file
18
server/HoneyBox/src/HoneyBox.Admin/admin-web/nginx.conf
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://xiangyi-admin-api/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user