Update application UI and functionality

This commit is contained in:
2026-07-26 16:20:36 +08:00
parent b9aff58f32
commit 97ea6fb7aa
48 changed files with 2790 additions and 628 deletions
@@ -36,6 +36,7 @@ type Config struct {
TimestampWindowSeconds int64 `json:"timestamp_window_seconds"`
MaxRequestBytes int64 `json:"max_request_bytes"`
MaxPackageBytes int64 `json:"max_package_bytes"`
ReleaseUploadMaxBytes int64 `json:"release_upload_max_bytes"`
Database DatabaseConfig `json:"database"`
Mail MailConfig `json:"mail"`
Branding BrandingConfig `json:"branding"`
@@ -149,6 +150,7 @@ func defaults(root string) *Config {
TimestampWindowSeconds: 600,
MaxRequestBytes: 12 * 1024 * 1024,
MaxPackageBytes: 10 * 1024 * 1024,
ReleaseUploadMaxBytes: 1024 * 1024 * 1024,
SourceCheckSeconds: 60,
Database: DatabaseConfig{
Provider: "sqlite",
@@ -340,6 +342,11 @@ func applyEnv(cfg *Config) {
cfg.MaxPackageBytes = parsed
}
}
if value := os.Getenv("YMHUT_RELEASE_UPLOAD_MAX_BYTES"); value != "" {
if parsed, err := strconv.ParseInt(value, 10, 64); err == nil {
cfg.ReleaseUploadMaxBytes = parsed
}
}
if value := os.Getenv("YMHUT_SOURCE_CHECK_SECONDS"); value != "" {
if parsed, err := strconv.Atoi(value); err == nil {
cfg.SourceCheckSeconds = parsed
@@ -453,6 +460,9 @@ func normalize(root string, cfg *Config) {
if cfg.MaxPackageBytes <= 0 {
cfg.MaxPackageBytes = 10 * 1024 * 1024
}
if cfg.ReleaseUploadMaxBytes <= 0 {
cfg.ReleaseUploadMaxBytes = 1024 * 1024 * 1024
}
if cfg.UploadGuard.MaxZipFiles <= 0 {
cfg.UploadGuard.MaxZipFiles = 80
}