Docker 컨테이너 내에서 OpenVPN을 실행할 때 "여러 --up 스크립트가 정의됨"

Docker 컨테이너 내에서 OpenVPN을 실행할 때 "여러 --up 스크립트가 정의됨"

나는 사용하고있다binhex/arch-rtorrentvpn내 내용은 docker-compose.yml다음과 같습니다.

version: "2"
services:
  rtorrent:
    image: binhex/arch-rtorrentvpn
    container_name: rtorrent
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_ENABLED=yes
      - VPN_USER=<myusername>
      - VPN_PASS=<mypassword>
      - VPN_PROV=custom
      - VPN_OPTIONS=--script-security 2 --up /config/persists/tun_up.sh
      - VPN_CLIENT=openvpn
      - STRICT_PORT_FORWARD=no
      - ENABLE_AUTODL_IRSSI=yes
      - ENABLE_RPC2=yes
      - ENABLE_RPC2_AUTH=no
      - ENABLE_WEBUI_AUTH=no
      - LAN_NETWORK=192.168.1.0/24
      - NAME_SERVERS=1.1.1.1,1.0.0.1
      - DEBUG=true
      - PHP_TZ=Europe/London
      - UMASK=000
      - PUID=1000
      - PGID=1000
    volumes:
      - ./config:/config
      - ./downloads:/downloads
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 9080:9080
      - 9443:9443
      - 8118:8118
    restart: unless-stopped

내가 가진 문제는 [debug] 출력에 따르면 내 OpenVPN 명령줄이 다음과 같다는 것입니다.

[debug] OpenVPN command line:- /usr/bin/openvpn 
--reneg-sec 0 
--mute-replay-warnings 
--auth-nocache 
--setenv VPN_PROV 'custom' 
--setenv VPN_CLIENT 'openvpn' 
--setenv DEBUG 'true' 
--setenv VPN_DEVICE_TYPE 'tun0' 
--setenv VPN_ENABLED 'yes' 
--setenv VPN_REMOTE_SERVER '213.152.188.3' 
--setenv APPLICATION 'rtorrent' 
--script-security 2 
--writepid /root/openvpn.pid 
--remap-usr1 SIGHUP 
--log-append /dev/stdout 
--pull-filter ignore 'up' 
--pull-filter ignore 'down' 
--pull-filter ignore 'route-ipv6' 
--pull-filter ignore 'ifconfig-ipv6' 
--pull-filter ignore 'tun-ipv6' 
--pull-filter ignore 'dhcp-option DNS6' 
--pull-filter ignore 'persist-tun' 
--pull-filter ignore 'reneg-sec' 
--up /root/openvpnup.sh 
--up-delay 
--up-restart 
--auth-user-pass credentials.conf 
--script-security 2 
--up /config/persists/tun_up.sh 
--cd /config/openvpn 
--config '/config/openvpn/nl910.nordvpn.com.tcp443.ovpn' 
--remote 213.152.188.3 443 tcp-client 
--remote-random

오류가 발생 Multiple --up scripts defined. The previously configured script is overridden하고 컨테이너가 시작되지 않습니다.

아래 두 가지 방법으로 스크립트를 호출해 보았지만 둘 다 동일한 오류가 발생했습니다.

  • /root/openvpnup.sh구분 기호를 사용하여 스크립트를 호출합니다 ;. 예:VPN_OPTIONS=--script-security 2 --up /config/persists/tun_up.sh;/root/openvpnup.sh
  • 내 스크립트 끝에 /root/openvpnup.sh추가하여 스크립트를 호출합니다 ./root/openvpnup.shtun_up.sh
  • --tls-verify대신 다른 매개변수(예: )를 통해 스크립트를 실행합니다.--up

어떻게 하면 작동하게 할 수 있나요?

답변1

내 의심은 구성 전에 up 스크립트를 정의하기 때문에 이런 일이 발생한다는 것입니다. 실행을 추가하려고 하면--up /config/persists/tun_up.shovpn 구성 자체 내부에서 작동할 수 있습니다.

또 다른 제안은 스크립트를 내부에 복사하는 것입니다./etc/openvpn절대 경로를 지정하지 마십시오.

관련 정보