Add configure-instance script.

This commit is contained in:
FireMasterK 2021-08-25 01:09:59 +05:30
parent 99c44e571c
commit d32b534d24
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
6 changed files with 34 additions and 11 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config/

16
configure-instance.sh Executable file
View File

@ -0,0 +1,16 @@
echo "Enter a hostname for the Frontend (eg: piped.kavin.rocks):"
read frontend
echo "Enter a hostname for the Backend (eg: pipedapi.kavin.rocks):"
read backend
echo "Enter a hostname for the Proxy (eg: pipedproxy.kavin.rocks):"
read proxy
rm -rf config/
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/*

View File

@ -9,7 +9,7 @@ services:
image: 1337kavin/ytproxy:latest
restart: unless-stopped
volumes:
- ./ytproxy:/app/socket
- ytproxy:/app/socket
container_name: ytproxy
piped:
image: 1337kavin/piped:latest
@ -34,8 +34,9 @@ services:
- "443:443"
volumes:
- ./config/Caddyfile:/etc/caddy/Caddyfile
- ./caddy/config:/config
- ./ytproxy:/var/run/ytproxy
- caddy_data:/data
- caddy_config:/config
- ytproxy:/var/run/ytproxy
container_name: caddy
postgres:
image: postgres:13-alpine
@ -58,3 +59,7 @@ services:
- WATCHTOWER_INCLUDE_RESTARTING=true
container_name: watchtower
command: piped-frontend piped-backend ytproxy varnish caddy postgres watchtower
volumes:
caddy_data:
caddy_config:
ytproxy:

View File

@ -1,19 +1,22 @@
piped.domain.tld {
FRONTEND_HOSTNAME {
reverse_proxy pipedfrontend:80
}
pipedapi.domain.tld {
BACKEND_HOSTNAME {
reverse_proxy varnish:80
}
pipedproxy.domain.tld {
PROXY_HOSTNAME {
header_upstream -CF-Connecting-IP
header_upstream -X-Forwarded-For
@ytproxy path /videoplayback* /api/v4/* /api/manifest/*
@optionscall {
method OPTIONS
}
}
header Access-Control-Allow-Origin *
header Access-Control-Allow-Headers *
@ -22,7 +25,6 @@ pipedproxy.domain.tld {
header @ytproxy {
Cache-Control private always
CF-Connecting-IP ""
}
header / {
@ -38,4 +40,3 @@ pipedproxy.domain.tld {
}
}
}

View File

@ -5,7 +5,7 @@ PORT: 8080
HTTP_WORKERS: 2
# Proxy
PROXY_PART: https://pipedproxy.domain.tld
PROXY_PART: https://PROXY_HOSTNAME
# Outgoing HTTP Proxy - eg: 127.0.0.1:8118
#HTTP_PROXY: 127.0.0.1:8118
@ -15,7 +15,7 @@ CAPTCHA_BASE_URL: https://api.capmonster.cloud/
CAPTCHA_API_KEY: INSERT_HERE
# Public API URL
API_URL: https://pipedapi.domain.tld
API_URL: https://BACKEND_HOSTNAME
# Hibernate properties
hibernate.connection.url: jdbc:postgresql://postgres:5432/piped