diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-10-21 15:43:02 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-10-21 15:43:02 -0300 |
commit | 48b9205da6686d0e2a8697f4deaa7cf04d808258 (patch) | |
tree | 461da830b1013dcf3e3516859bb2cea53ee7adaa | |
parent | 36f45d690f5d187fb51cc99970893d44be9218ba (diff) |
Testing the new docker-compose file
-rw-r--r-- | .env.example | 11 | ||||
-rw-r--r-- | docker-compose.example.yaml | 88 | ||||
-rw-r--r-- | docs.org | 21 | ||||
-rw-r--r--[-rwxr-xr-x] | install.sh | 22 |
4 files changed, 80 insertions, 62 deletions
diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..217fb1e --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Base configuration +PUID=<your_PUID> +PGID=<your_PGID> +MEDIA_FOLDER=<media_folder> +INSTALL_LOCATION=<install_location> +MEDIA_SERVICE=<media_service> + +# VPN configuration +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 5605e37..9658536 100644 --- a/docker-compose.example.yaml +++ b/docker-compose.example.yaml @@ -3,17 +3,17 @@ version: "3" services: # <media_service> is used to serve your media to the client devices <media_service>: - image: lscr.io/linuxserver/<media_service> - container_name: <media_service> + image: lscr.io/linuxserver/${MEDIA_SERVICE} + container_name: ${MEDIA_SERVICE} #network_mode: host # plex environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} - VERSION=docker volumes: - - <media_folder>/movies:/data/movies - - <media_folder>/tvshows:/data/tvshows - - <install_location>/config/<media_service>:/config + - ${MEDIA_FOLDER}/movies:/data/movies + - ${MEDIA_FOLDER}/tvshows:/data/tvshows + - ${INSTALL_LOCATION}/config/${MEDIA_SERVICE}:/config ports: - 8096:8096 restart: unless-stopped @@ -23,12 +23,12 @@ services: image: lscr.io/linuxserver/qbittorrent container_name: qbittorrent environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} - WEB_UI_PORT=8080 volumes: - - <media_folder>/downloads:/downloads - - <install_location>/config/qbittorrent:/config + - ${MEDIA_FOLDER}/downloads:/downloads + - ${INSTALL_LOCATION}/config/qbittorrent:/config restart: unless-stopped ports: # qbittorrent - 8080:8080 # qbittorrent @@ -40,12 +40,12 @@ services: image: lscr.io/linuxserver/sonarr container_name: sonarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <media_folder>/tvshows:/tv - - <media_folder>/downloads:/downloads - - <install_location>/config/sonarr:/config + - ${MEDIA_FOLDER}/tvshows:/tv + - ${MEDIA_FOLDER}/downloads:/downloads + - ${INSTALL_LOCATION}/config/sonarr:/config ports: - 8989:8989 restart: unless-stopped @@ -56,12 +56,12 @@ services: image: lscr.io/linuxserver/radarr container_name: radarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <media_folder>/movies:/movies - - <media_folder>/downloads:/downloads - - <install_location>/config/radarr:/config + - ${MEDIA_FOLDER}/movies:/movies + - ${MEDIA_FOLDER}/downloads:/downloads + - ${INSTALL_LOCATION}/config/radarr:/config ports: - 7878:7878 restart: unless-stopped @@ -72,12 +72,12 @@ services: image: lscr.io/linuxserver/lidarr container_name: lidarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <media_folder>/music:/music - - <media_folder>/downloads:/downloads - - <install_location>/config/lidarr:/config + - ${MEDIA_FOLDER}/music:/music + - ${MEDIA_FOLDER}/downloads:/downloads + - ${INSTALL_LOCATION}/config/lidarr:/config ports: - 8686:8686 restart: unless-stopped @@ -88,12 +88,12 @@ services: image: lscr.io/linuxserver/readarr:develop container_name: readarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <media_folder>/books:/books - - <media_folder>/downloads:/downloads - - <install_location>/config/readarr:/config + - ${MEDIA_FOLDER}/books:/books + - ${MEDIA_FOLDER}/downloads:/downloads + - ${INSTALL_LOCATION}/config/readarr:/config ports: - 8787:8787 restart: unless-stopped @@ -104,12 +104,12 @@ services: image: lscr.io/linuxserver/bazarr container_name: bazarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <media_folder>/movies:/movies - - <media_folder>/tvshows:/tv - - <install_location>/config/bazarr:/config + - ${MEDIA_FOLDER}/movies:/movies + - ${MEDIA_FOLDER}/tvshows:/tv + - ${INSTALL_LOCATION}/config/bazarr:/config ports: - 6767:6767 restart: unless-stopped @@ -120,10 +120,10 @@ services: image: lscr.io/linuxserver/prowlarr container_name: prowlarr environment: - - PUID=<your_PUID> - - PGID=<your_PGID> + - PUID=${PUID} + - PGID=${PGID} volumes: - - <install_location>/config/prowlarr:/config + - ${INSTALL_LOCATION}/config/prowlarr:/config ports: - 9696:9696 restart: unless-stopped @@ -142,12 +142,12 @@ services: - 8388:8388/udp # Shadowsocks #- 8080:8080/tcp # gluetun volumes: - - <install_location>/config/gluetun:/config + - ${INSTALL_LOCATION}/config/gluetun:/config environment: - - VPN_SERVICE_PROVIDER=<vpn_service> + - VPN_SERVICE_PROVIDER=${VPN_SERVICE} - VPN_TYPE=openvpn - - OPENVPN_USER=<vpn_user> - - OPENVPN_PASSWORD=<vpn_password> + - OPENVPN_USER=${VPN_USER} + - OPENVPN_PASSWORD=${VPN_PASSWORD} - OPENVPN_CIPHERS=AES-256-GCM restart: unless-stopped @@ -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_LOCATION}/config/portainer:/data restart: unless-stopped # Watchtower is going to keep our instances updated @@ -180,6 +180,7 @@ install_location=${install_location:-/opt/yams} [[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it" install_location=$(realpath "$install_location") filename="$install_location/docker-compose.yaml" +env_file="$install_location/.env" read -p "What's the user that is going to own the media server files? [$USER]: " username @@ -316,6 +317,7 @@ echo "" echo "Copying $filename..." cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" +cp .env.example "$env_file" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" #+end_src ** Set PUID, PGID, Media Folder, Media Service, Config folder and VPN @@ -325,36 +327,33 @@ cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($US #+begin_src bash # Set PUID -sed -i -e "s/<your_PUID>/$puid/g" "$filename" +sed -i -e "s/<your_PUID>/$puid/g" "$env_file" # Set PGID -sed -i -e "s/<your_PGID>/$pgid/g" "$filename" +sed -i -e "s/<your_PGID>/$pgid/g" "$env_file" # Set media_folder -sed -i -e "s;<media_folder>;$media_folder;g" "$filename" +sed -i -e "s;<media_folder>;$media_folder;g" "$env_file" # Set media_service +sed -i -e "s;<media_service>;$media_service;g" "$env_file" sed -i -e "s;<media_service>;$media_service;g" "$filename" if [ "$media_service" == "plex" ]; then sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" fi # Set config folder -sed -i -e "s;<install_location>;$install_location;g" "$filename" +sed -i -e "s;<install_location>;$install_location;g" "$env_file" # Set VPN if [ "$setup_vpn" == "y" ]; then - sed -i -e "s;<vpn_service>;$vpn_service;g" "$filename" - sed -i -e "s;<vpn_user>;$vpn_user;g" "$filename" - sed -i -e "s;<vpn_country>;$vpn_country;g" "$filename" - sed -i -e "s;<vpn_password>;$vpn_password;g" "$filename" + sed -i -e "s;<vpn_service>;$vpn_service;g" "$env_file" + sed -i -e "s;<vpn_user>;$vpn_user;g" "$env_file" + sed -i -e "s;<vpn_password>;$vpn_password;g" "$env_file" sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename" sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename" sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename" sed -i -e "s;#- 8080:8080/tcp # gluetun;- 8080:8080/tcp # gluetun;g" "$filename" - if echo "nordvpn perfect privacy private internet access vyprvpn wevpn windscribe" | grep -qw "$vpn_service"; then - sed -i -e "s;SERVER_COUNTRIES;SERVER_REGIONS;g" "$filename" - fi fi #+end_src diff --git a/install.sh b/install.sh index eeb9f7b..b943422 100755..100644 --- a/install.sh +++ b/install.sh @@ -77,6 +77,7 @@ install_location=${install_location:-/opt/yams} [[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it" install_location=$(realpath "$install_location") filename="$install_location/docker-compose.yaml" +env_file="$install_location/.env" read -p "What's the user that is going to own the media server files? [$USER]: " username @@ -168,6 +169,11 @@ if [ "$setup_vpn" == "y" ]; then fi done echo + + echo "What country do you want to use?" + echo "If you are using: NordVPN, Perfect Privacy, Private Internet Access, VyprVPN, WeVPN or Windscribe, then input a region" + read -p "You can check the countries/regions list for your VPN here: https://github.com/qdm12/gluetun/wiki/$vpn_service#servers [brazil]: " vpn_country + vpn_country=${vpn_country:-"brazil"} fi echo "Configuring the docker-compose file for the user \"$username\" on \"$install_location\"..." @@ -176,30 +182,32 @@ echo "" echo "Copying $filename..." cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" +cp .env.example "$env_file" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" # Set PUID -sed -i -e "s/<your_PUID>/$puid/g" "$filename" +sed -i -e "s/<your_PUID>/$puid/g" "$env_file" # Set PGID -sed -i -e "s/<your_PGID>/$pgid/g" "$filename" +sed -i -e "s/<your_PGID>/$pgid/g" "$env_file" # Set media_folder -sed -i -e "s;<media_folder>;$media_folder;g" "$filename" +sed -i -e "s;<media_folder>;$media_folder;g" "$env_file" # Set media_service +sed -i -e "s;<media_service>;$media_service;g" "$env_file" sed -i -e "s;<media_service>;$media_service;g" "$filename" if [ "$media_service" == "plex" ]; then sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" fi # Set config folder -sed -i -e "s;<install_location>;$install_location;g" "$filename" +sed -i -e "s;<install_location>;$install_location;g" "$env_file" # Set VPN if [ "$setup_vpn" == "y" ]; then - sed -i -e "s;<vpn_service>;$vpn_service;g" "$filename" - sed -i -e "s;<vpn_user>;$vpn_user;g" "$filename" - sed -i -e "s;<vpn_password>;$vpn_password;g" "$filename" + sed -i -e "s;<vpn_service>;$vpn_service;g" "$env_file" + sed -i -e "s;<vpn_user>;$vpn_user;g" "$env_file" + sed -i -e "s;<vpn_password>;$vpn_password;g" "$env_file" sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename" sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename" sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename" |