This commit is contained in:
Benjamin Salzberg 2024-05-23 18:03:58 +02:00 committed by GitHub
commit f0469cf75e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 3 deletions

View file

@ -3,6 +3,14 @@ echo "Enter a hostname for the Frontend (eg: piped.kavin.rocks):" && read -r fro
echo "Enter a hostname for the Backend (eg: pipedapi.kavin.rocks):" && read -r backend
echo "Enter a hostname for the Proxy (eg: pipedproxy.kavin.rocks):" && read -r proxy
echo "Enter the reverse proxy you would like to use (either caddy or nginx):" && read -r reverseproxy
port=8080 # Define default port
if [[ $reverseproxy = "nginx" ]]; then # if the nginx reverse proxy is used, we want to get a custom port
echo "Enter a port to use for the reverse proxy:" && read -r port
fi
integerregex='^[0-9]+$'
if ! [[ $port =~ $integerregex ]] ; then # ensure that the port is an integer. If it is not set it to the default.
port=8080
fi
rm -rf config/
rm -f docker-compose.yml
@ -12,5 +20,6 @@ cp -r template/ config/
sed -i "s/FRONTEND_HOSTNAME/$frontend/g" config/*
sed -i "s/BACKEND_HOSTNAME/$backend/g" config/*
sed -i "s/PROXY_HOSTNAME/$proxy/g" config/*
sed -i "s/PORT_VALUE/$port/g" config/*
mv config/docker-compose.$reverseproxy.yml docker-compose.yml

View file

@ -1,5 +1,5 @@
# The port to Listen on.
PORT: 8080
PORT: PORT_VALUE
# The number of workers to use for the server
HTTP_WORKERS: 2

View file

@ -28,7 +28,7 @@ services:
image: nginx:mainline-alpine
restart: unless-stopped
ports:
- "8080:80"
- "PORT_VALUE:80"
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro

View file

@ -4,7 +4,7 @@ server {
listen 80;
server_name BACKEND_HOSTNAME;
set $backend "http://piped:8080";
set $backend "http://piped:PORT_VALUE";
location / {
proxy_cache pipedapi;