completed phase 2b
This commit is contained in:
@@ -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", ""),
|
||||
|
||||
Reference in New Issue
Block a user