Read the config with Viper and environment variables, on Go 1.27.4
The config loader uses Viper instead of BurntSushi/toml. Every setting can also come from UBERBRINGER_<SECTION>_<KEY>, which wins over the file, and UBERBRINGER_CONFIG sets the default of --config; set empty, no file is read, so a container can run from the environment alone. Each setting is bound to its own variable, so a variable named after a section changes nothing. The file is parsed with go-toml and checked as written: unknown keys, empty tables and keys that differ only in case are errors, a UTF-8 BOM is skipped and a UTF-16 file is refused. Values are decoded strictly: durations are strings, numbers decimal, flags true or false, and a fraction for a whole number is refused. Errors name the file, the line of a syntax error and the variables that were set, never their values. `uberbringer config get <key>` prints one setting as the daemon would use it. install.sh reads body_limit, bind_ip and port through it, so the config is checked before the service restarts and Caddy proxies to the configured address. The script then waits for the daemon to answer, downloads Caddy's key and source list before replacing them, requires Caddy's own repository, keeps the Caddyfile during dpkg upgrades, detects an existing import loosely, logs Caddy's other errors, drops query strings from the access log and validates the domain and printer address more tightly. go.mod names Go 1.27.4 with no toolchain line, and the workflows check against the go line. The changelog folds the unreleased entries into 0.2.0, which is not tagged yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
92dcacb3b9
commit
eacd0bfd27
18 files changed
+1244
-248
No files matched your search
@@ -1,19 +1,16 @@
|
||||
module uberbringer
|
||||
|
||||
go 1.26.0
|
||||
|
||||
// The Go release CI tests, scans and builds releases with; the workflows
|
||||
// read it from here. A local Go older than this switches to it, so local
|
||||
// runs use the same standard library.
|
||||
toolchain go1.27.4
|
||||
go 1.27.4
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.6.0
|
||||
github.com/getsentry/sentry-go v0.50.0
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0
|
||||
github.com/gofiber/fiber/v3 v3.7.0
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/liamg/tml v0.7.1
|
||||
github.com/pelletier/go-toml/v2 v2.4.3
|
||||
github.com/spf13/cobra v1.10.2
|
||||
github.com/spf13/viper v1.21.0
|
||||
go.jetify.com/typeid v1.3.0
|
||||
golang.org/x/image v0.48.0
|
||||
golang.org/x/sync v0.25.0
|
||||
@@ -21,6 +18,8 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.6.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/gofiber/schema v1.10.2 // indirect
|
||||
github.com/gofiber/utils/v2 v2.6.5 // indirect
|
||||
github.com/gofrs/uuid/v5 v5.5.1 // indirect
|
||||
@@ -31,10 +30,16 @@ require (
|
||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||
github.com/molecule-man/go-brrr v1.3.1 // indirect
|
||||
github.com/philhofer/fwd v1.2.1 // indirect
|
||||
github.com/sagikazarmark/locafero v0.11.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/pflag v1.1.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tinylib/msgp v1.6.5 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.80.0 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.6 // indirect
|
||||
golang.org/x/crypto v0.59.0 // indirect
|
||||
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
|
||||
golang.org/x/mod v0.43.0 // indirect
|
||||
|
||||
Reference in new issue
Block a user