Skip to content

chore: adopt the PR #374 MIME fix and publish to GHCR - #375

Closed
gijsmin wants to merge 5 commits into
asternic:mainfrom
gijsmin:chore/adopt-pr-374
Closed

gijsmin wants to merge 5 commits into
asternic:mainfrom
gijsmin:chore/adopt-pr-374

Conversation

@gijsmin

@gijsmin gijsmin commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Two changes, both aimed at the fork eventually disappearing.

Adopt PR #374's implementation

main carried an earlier version of the document MIME-type fix in handlers.go. Upstream
#374 has a better one, and this branch adopts it
wholesale.

main before this branch
Lives in handlers.go media_sources.go, where upstream refactored the media path
Extension lookup mime.TypeByExtension explicit table
.odt / .ods / .odp broken fixed

That last row is not theoretical. Go's builtin MIME map covers .xlsx, .docx and .pptx but
omits OpenDocument, and Dockerfile installs no media-types package — so in the runtime image
main still sent those as application/zip. The PR's own comment says exactly this: "so the
lookup does not depend on the host MIME database, which slim images do not ship."

The diff against upstream is now exactly #374 — 5 files, +72/-13, matching the PR's own stats.
So if #374 merges, this fork's diff becomes nothing and the fork can be deleted. Carrying two
divergent fixes for one bug guaranteed a conflict instead.

The postman-collection tweak is dropped for the same reason: useful, but not part of #374, and it
would have kept a permanent diff. Worth folding into the PR itself.

Publish to GHCR, and actually run the tests

publish.yml builds ghcr.io/gijsmin/wuzapi on a version tag, for the 87w home server to pull.
linux/amd64 only — the server is an N100, and upstream's arm64 build means QEMU emulation under
CGO_ENABLED=1.

It also runs go test ./..., which nothing did before. Upstream's workflow is named "Build and
Test" but its steps are go vet and go build; the only test in the file is the name. The MIME
tests had therefore never executed. They now run on every push and gate the image.

Deliberately not touched: build.yml and docker-publish.yml. Both are byte-identical to
upstream, and editing either would create a conflict on every future sync. docker-publish.yml
can never fire here anyway — it pushes to asternic/wuzapi with Docker Hub secrets this fork does
not have, triggered by a published release this fork does not create.

gijsmin and others added 5 commits July 26, 2026 10:40
Fix document MIME type resolution
chore: sync with upstream asternic/wuzapi
main carried an earlier implementation of the same fix in handlers.go. The version in
upstream PR asternic#374 is better: it lives in media_sources.go where upstream refactored the
media path, and it carries an explicit extension table so OpenDocument files resolve
correctly - Go's builtin MIME map omits .odt/.ods/.odp and the slim runtime image ships
no media-types package, so main still sent those as application/zip.

Keeping two divergent fixes for one bug guarantees a conflict. This makes the fork's
diff against upstream exactly PR asternic#374, so if that lands the fork has no diff at all.

The new workflow runs go test, which nothing did before: upstream's 'Build and Test'
runs vet and build only.
@gijsmin

gijsmin commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Opened against the wrong repository by mistake

@gijsmin gijsmin closed this Oct 2, 2026
@gijsmin
gijsmin deleted the chore/adopt-pr-374 branch October 2, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant