Provide split package with static files
Task Info (Flyspray) | |
---|---|
Opened By | Blair Bonnett (bcb) |
Task ID | 70301 |
Type | Feature Request |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2021-04-05 14:55:24 UTC |
Status | Assigned |
Assignee | Bruno Pagani (ArchangeGabriel) |
Details
As per https://docs.gitea.io/en-us/reverse-proxies/#nginx-and-serve-static-resources-directly 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 https://docs.gitea.io/en-us/install-from-source/#build 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.