Expanded YAMS to use any VPN provider

This commit is contained in:
Roger Gonzalez 2023-01-16 11:22:25 -03:00
parent 71907294b4
commit 41ddc178c8
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
2 changed files with 15 additions and 11 deletions

View File

@ -109,7 +109,8 @@ services:
volumes: volumes:
- <install_location>/config/gluetun:/config - <install_location>/config/gluetun:/config
environment: environment:
- VPN_SERVICE_PROVIDER=mullvad - VPN_SERVICE_PROVIDER=<vpn_service>
- VPN_TYPE=openvpn - VPN_TYPE=openvpn
- OPENVPN_USER=<mullvad_user> - OPENVPN_USER=<vpn_user>
- SERVER_COUNTRIES=<mullvad_country> - OPENVPN_PASSWORD=<vpn_password>
- SERVER_COUNTRIES=<vpn_country>

View File

@ -114,16 +114,18 @@ echo
echo echo
echo echo
echo "Time to setup the VPN." echo "Time to setup the VPN."
echo "The automatic installer only works with Mullvad, but you can setup many other VPNs manually." echo "You can check the supported VPN list here: https://yams.media/advanced/vpn."
echo "If you want to use any other VPN, choose \"N\"" read -p "Do you want to configure a VPN? [Y/n]: " setup_vpn
read -p "Do you want to configure Mullvad VPN? [Y/n]: " setup_vpn
setup_vpn=${setup_vpn:-"y"} setup_vpn=${setup_vpn:-"y"}
if [ $setup_vpn == "y" ]; then if [ $setup_vpn == "y" ]; then
read -p "What's your Mullvad username? (without spaces): " mullvad_user read -p "What's your VPN service? (with spaces) [mullvad]: " vpn_service
vpn_service=${vpn_service:-"mullvad"}
read -p "What's your VPN username? (without spaces): " vpn_user
read -sp "What's your VPN password? (if you are using mullvad, just enter your username again): " vpn_password
echo "What country do you want to use?" echo "What country do you want to use?"
read -p "You can check the countries list here: https://mullvad.net/en/servers/ [brazil]: " mullvad_country read -p "You can check the countries list for your VPN here: https://github.com/qdm12/gluetun/wiki/$vpn_service [brazil]: " vpn_country
mullvad_country=${mullvad_country:-"brazil"} vpn_country=${vpn_country:-"brazil"}
fi fi
echo "Configuring the docker-compose file for the user \"$username\" on \"$install_location\"..." echo "Configuring the docker-compose file for the user \"$username\" on \"$install_location\"..."
@ -153,8 +155,9 @@ sed -i -e "s;<install_location>;$install_location;g" $filename
# Set VPN # Set VPN
if [ $setup_vpn == "y" ]; then if [ $setup_vpn == "y" ]; then
sed -i -e "s;<mullvad_user>;$mullvad_user;g" $filename sed -i -e "s;<vpn_user>;$vpn_user;g" $filename
sed -i -e "s;<mullvad_country>;$mullvad_country;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;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" $filename 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;ports: # qbittorrent;#port: # qbittorrent;g" $filename
sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" $filename sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" $filename