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>
32 lines
1.2 KiB
Docker
32 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM golang:1.27-alpine AS build
|
|
# go.mod's go line may name a newer patch release than this image has; the go
|
|
# command then downloads that release instead of failing.
|
|
ENV GOTOOLCHAIN=auto
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
ARG VERSION=dev
|
|
ARG COMMIT=none
|
|
RUN CGO_ENABLED=0 go build -trimpath \
|
|
-ldflags "-s -w -X main.version=${VERSION} -X main.commit=${COMMIT}" \
|
|
-o /out/uberbringer ./cmd/uberbringer
|
|
|
|
FROM alpine:3.24
|
|
# ca-certificates for fetching https images, tzdata for local log times.
|
|
RUN apk add --no-cache ca-certificates tzdata \
|
|
&& addgroup -S uberbringer \
|
|
&& adduser -S -D -H -G uberbringer -h /etc/uberbringer uberbringer
|
|
COPY --from=build /out/uberbringer /usr/local/bin/uberbringer
|
|
USER uberbringer
|
|
WORKDIR /etc/uberbringer
|
|
# Plain HTTP for a reverse proxy in front, which terminates TLS. Mount
|
|
# config.toml at /etc/uberbringer/config.toml, or set UBERBRINGER_CONFIG to ""
|
|
# and give the settings as UBERBRINGER_* variables. Either way, bind_ip must be
|
|
# 0.0.0.0 and trusted_proxies must hold the proxy's address.
|
|
ENV UBERBRINGER_CONFIG=/etc/uberbringer/config.toml
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/usr/local/bin/uberbringer"]
|