Remove Go doc comments, TS/Svelte scaffold comments and explanatory notes left over from the initial scaffold, plus a few leftover Spanish notes in the compose file, SQL scripts and env template. Also drops frontend/src/lib/index.ts, which only held the SvelteKit placeholder comment and was never imported.
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/caarlos0/env/v11"
|
|
)
|
|
|
|
type Config struct {
|
|
Env string `env:"APP_ENV" envDefault:"development"`
|
|
Port int `env:"PORT" envDefault:"8080"`
|
|
|
|
CORSAllowedOrigins []string `env:"CORS_ALLOWED_ORIGINS" envSeparator:"," envDefault:"http://localhost:5173"`
|
|
|
|
DatabaseURL string `env:"DATABASE_URL" envDefault:"postgres://dockermanager:dockermanager@localhost:5432/dockermanager?sslmode=disable"`
|
|
|
|
ZitadelIssuer string `env:"ZITADEL_ISSUER"`
|
|
ZitadelClientID string `env:"ZITADEL_CLIENT_ID"`
|
|
ZitadelClientSecret string `env:"ZITADEL_CLIENT_SECRET"`
|
|
SessionSecret string `env:"SESSION_SECRET" envDefault:"dev-insecure-secret-change-me"`
|
|
|
|
S3Endpoint string `env:"S3_ENDPOINT" envDefault:"http://localhost:8333"`
|
|
S3Bucket string `env:"S3_BUCKET" envDefault:"dockermanager"`
|
|
S3AccessKey string `env:"S3_ACCESS_KEY"`
|
|
S3SecretKey string `env:"S3_SECRET_KEY"`
|
|
|
|
DockerHost string `env:"DOCKER_HOST"`
|
|
}
|
|
|
|
func Load() (Config, error) {
|
|
cfg := Config{}
|
|
if err := env.Parse(&cfg); err != nil {
|
|
return Config{}, fmt.Errorf("parsing config: %w", err)
|
|
}
|
|
return cfg, nil
|
|
}
|