Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#70301 - [gitea] Provide split package with static files

Attached to Project: Community Packages
Opened by Blair Bonnett (bcb) - Monday, 05 April 2021, 14:55 GMT
Last edited by Maxime Gauduin (Alucryd) - Wednesday, 14 April 2021, 10:18 GMT
Task Type Feature Request
Category Packages
Status Assigned
Assigned To Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


As per the static files can be served directly through nginx instead of the gitea binary. The `make frontend` target places them in public/ and since the `make` call in the PKGBUILD includes this target the files are already available. All that is required is to package them.

I've attached an updated PKGBUILD plus a diff from the current trunk version. This uses a split package to give both `gitea` (same content as currently) and `gitea-static` (the static resources, stored under /usr/share/gitea/static). I figured a split package meant users who want to use only the binary don't end up with static files they don't use.

I've tested this on my server as per the instructions in the docs (set STATIC_URL_PREFIX and configure nginx to serve this prefix from the static dir).

Note that says "It is possible to serve the static assets directly via a reverse proxy, but in most cases it is not necessary, and assets should still be bundled in the binary". As a proof of concept I have built a version of the binary without bindata and it appears to work on my server. I guess supporting this would probably result in a third package (gitea-nobindata or something like that). Since the space saving is only 23MiB and the official docs say not to do this, I don't think it is something we need to worry about.
This task depends upon

Comment by Bruno Pagani (ArchangeGabriel) - Monday, 05 April 2021, 18:21 GMT
Are you really in a situation where the reverse proxying induces a performance penalty that is problematic to you?
Comment by Clar Fon (lightdark) - Thursday, 19 August 2021, 03:30 GMT
I personally would like the ability to run a binary without the bundled data, as it would likely reduce memory consumption. It's not a terribly large amount, but on low-memory systems it would be helpful. Plus, there are more configuration options for serving static files from a program like nginx than gitea, and you could, for example, pre-compress text files with gzip instead of having to do it live.