Move from ./repo to ./http-root/chaotic-aur

This allows nginx to be used for other stuff too
This commit is contained in:
TNE 2022-04-19 20:23:26 +02:00
parent 473521d03e
commit 3de8599c96
6 changed files with 28 additions and 10 deletions

View File

@ -5,7 +5,7 @@ services:
restart: unless-stopped
hostname: ${DOMAIN_NAME:?err}
volumes:
- './repo:/var/lib/nginx/html/repo/chaotic-aur:ro'
- './http-root:/var/lib/nginx/html/http-root:ro'
- './data/acme-webroot:/var/lib/nginx/html/acme:ro'
- './data/letsencrypt/etc:/etc/letsencrypt:ro'
- './preset/nginx.conf:/etc/nginx/nginx.conf:ro'
@ -22,7 +22,7 @@ services:
- TZ=Europe/London
volumes:
- './data/syncthing:/config'
- './repo:/repo'
- './http-root/chaotic-aur:/repo'
ports:
- 8384:8384
- 22000:22000/tcp
@ -31,7 +31,7 @@ services:
restart: unless-stopped
cloudflared:
image: cloudflare/cloudflared:2022.2.2
image: cloudflare/cloudflared:2022.4.1
container_name: cloudflared
command: tunnel run --url http://nginx ${DOMAIN_NAME:?err}
user: root

View File

@ -5,7 +5,7 @@ services:
restart: unless-stopped
hostname: ${DOMAIN_NAME:?err}
volumes:
- './repo:/var/lib/nginx/html/repo/chaotic-aur:ro'
- './http-root:/var/lib/nginx/html/http-root:ro'
- './data/acme-webroot:/var/lib/nginx/html/acme:ro'
- './data/letsencrypt/etc:/etc/letsencrypt:ro'
- './preset/nginx.conf:/etc/nginx/nginx.conf:ro'
@ -29,7 +29,7 @@ services:
- TZ=Europe/London
volumes:
- './data/syncthing:/config'
- './repo:/repo'
- './http-root/chaotic-aur:/repo'
ports:
- 8384:8384
- 22000:22000/tcp

View File

@ -4,7 +4,7 @@ server {
autoindex_exact_size off;
autoindex_format xml;
root /var/lib/nginx/html/repo;
root /var/lib/nginx/html/http-root;
location ~* /chaotic-aur/x86_64/(?!.*chaotic-aur\.(db|files)).+\.tar.* {
add_header Cache-Control "max-age=150, stale-while-revalidate=150, stale-if-error=86400";
}

View File

@ -7,7 +7,7 @@ server {
autoindex_exact_size off;
autoindex_format xml;
root /var/lib/nginx/html/repo;
root /var/lib/nginx/html/http-root;
location ~* /chaotic-aur/x86_64/(?!.*chaotic-aur\.(db|files)).+\.tar.* {
add_header Cache-Control "max-age=150, stale-while-revalidate=150, stale-if-error=86400";
}

13
run
View File

@ -35,9 +35,16 @@ elif [ ! -e "./data/cloudflared/home/.cloudflared/cert.pem" ]; then
docker-compose -f docker-compose-tunnels.yml run --rm cloudflared tunnel route dns $DOMAIN_NAME $DOMAIN_NAME
fi
if [ ! -e ./repo ]; then
mkdir -p ./repo/.stfolder
chown -R 1000:1000 ./repo
if [ ! -e ./http-root/chaotic-aur ]; then
# Convert legacy
if [ -d ./repo ]; then
./stop
mkdir ./http-root
mv ./repo ./http-root/chaotic-aur
else
mkdir -p ./http-root/chaotic-aur/.stfolder
chown -R 1000:1000 ./http-root/chaotic-aur/
fi
fi
if [ ! -e ./data/syncthing/config.xml ]; then

11
stop Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo Run as root!
exit 1
fi
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose-tunnels.yml down