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

View file

@ -1,13 +1,16 @@
piped.domain.tld { FRONTEND_HOSTNAME {
reverse_proxy pipedfrontend:80 reverse_proxy pipedfrontend:80
} }
pipedapi.domain.tld { BACKEND_HOSTNAME {
reverse_proxy varnish:80 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/* @ytproxy path /videoplayback* /api/v4/* /api/manifest/*
@ -22,7 +25,6 @@ pipedproxy.domain.tld {
header @ytproxy { header @ytproxy {
Cache-Control private always Cache-Control private always
CF-Connecting-IP ""
} }
header / { header / {
@ -38,4 +40,3 @@ pipedproxy.domain.tld {
} }
} }
} }

View file

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