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 Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:08 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

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.
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:08 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/gitea/issues/1
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.
Comment by Bjoern Bidar (Thaodan) - Monday, 29 August 2022, 18:53 GMT
I had the same idea today and would create a package in the aur until done so.

In any case it increases the response time and the performance.
Comment by Bjoern Bidar (Thaodan) - Monday, 29 August 2022, 21:55 GMT
I updated the package to split the package data into a -static package and change the binary to not bundle the static data.
The binary still works the same for regular users but allows users to let the webserver handle static data.

Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...