- Use Google Distroless images for all services (Go & Node.js). - Standardize documentation with [PROJECT-NAME].md. - Add .dockerignore and .gitignore to all projects. - Remove docker-compose.yml in favor of docker run instructions. - Fix Go version and dependency issues in observability, repo-integrations, and security-governance. - Add Podman support (fully qualified image names). - Update Dashboard to use Node.js static server for Distroless compatibility.
41 lines
808 B
Go
41 lines
808 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
type Config struct {
|
|
DatabaseURL string
|
|
JWTSecret string
|
|
EncryptionKey string
|
|
GithubClientID string
|
|
GithubSecret string
|
|
}
|
|
|
|
func Load() *Config {
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
log.Println("No .env file found, using environment variables")
|
|
}
|
|
|
|
return &Config{
|
|
DatabaseURL: getEnv("DATABASE_URL", ""),
|
|
JWTSecret: getEnv("JWT_SECRET", ""),
|
|
EncryptionKey: getEnv("ENCRYPTION_KEY", ""),
|
|
GithubClientID: getEnv("GITHUB_CLIENT_ID", ""),
|
|
GithubSecret: getEnv("GITHUB_SECRET", ""),
|
|
}
|
|
}
|
|
|
|
func getEnv(key, fallback string) string {
|
|
if value, ok := os.LookupEnv(key); ok {
|
|
return value
|
|
}
|
|
if fallback == "" {
|
|
log.Fatalf("FATAL: Environment variable %s is not set.", key)
|
|
}
|
|
return fallback
|
|
}
|