completed phase 2b

This commit is contained in:
2026-05-11 20:10:45 +02:00
parent 83d96d0a1e
commit 4002a3b84d
20 changed files with 1566 additions and 50 deletions
+8 -4
View File
@@ -3,6 +3,7 @@ package config
import (
"fmt"
"os"
"path/filepath"
"strconv"
)
@@ -14,7 +15,8 @@ type Config struct {
DatabaseURL string
// Storage
RepoRoot string
RepoRoot string
ArtifactRoot string
// Security
SessionSecret string // must be 32 or 64 bytes for AES-GCM
@@ -37,10 +39,12 @@ type Config struct {
}
func Load() (*Config, error) {
repoRoot := getEnv("REPO_ROOT", "/var/lib/forgebucket/repos")
cfg := &Config{
Port: getEnv("PORT", "8080"),
RepoRoot: getEnv("REPO_ROOT", "/var/lib/forgebucket/repos"),
Debug: getEnvBool("DEBUG", false),
Port: getEnv("PORT", "8080"),
RepoRoot: repoRoot,
ArtifactRoot: getEnv("ARTIFACT_ROOT", filepath.Join(filepath.Dir(repoRoot), "artifacts")),
Debug: getEnvBool("DEBUG", false),
NATSUrl: getEnv("NATS_URL", ""),
InstanceURL: getEnv("INSTANCE_URL", ""),