feat(docker): host gzip archive downloads

- added config option [mkpkglists] archivedir
    - created by mkpkglists

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-10 06:20:22 -08:00
parent abbecf5194
commit 4f7aeafa8d
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
6 changed files with 38 additions and 6 deletions

View file

@ -94,7 +94,24 @@ http {
ssl_certificate /etc/ssl/certs/web.cert.pem;
ssl_certificate_key /etc/ssl/private/web.key.pem;
root /aurweb/web/html;
location ~ ^/.*\.gz$ {
# Override mime type to text/plain.
types { text/plain gz; }
default_type text/plain;
# Filesystem location of .gz archives.
root /var/lib/aurweb/archives;
# When we match this block, fix-up trying without a trailing slash.
try_files $uri $uri/ =404;
# Caching headers.
expires max;
add_header Content-Encoding gzip;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
}
location / {
try_files $uri @proxy_to_app;

View file

@ -1,6 +1,10 @@
#!/bin/bash
set -eou pipefail
for archive in packages pkgbase users packages-meta-v1.json packages-meta-ext-v1.json; do
ln -vsf /var/lib/aurweb/archives/${archive}.gz /aurweb/web/html/${archive}.gz
done
# Setup a config for our mysql db.
cp -vf conf/config.dev conf/config
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config