build and ready for demo

login screen
This commit is contained in:
Daniel Noulet 2026-09-19 17:33:44 +02:00
parent 0ae2dc3888
commit 6af2853faa
33 changed files with 2020 additions and 1221 deletions

View file

@ -1,24 +1,25 @@
// Package config carries the runtime settings for the demo CMS. There is no
// database to configure: content is seeded in memory and optionally mirrored to
// a single JSON file.
package config
import (
"os"
)
import "os"
// Config carries the runtime settings for the CMS. The application database is
// the only datastore: identities and sessions belong to the upstream SSO proxy.
type Config struct {
HTTPAddr, ApplicationDatabaseURL string
HTTPAddr, Profile, ContentFile, PostgresURL string
AllowedOrigins, SSOHeader, SSOToken, SSOCookie string
}
func Load() Config {
return Config{
HTTPAddr: get("CMS_HTTP_ADDR", ":8080"),
ApplicationDatabaseURL: get("CMS_APPLICATION_DATABASE_URL", "host=localhost user=cms password=cms dbname=cms port=5432 sslmode=disable"),
AllowedOrigins: get("CMS_ALLOWED_ORIGINS", "http://localhost:5173"),
SSOHeader: get("CMS_SSO_HEADER", "X-SSO-Token"),
SSOToken: get("CMS_SSO_TOKEN", ""),
SSOCookie: get("CMS_SSO_COOKIE", ""),
HTTPAddr: get("CMS_HTTP_ADDR", ":8080"),
Profile: get("CMS_PROFILE", "demo"),
ContentFile: get("CMS_CONTENT_FILE", ""),
PostgresURL: get("CMS_POSTGRES_URL", ""),
AllowedOrigins: get("CMS_ALLOWED_ORIGINS", "http://localhost:5173"),
SSOHeader: get("CMS_SSO_HEADER", "X-SSO-Token"),
SSOToken: get("CMS_SSO_TOKEN", ""),
SSOCookie: get("CMS_SSO_COOKIE", ""),
}
}