Ver código fonte

moving torguard config update to separate script

master
Kristian Haugene 7 anos atrás
pai
commit
3643e24434
2 arquivos alterados com 22 adições e 10 exclusões
  1. 0
    10
      Dockerfile
  2. 22
    0
      openvpn/torguard/updateConfigs.sh

+ 0
- 10
Dockerfile Ver arquivo

@@ -26,16 +26,6 @@ RUN apt-get update \
ADD openvpn/ /etc/openvpn/
ADD transmission/ /etc/transmission/

# Get updated configuration from TorGuard
RUN curl -L https://torguard.net/downloads/OpenVPN-UDP.zip -o OpenVPN-UDP.zip \
&& unzip OpenVPN-UDP.zip
RUN find OpenVPN\ -UDP/ -name *.ovpn | cut -d . -f 2- | xargs -n 1 -I '{}' cp ./OpenVPN\ -UDP/TorGuard.'{}' /etc/openvpn/torguard/'{}'
RUN cp OpenVPN\ -UDP/ca.crt /etc/openvpn/torguard/ca.crt \
&& rm -rf OpenVPN\ -UDP/ \
&& rm OpenVPN-UDP.zip \
&& sed -i "s/ca ca.crt/ca \/etc\/openvpn\/torguard\/ca.crt/" /etc/openvpn/torguard/*.ovpn \
&& sed -i "s/auth-user-pass/auth-user-pass \/config\/openvpn-credentials.txt/" /etc/openvpn/torguard/*.ovpn

ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=**None** \

+ 22
- 0
openvpn/torguard/updateConfigs.sh Ver arquivo

@@ -0,0 +1,22 @@
#!/bin/bash

# If the script is called from elsewhere
cd "${0%/*}"

# Delete everything (not this script though)
find . ! -name '*.sh' -delete

# Get updated configuration zip from TorGuard
curl -L https://torguard.net/downloads/OpenVPN-UDP.zip -o OpenVPN-UDP.zip \
&& unzip -j OpenVPN-UDP.zip && rm OpenVPN-UDP.zip

# Remove TorGuard prefix of config files
rename 's/^TorGuard\.//' *.ovpn

# Update configs with correct paths
sed -i "s/ca ca.crt/ca \/etc\/openvpn\/torguard\/ca.crt/" *.ovpn
sed -i "s/tls-auth ta.key/tls-auth \/etc\/openvpn\/torguard\/ta.key/" *.ovpn
sed -i "s/auth-user-pass/auth-user-pass \/config\/openvpn-credentials.txt/" *.ovpn

# Create symlink for default.ovpn
ln -s Netherlands.ovpn default.ovpn

Carregando…
Cancelar
Salvar