diff --git a/.env.example b/.env.example index f2e98c3..34f9659 100644 --- a/.env.example +++ b/.env.example @@ -2,11 +2,11 @@ PUID= PGID= MEDIA_DIRECTORY= -INSTALL_LOCATION= +INSTALL_DIRECTORY= MEDIA_SERVICE= # VPN configuration -VPN_ENABLED= -VPN_SERVICE= -VPN_USER= -VPN_PASSWORD= +VPN_ENABLED=vpn_enabled +VPN_SERVICE=vpn_service +VPN_USER=vpn_user +VPN_PASSWORD=vpn_password diff --git a/docker-compose.example.yaml b/docker-compose.example.yaml index 9390f32..e3365e2 100644 --- a/docker-compose.example.yaml +++ b/docker-compose.example.yaml @@ -13,9 +13,9 @@ services: volumes: - ${MEDIA_DIRECTORY}/movies:/data/movies - ${MEDIA_DIRECTORY}/tvshows:/data/tvshows - - ${INSTALL_LOCATION}/config/${MEDIA_SERVICE}:/config - ports: - - 8096:8096 + - ${INSTALL_DIRECTORY}/config/${MEDIA_SERVICE}:/config + ports: # plex + - 8096:8096 # plex restart: unless-stopped # qBitorrent is used to download torrents @@ -28,7 +28,7 @@ services: - WEBUI_PORT=8080 volumes: - ${MEDIA_DIRECTORY}/downloads:/downloads - - ${INSTALL_LOCATION}/config/qbittorrent:/config + - ${INSTALL_DIRECTORY}/config/qbittorrent:/config restart: unless-stopped ports: # qbittorrent - 8080:8080 # qbittorrent @@ -45,7 +45,7 @@ services: volumes: - ${MEDIA_DIRECTORY}/tvshows:/tv - ${MEDIA_DIRECTORY}/downloads:/downloads - - ${INSTALL_LOCATION}/config/sonarr:/config + - ${INSTALL_DIRECTORY}/config/sonarr:/config ports: - 8989:8989 restart: unless-stopped @@ -61,7 +61,7 @@ services: volumes: - ${MEDIA_DIRECTORY}/movies:/movies - ${MEDIA_DIRECTORY}/downloads:/downloads - - ${INSTALL_LOCATION}/config/radarr:/config + - ${INSTALL_DIRECTORY}/config/radarr:/config ports: - 7878:7878 restart: unless-stopped @@ -77,7 +77,7 @@ services: volumes: - ${MEDIA_DIRECTORY}/music:/music - ${MEDIA_DIRECTORY}/downloads:/downloads - - ${INSTALL_LOCATION}/config/lidarr:/config + - ${INSTALL_DIRECTORY}/config/lidarr:/config ports: - 8686:8686 restart: unless-stopped @@ -93,7 +93,7 @@ services: volumes: - ${MEDIA_DIRECTORY}/books:/books - ${MEDIA_DIRECTORY}/downloads:/downloads - - ${INSTALL_LOCATION}/config/readarr:/config + - ${INSTALL_DIRECTORY}/config/readarr:/config ports: - 8787:8787 restart: unless-stopped @@ -109,7 +109,7 @@ services: volumes: - ${MEDIA_DIRECTORY}/movies:/movies - ${MEDIA_DIRECTORY}/tvshows:/tv - - ${INSTALL_LOCATION}/config/bazarr:/config + - ${INSTALL_DIRECTORY}/config/bazarr:/config ports: - 6767:6767 restart: unless-stopped @@ -123,7 +123,7 @@ services: - PUID=${PUID} - PGID=${PGID} volumes: - - ${INSTALL_LOCATION}/config/prowlarr:/config + - ${INSTALL_DIRECTORY}/config/prowlarr:/config ports: - 9696:9696 restart: unless-stopped @@ -142,7 +142,7 @@ services: - 8388:8388/udp # Shadowsocks #- 8080:8080/tcp # gluetun volumes: - - ${INSTALL_LOCATION}/config/gluetun:/config + - ${INSTALL_DIRECTORY}/config/gluetun:/config environment: - VPN_SERVICE_PROVIDER=${VPN_SERVICE} - VPN_TYPE=openvpn @@ -160,7 +160,7 @@ services: volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - - ${INSTALL_LOCATION}/config/portainer:/data + - ${INSTALL_DIRECTORY}/config/portainer:/data restart: unless-stopped # Watchtower is going to keep our instances updated diff --git a/docs.org b/docs.org index 406c739..2c6b3b6 100644 --- a/docs.org +++ b/docs.org @@ -379,18 +379,20 @@ sed -i -e "s||$puid|g" "$env_file" \ -e "s||$media_service|g" "$filename" if [ "$media_service" == "plex" ]; then - sed -i -e "s|#network_mode: host # plex|network_mode: host # plex|g" "$filename" + sed -i -e "s|#network_mode: host # plex|network_mode: host # plex|g" "$filename" \ + -e "s|ports: # plex|#ports: # plex|g" "$filename" \ + -e "s|- 8096:8096 # plex|#- 8096:8096 # plex|g" "$filename" fi -sed -i -e "s||$install_directory|g" "$env_file" +sed -i -e "s||$install_directory|g" "$env_file" \ + -e "s|vpn_enabled|$setup_vpn|g" "$env_file" \ if [ "$setup_vpn" == "y" ]; then - sed -i -e "s||$vpn_service|g" "$env_file" \ - -e "s||$vpn_user|g" "$env_file" \ - -e "s||$vpn_password|g" "$env_file" \ - -e "s||$setup_vpn|g" "$env_file" \ + sed -i -e "s|vpn_service|$vpn_service|g" "$env_file" \ + -e "s|vpn_user|$vpn_user|g" "$env_file" \ + -e "s|vpn_password|$vpn_password|g" "$env_file" \ -e "s|#network_mode: \"service:gluetun\"|network_mode: \"service:gluetun\"|g" "$filename" \ - -e "s|ports: # qbittorrent|#port: # qbittorrent|g" "$filename" \ + -e "s|ports: # qbittorrent|#ports: # qbittorrent|g" "$filename" \ -e "s|- 8080:8080 # qbittorrent|#- 8080:8080 # qbittorrent|g" "$filename" \ -e "s|#- 8080:8080/tcp # gluetun|- 8080:8080/tcp # gluetun|g" "$filename" fi diff --git a/install.sh b/install.sh index 8bf6514..aa872ae 100644 --- a/install.sh +++ b/install.sh @@ -222,18 +222,20 @@ sed -i -e "s||$puid|g" "$env_file" \ -e "s||$media_service|g" "$filename" if [ "$media_service" == "plex" ]; then - sed -i -e "s|#network_mode: host # plex|network_mode: host # plex|g" "$filename" + sed -i -e "s|#network_mode: host # plex|network_mode: host # plex|g" "$filename" \ + -e "s|ports: # plex|#ports: # plex|g" "$filename" \ + -e "s|- 8096:8096 # plex|#- 8096:8096 # plex|g" "$filename" fi -sed -i -e "s||$install_directory|g" "$env_file" +sed -i -e "s||$install_directory|g" "$env_file" \ + -e "s|vpn_enabled|$setup_vpn|g" "$env_file" \ if [ "$setup_vpn" == "y" ]; then - sed -i -e "s||$vpn_service|g" "$env_file" \ - -e "s||$vpn_user|g" "$env_file" \ - -e "s||$vpn_password|g" "$env_file" \ - -e "s||$setup_vpn|g" "$env_file" \ + sed -i -e "s|vpn_service|$vpn_service|g" "$env_file" \ + -e "s|vpn_user|$vpn_user|g" "$env_file" \ + -e "s|vpn_password|$vpn_password|g" "$env_file" \ -e "s|#network_mode: \"service:gluetun\"|network_mode: \"service:gluetun\"|g" "$filename" \ - -e "s|ports: # qbittorrent|#port: # qbittorrent|g" "$filename" \ + -e "s|ports: # qbittorrent|#ports: # qbittorrent|g" "$filename" \ -e "s|- 8080:8080 # qbittorrent|#- 8080:8080 # qbittorrent|g" "$filename" \ -e "s|#- 8080:8080/tcp # gluetun|- 8080:8080/tcp # gluetun|g" "$filename" fi diff --git a/yams b/yams index 762313e..c18c658 100755 --- a/yams +++ b/yams @@ -3,7 +3,7 @@ set -euo pipefail dc="docker-compose -f -f " -install_location="" +install_directory="" option=${1:-"--help"} @@ -94,16 +94,18 @@ if [ "$option" == "update" ]; then $dc stop rm -rf /tmp/yams && mkdir /tmp/yams wget https://gitlab.com/rogs/yams/-/raw/master/docker-compose.example.yaml -O /tmp/yams/docker-compose.example.yml > /dev/null 2>&1 - source $install_location/.env + source $install_directory/.env - filename="$install_location/docker-compose.yaml" + filename="$install_directory/docker-compose.yaml" cp /tmp/yams/docker-compose.example.yml $filename sed -i -e "s;;$MEDIA_SERVICE;g" "$filename" if [ "$MEDIA_SERVICE" == "plex" ]; then - sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" + sed -i -e "s|#network_mode: host # plex|network_mode: host # plex|g" "$filename" \ + -e "s|ports: # plex|#ports: # plex|g" $filename \ + -e "s|- 8096:8096 # plex|#- 8096:8096 # plex|g" $filename fi if [ "$VPN_ENABLED" == "y" ]; then