Refactor to Go standards; add print queue and own ESC/POS library
CI / Lint, test and scan (push) Successful in 1m41s

Restructure the daemon to follow the project's Go coding standards and
expand its features.

Layout and tooling
- cmd/uberbringer/main.go is now thin; all logic lives under internal/.
- Module path is git.anomalous.dev/57_Wolve/uberbringer, go 1.26, every
  dependency upgraded, vendor/ removed.
- staticcheck, govulncheck and goimports pinned as go tools; add a
  Makefile, CI workflow, goreleaser v2 config and Alpine Dockerfile.

Features
- Background print queue with job status (GET /api/v1/jobs/:id), send
  retries with backoff, and graceful shutdown.
- New {"elements": [...]} job format on POST /api/v1/print. Breaking:
  replaces {"data": [...]}, and the response is now JSON 202.
- In-house ESC/POS library replacing justinmichaelvieira/escpos: sizes
  1-8, Font B, CODE39/CODE128, QR, banded raster images, DLE EOT status.
- UTF-8 text transcoded to CP437 (configurable) with word-aware wrapping.
- Images from URL or base64, scaled and dithered; URL fetches refuse
  internal addresses (SSRF guard).
- Fiber v3 HTTP server, TypeID (UUIDv7) job and request IDs, /healthz
  with live printer status, `secret` and `token` subcommands.

Fixes
- Jobs are validated before anything is sent; a failed printer dial no
  longer panics.
- Request logs never contain tokens; Sentry no longer receives the
  Authorization header or print contents.
- Rate limiting is per client behind nginx (X-Real-IP).
- install.sh writes the [printer] section, runs the service as a
  dedicated user and uses a current nginx TLS config.

config.toml is no longer tracked; start from configs/config.example.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-29 21:17:16 -06:00
1 parent bb73348433
commit 6502d9551d
807 files changed
+6659 -500291

No files matched your search

+39 -23
View File
@@ -1,32 +1,48 @@
module uberbringer
module git.anomalous.dev/57_Wolve/uberbringer
go 1.23.4
go 1.26.0
require (
github.com/BurntSushi/toml v1.4.0
github.com/foize/go.fifo v0.0.0-20130327144150-3a04cfeec121
github.com/getsentry/sentry-go v0.31.1
github.com/getsentry/sentry-go/echo v0.31.1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/justinmichaelvieira/escpos v0.1.1
github.com/labstack/echo-jwt/v4 v4.3.0
github.com/labstack/echo/v4 v4.13.3
github.com/liamg/tml v0.7.0
github.com/spf13/cobra v1.8.1
golang.org/x/time v0.8.0
github.com/BurntSushi/toml v1.6.0
github.com/getsentry/sentry-go v0.50.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/spf13/cobra v1.10.2
go.jetify.com/typeid v1.3.0
golang.org/x/image v0.48.0
golang.org/x/sync v0.25.0
golang.org/x/text v0.44.0
)
require (
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
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/justinmichaelvieira/iconv v0.1.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/klauspost/compress v1.20.5 // indirect
github.com/mattn/go-colorable v0.1.16 // indirect
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/spf13/pflag v1.1.0 // indirect
github.com/tinylib/msgp v1.6.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
github.com/valyala/fasthttp v1.80.0 // 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
golang.org/x/net v0.63.0 // indirect
golang.org/x/sys v0.50.0 // indirect
golang.org/x/telemetry v0.0.0-20261116191925-e77a43154acb // indirect
golang.org/x/tools v0.53.0 // indirect
golang.org/x/vuln v1.10.0 // indirect
honnef.co/go/tools v0.8.2 // indirect
)
tool (
golang.org/x/tools/cmd/goimports
golang.org/x/vuln/cmd/govulncheck
honnef.co/go/tools/cmd/staticcheck
)