This commit is contained in:
Andrea Spacca 2022-07-23 12:48:10 +09:00
parent 19fb363fae
commit 12a05cad36
1 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
echo "Enter an url for the Frontend (eg: https://piped.kavin.rocks):" && read -r frontend
echo "Enter an url for the Backend (eg: https://pipedapi.kavin.rocks):" && read -r backend
echo "Enter an hostname for the Proxy (eg: https://pipedproxy.kavin.rocks):" && read -r proxy
echo "Enter an url for the Frontend (eg: https://piped.kavin.rocks):" && read -r frontend_url
echo "Enter an url for the Backend (eg: https://pipedapi.kavin.rocks):" && read -r backend_url
echo "Enter an hostname for the Proxy (eg: https://pipedproxy.kavin.rocks):" && read -r proxy_url
echo "Enter the reverse proxy you would like to use (either caddy or nginx):" && read -r reverseproxy
rm -rf config/
@ -20,21 +20,21 @@ frontend_port=$(echo "$frontend_url"| awk -F[/:] '{print $5}'| { read -d '' port
backend_port=$(echo "$backend_url"| awk -F[/:] '{print $5}'| { read -d '' port; [ -z "$port" ] && { [ "$backend_schema" = "https" ] && echo "443" || echo "80"; } || echo "$port"; })
proxy_port=$(echo "$proxy_url"| awk -F[/:] '{print $5}'| { read -d '' port; [ -z "$port" ] && { [ "$proxy_schema" = "https" ] && echo "443" || echo "80"; } || echo "$port"; })
sed -i "s@FRONT_URL@$frontend_url@g" config/*
sed -i "s@BACKEND_URL@$backend_url@g" config/*
sed -i "s@PROXY_URL@$proxy_url@g" config/*
sed -i '' "s@FRONT_URL@$frontend_url@g" config/*
sed -i '' "s@BACKEND_URL@$backend_url@g" config/*
sed -i '' "s@PROXY_URL@$proxy_url@g" config/*
sed -i "s@FRONTEND_HOSTNAME@$frontend_hostname@g" config/*
sed -i "s@BACKEND_HOSTNAME@$backend_hostname@g" config/*
sed -i "s@PROXY_HOSTNAME@$proxy_hostname@g" config/*
sed -i '' "s@FRONTEND_HOSTNAME@$frontend_hostname@g" config/*
sed -i '' "s@BACKEND_HOSTNAME@$backend_hostname@g" config/*
sed -i '' "s@PROXY_HOSTNAME@$proxy_hostname@g" config/*
sed -i "s@FRONTEND_PORT@$frontend_port@g" config/*
sed -i "s@BACKEND_PORT@$backend_port@g" config/*
sed -i "s@PROXY_PORT@$proxy_port@g" config/*
sed -i '' "s@FRONTEND_PORT@$frontend_port@g" config/*
sed -i '' "s@BACKEND_PORT@$backend_port@g" config/*
sed -i '' "s@PROXY_PORT@$proxy_port@g" config/*
# The openj9 image does not support aarch64
if [[ "$(uname -m)" == "aarch64" ]]; then
sed -i "s/piped:latest/piped:hotspot/g" config/*
sed -i '' "s/piped:latest/piped:hotspot/g" config/*
fi
mv config/docker-compose.$reverseproxy.yml docker-compose.yml