Moved github PAT and storage path to env vars

This commit is contained in:
2026-03-30 22:02:39 +02:00
parent b1079efe58
commit bdf7d4f468
10 changed files with 35 additions and 32 deletions
+21 -5
View File
@@ -1,10 +1,14 @@
package envconfig
import "os"
import (
"os"
)
type EnvConfig struct {
Port string
ConfigDir string
Port string
ConfigDir string
GithubPat string
StoragePath string
}
func Load() EnvConfig {
@@ -18,8 +22,20 @@ func Load() EnvConfig {
configDir = "./"
}
githubPat := os.Getenv("GITHUB_PAT")
if githubPat == "" {
githubPat = ""
}
storagePath := os.Getenv("STORAGE_PATH")
if storagePath == "" {
storagePath = "./storage"
}
return EnvConfig{
Port: port,
ConfigDir: configDir,
Port: port,
ConfigDir: configDir,
GithubPat: githubPat,
StoragePath: storagePath,
}
}