Phase 1 of docs/plans/formatters.md: single and double CP437 boxes from
one /print element, and a way to see a receipt without using paper.
- receipt: box, rule and kv elements, laid out when the job renders from
the printer profile, size and font (never fixed widths). Boxes take a
title (inline or capped), a footer, padding, fit and columns, and a
body of text or children (text, feed, kv, and rules as dividers joined
to the borders). Glyphs a code page lacks fall back per set: double-h
and double-v to double, then single, then ascii; a missing junction
switches line weight first.
- Validation names nested elements (elements[0].children[3] (qr)),
checks fields per block type, allows one level of children and counts
them toward the 500-element limit. Block fields on the older types are
problems, as they were unknown fields before.
- Text is composed to NFC and characters the code page lacks fold to
look-alikes (curly quotes, dashes, ellipsis, arrows, check marks, euro,
trademark), as the owner approved on 2026-11-29. An emoji sequence
prints as one '?'. Encodable text is untouched.
- escpos: CodePage.CanEncode and Decode, and Interpret, which reads a
command stream back as the printer would print it. It takes the
profile so that it can follow the printer's own wrapping and
alignment; raw spans stay opaque.
- POST /api/v1/preview and `uberbringer preview` show the lines a job
prints, as text or JSON with styles, without fetching images.
- Config: [format] max_lines (default 2000), refused with 422
too_many_lines on preview; printer.box_line_spacing (default 0).
Byte compatibility: testdata/compat fixtures were rendered by 9b91109
before the renderer changed, and still match it and the new renderer.
examples/blocks.json was printed on the TM-T88IV; the owner judged the
border gaps at the default spacing fine (2026-11-30), so
box_line_spacing stays 0, and TestPaperReceipts pins its bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 KiB
Changelog
All notable changes to Überbringer are recorded here. The format follows Keep a Changelog, and versions follow Semantic Versioning. Until 1.0, a minor version may break callers; such changes are listed under Breaking.
Unreleased
Added
-
Blocks, laid out to the printer model's width when the job prints:
box:single,double,double-h,double-vorasciiborders, a title set into the top border (inlineorcapped), a footer in the bottom border,padding,fitandcolumns. Its body istextorchildren: text, feed, kv and rules, which print as dividers joined to the borders.rule: nine line styles, fromsingleanddoubleto shades, dashes and dots, with an optional label.kv: key-value rows joined by a leader; long values wrap.
size(1–3) andfontscale a block's borders and text together. On cp850, cp858 and cp1252, glyphs the code page lacks fall back to ones it has. README § Blocks lists the fields. -
POST /api/v1/previewanduberbringer preview [file.json|-]show the lines a job would print, read back from its rendered bytes, without printing it or fetching images. The route answers plain text, or JSON with the styled runs, the line count and warnings for characters printed as?. -
[format]withmax_lines(default 2000): a job that would print more lines fails instead of printing./api/v1/previewanswers such a job with422and the new codetoo_many_lines. -
printer.box_line_spacing(default 0): the line spacing used while a box prints, to close the gaps in its vertical borders. The default, the printer's own spacing, was checked on paper on the TM-T88IV. -
examples/blocks.json, a receipt with every block style, padding, size and junction, for checking the borders on paper.
Changed
- Text is composed to Unicode NFC before it is printed, so a decomposed
éprints asé. Characters the code page lacks fold to look-alikes instead of printing as?: curly quotes print as"and',–as-,—as--,…as...,•as·,→ ←as-> <-,✓ ✔as√(orx),×asx,€asEURand™asTM. An emoji sequence, with its skin tone, variation selector or joined emoji, prints as one?instead of one per code point, and zero-width spaces and joiners are removed. A character the code page has prints as before, so cp1252 keeps its curly quotes and cp858 its€. invalid_jobdetails name nested elements by their path, e.g.elements[0].children[3] (qr): not allowed inside a box; place it after the box. A block field on another element type, such astitleontext, is listed there (field "title" does not apply to text) instead of failing the whole decode as an unknown field.
0.2.0 - 2026-11-30
The daemon is rewritten, and so are its install script and release process, and it is now licensed under the EUPL-1.2. Read Breaking before you upgrade a 0.1 install.
Breaking
POST /api/v1/printtakes{"elements": [...]}instead of{"data": [...]}. A body in the old format is refused with400invalid_job, and its message points to the README. README § Migrating from the old format maps each 0.1 item type to an element.POST /api/v1/printanswers202 Acceptedwith aLocationheader and a JSON job (id,status,created_at). 0.1 answered200with the textOK - <id>. Job IDs arejob_TypeIDs instead of numbers.- Every error is JSON:
{"error": "...", "code": "...", "details": [...]}. Clients should match oncode. 0.1 answered with{"message": "..."}or plain text. - Bearer tokens are read only from the
Authorizationheader. A token in a?token=query string gets401. 0.1 tokens keep working in the header whileapi.secretis unchanged. printer.addressis required. The 0.1 install script did not write it, so add a[printer]section withaddressto such a config before starting 0.2. Unknown config keys are now errors, so a typo no longer falls back to a default silently.api.secretmust be at least 32 bytes; secrets generated by the 0.1 install script are long enough.config.tomlis no longer tracked in the repository. If a clone uses it, copy it aside before pulling and put it back afterwards; git then leaves it untracked. New setups start fromconfigs/config.example.toml.
Added
-
Print queue. A job is accepted at once and printed in order by a single background worker. A failed send is retried with a doubling delay (
printer.retries,printer.retry_delay). A full queue answers503queue_fullwithRetry-After: 10. -
GET /api/v1/jobs/:idreportsqueued,printing,doneorfailed. A failed job includes anerror. The lastqueue.historyfinished jobs are kept. -
Elements:
text: sizes 1–8 (or separate width and height), bold, underline, invert, Font B and alignment;feedandqr;barcode: EAN-13, EAN-8, UPC-A, UPC-E, CODE39 and CODE128;image,rawandcut.
-
copies(1–5) prints the job several times, cutting after each copy. -
UTF-8 text is transcoded to
printer.codepage:cp437by default, orcp850,cp858orcp1252. A character the code page lacks prints as?. Control characters are removed. -
Word wrap at word boundaries for the paper width and character size. The position is tracked across
"newline": falseelements. -
Images come from a URL or base64, as PNG, JPEG, GIF or WebP. Each is scaled to the paper and dithered, with limits on download size, pixel count and printed height.
-
Printer profiles, chosen with
printer.model:tm-t88(TM-T88IV to VII), the default;tm-m50(TM-m50, TM-m50II);tm-t20(TM-T20, II, III);generic-80mmandgeneric-58mm.
printer.paper_widthandprinter.columnsoverride the profile. -
GET /healthzreports live printer status: paper near end or out, cover open, errors.- It answers
200when the printer is ready or does not answer status requests, and503when it is unreachable, not ready or too slow to answer. - A printer that looks not ready is read again 750 ms later, so a printer that is busy cutting or feeding raises no false alarm.
- It answers
-
A stable
codein every error response, listed in README § Errors. Examples arejob_not_foundandnot_foundfor404, andqueue_fullandshutting_downfor503. A405carriesAllow, and a429carriesRetry-After. -
Cache-Control: no-storeon/healthzand on every/api/v1response, error responses included. -
Commands
uberbringer secret, which prints a new API secret, anduberbringer token [--subject] [--ttl], which prints a signed bearer token. -
Config sections:
[webserver]: rate limit, trusted proxies, body limit and timeouts;[queue],[images]and[sentry];[log]: level, and text or JSON format.
Every optional key has a default, shown in
configs/config.example.toml. -
Graceful shutdown on SIGINT and SIGTERM. A receipt that is printing is finished, and waiting jobs are marked failed.
-
Logging:
- one
requestline per request, at INFO, or at WARN for a 5xx answer; - for an unexpected failure, one ERROR
request failedline and one Sentry event; - for a recovered panic, one ERROR
panicline with its stack trace and one Sentry event.
- one
-
An Alpine
Dockerfilethat runs as a non-root user. -
A hardened systemd unit,
packaging/uberbringer.service, shipped in the release archives and installed to/usr/local/lib/systemd/system/.- It has no capabilities and a read-only file system, and its address families and system calls are restricted.
- It sets start-rate limits.
- Customise it with
systemctl edit uberbringerdrop-ins.
-
install.sh:- takes the printer address as its third argument;
- installs a given release with
UBERBRINGER_VERSION=vX.Y.Z; - installs on arm64, armv7 and armv6 as well as amd64.
-
Release archives contain
LICENSE.txt,README.md,configs/config.example.tomlandpackaging/uberbringer.servicenext to the binary. -
A weekly govulncheck run (Mondays 06:00 UTC, and on every push to main), so a new advisory against unchanged dependencies is reported.
-
A Makefile for development.
make checkruns the CI gate in the same order,make vulnruns govulncheck andmake snapshotbuilds the release archives without publishing them.makebuilds report the version without a leadingv, as release binaries do.
Changed
- The licence is now the European Union Public Licence v. 1.2 (EUPL-1.2), replacing the GNU Affero General Public License v3.0. Releases up to and including 0.1.2 stay available under AGPL-3.0.
- The HTTP server is Fiber v3 instead of Echo. ESC/POS commands come from an in-house package instead of justinmichaelvieira/escpos.
printer.modeldefaults totm-t88: 512 dots, 42 Font A columns. On a 576-dot printer such as a TM-T20, setmodel = "tm-t20"to use the full width. A profile wider than the printer makes it break words at the right edge; a narrower one only shortens lines.- Request IDs are
req_TypeIDs (UUIDv7). - Rate limiting is per client and covers
/apionly:webserver.rate_limitrequests perwebserver.rate_window, 60 per minute by default. Behind nginx, the client is theX-Real-IPset by the proxy on 127.0.0.1. 0.1 allowed about one request per second on every route. - Error messages are fixed texts set by the server. The HTTP framework's own
text, which can quote bytes of the request, is never sent; an unknown route
answers
not found. - Expected refusals are not logged as errors or sent to Sentry: 4xx answers,
a full queue, shutdown, and an unhealthy
/healthz. - Release binaries take their default Sentry DSN from the
SENTRY_DSNCI secret instead of from the repository.sentry.dsnand theSENTRY_DSNenvironment variable override it. install.sh, user and secrets:- The service runs as a dedicated
uberbringeruser instead of root. - The config is written under umask 027 and set to 0640 root:uberbringer.
- The first API token goes to
/etc/uberbringer/initial-token(0600, root) instead of the terminal. Re-runs create no new tokens.
- The service runs as a dedicated
install.sh, download and certificate:- The download is checked against the release's
checksums.txt(sha256) before anything is installed. - A certificate is requested only when none is installed, and acme.sh's cron job renews it. The CA is now explicitly Let's Encrypt; acme.sh's default is ZeroSSL.
apt-get updateruns before packages are installed, and apt output goes to/var/log/uberbringer-install.log.
- The download is checked against the release's
install.sh, re-runs and validation:- A re-run keeps the config, the certificate and unit drop-ins. It restarts the service only when the binary, the unit or the config changed.
- A unit at
/etc/systemd/system/uberbringer.servicewritten by the 0.1 script is disabled and renamed to.bak. - Domains and printer addresses that contain anything other than host-name or IP-address characters are rejected.
- Go:
- The minimum is Go 1.26.
- The toolchain is pinned in
go.modastoolchain go1.27.4, which fixes GO-2026-6859. CI, the security scan and releases all use it. - Every dependency is upgraded, and
vendor/is gone. - The module path is still the bare
uberbringer, so build from a clone.
- CI moved from
.github/workflowsto.gitea/workflows.test.ymlruns once per branch push, and its gate is gofmt, goimports,go mod tidy -diff, go vet, staticcheck,go test -race -timeout 5mandgoreleaser check. It builds no binaries: they are built only for release tags on main. - Releases:
- Releases are cut only from
v*tags whose commit is on main, with goreleaser pinned to 2.20.3. -rc.Ntags are published as prereleases, and an rc tag on the same commit as the final tag cannot be picked by mistake.- A release fails, instead of silently rewriting
go.modandgo.sum, when they are not tidy. - File times come from the tag's commit, so rebuilding a tag gives byte-identical archives.
- Release notes start with a link to this file.
- Releases are cut only from
Removed
- The
{"data": [...]}job format with numeric item types, and token lookup from query strings (see Breaking). - The pull-request labeler workflow, which had no configuration.
- The
vendor/directory and the.idea/project files.
Fixed
- A job is validated in full before it is queued; the
400lists every problem. Nothing reaches the printer unless the whole receipt rendered. - A failed connection to the printer is retried, and the job is then marked
failed. In 0.1 it panicked the request handler, which answered
500. - Request logs never contain tokens.
- Sentry no longer receives the
Authorizationheader or print contents. install.shwrites the[printer]section. Without it, 0.1 dialled port 9100 on the local host.
Security
- The
config.tomltracked in 0.1.x held an API secret, and that secret is still readable in the repository history.- An install that uses it must replace
api.secretwith the output ofuberbringer secret, then issue new tokens. Every token signed with the old secret stops working. - Installs set up by
install.shgenerated their own secret and are not affected.
- An install that uses it must replace
- The 0.1 install script left
/etc/uberbringer/config.tomlreadable by every user (mode 0644 under the usual umask). Re-running the new script keeps the file as it is. On an upgraded host, after the re-run has created theuberbringergroup, runchown root:uberbringer /etc/uberbringer/config.tomlandchmod 0640 /etc/uberbringer/config.toml. - Image URLs are fetched through an SSRF guard.
- A URL is refused when it resolves to a loopback, private or link-local address, cloud metadata endpoints included.
- The check runs at connect time, after DNS resolution, and again on every redirect.
images.allow_private_networksturns the address check off.images.allowed_hostslimits fetches to the listed hosts, which may then be on the LAN.- 0.1 fetched any URL.
api.secretmust be at least 32 bytes (see Breaking).
0.1.2 - 2025-01-12
Added
- Item type 7 prints the image at the URL given in
text.
0.1.1 - 2025-01-12
Added
- First release:
POST /api/v1/printwith{"data": [...]}items of types 1–6: text, bold text, QR code, line feed, n line feeds and raw hex;- HS256 bearer tokens;
install.shfor Debian and Ubuntu with nginx and an acme.sh certificate.