bananaspliff / geek-charts

Geek Helm charts for seedbox
https://bananaspliff.github.io/geek-charts
Apache License 2.0
50 stars 22 forks source link

ProtonVPN #7

Open AndiLavera opened 4 years ago

AndiLavera commented 4 years ago

Hello, I am new to kubernetes so this might be a common issue but i figured this was the best place to try.

There seems to be an error with ProtonVPN. I can't tell if it's your chart, the actual docker image or my configuration.

Create a secret:

kubectl create secret generic openvpn \
    --from-literal username=<VPN_USERNAME> \
    --from-literal password=<VPN_PASSWORD> \
    --namespace media

Create a configmap:

kubectl create configmap openvpn-common-config --from-file my_proton_vpn_file.ovpn --namespace media

Apply the install your transmission chart with:

helm install transmission bananaspliff/transmission-openvpn \
    --values media.transmission-openvpn.values.yml \
    --namespace media

Here is what my config looks like:

replicaCount: 1

image:
  repository: "haugene/transmission-openvpn"
  tag: "latest-armhf" # Suffixed by -armhf to pull the ARM image
  pullPolicy: "IfNotPresent"

dnsPolicy: "None"

dnsConfig:
  nameservers:
    - 8.8.8.8
    - 8.8.4.4

env:
  - name: OPENVPN_PROVIDER
    value: "PROTONVPN" # VPN provider. List of supported providers: https://haugene.github.io/docker-transmission-openvpn/supported-providers/
  - name: OPENVPN_USERNAME
    valueFrom: # Reference to the secret | openvpn.username
      secretKeyRef:
        name: "openvpn"
        key: "username"
  - name: OPENVPN_PASSWORD
    valueFrom: # Reference to the secret | openvpn.password
      secretKeyRef:
        name: "openvpn"
        key: "password"
  - name: LOCAL_NETWORK
    value: "192.168.0.1"
  - name: TRANSMISSION_PEER_PORT
    value: "47444"
  - name: TRANSMISSION_DOWNLOAD_DIR
    value: "/downloads/transmission"
  - name: PUID
    value: "1000"
  - name: PGID
    value: "1000"

service:
  type: ClusterIP
  port: 80

volumes:
  - name: "media-ssd"
    persistentVolumeClaim:
      claimName: "media-ssd" # PersistentVolumeClaim created earlier
  - name: dev-tun
    hostPath:
      path: "/dev/net/tun"
  - name: config
    configMap:
      name: "openvpn-common-config"

volumeMounts:
  - name: "media-ssd"
    mountPath: "/data"
    subPath: "configs/transmission-data" # Path /mnt/ssd/media/configs/transmission-data where transmission writes the configuration
  - name: "media-ssd"
    mountPath: "/downloads/transmission"
    subPath: "downloads/transmission" # Path /mnt/ssd/media/downloads/transmission where transmission downloads Torrents
  - name: dev-tun
    mountPath: "/dev/net/tun"
  - name: config
    mountPath: /etc/openvpn/protonvpn/default.ovpn

securityContext:
  capabilities: # Needed for VPN
    add:
      - NET_ADMIN

The error:

Using OpenVPN provider: PROTONVPN
No VPN configuration provided. Using default.
Setting OPENVPN credentials...
adding route to local network 192.168.0.1 via 10.42.1.1 dev eth0
RTNETLINK answers: File exists
Wed May 13 18:20:54 2020 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Options error: You must define TUN/TAP device (--dev)
Use --help for more information.

Note: I do not receive this error when doing sudo openvpn my_proton_vpn_file.ovpn on my local machine.

radum commented 4 years ago

I think your network value should be like this:

- name: LOCAL_NETWORK
    value: "192.168.0.0/24"
sample-usr commented 4 years ago

@andrewc910 Did you ever figure out what was the issue?

radum commented 4 years ago

@razagill I a pretty sure the error was due to miss configuration of the local network IP value.

AndiLavera commented 4 years ago

I tried the value you provided. It didnt end up working. I ended up switching to nordvpn and that just worked.

However, i just moved and i need to resetup my server. I can give another tey to proton if youd like. I still have the config file.

sample-usr commented 4 years ago

@andrewc910 Sure, I also tried it with 2 different providers (expressvpn and premiumize) and both give the same error. I even tried the CREATE_TUN_DEVICE environment variable from the underlying docker image itself here but still the same error.

replicaCount: 1

image:
  repository: "haugene/transmission-openvpn"
  tag: "latest"
  pullPolicy: "IfNotPresent"

dnsPolicy: "None"

dnsConfig:
  nameservers:
    - 8.8.8.8
    - 8.8.4.4

env:
  - name: OPENVPN_PROVIDER
    value: "CUSTOM" # VPN provider. List of supported providers: https://haugene.github.io/docker-transmission-openvpn/supported-providers/
  - name: OPENVPN_USERNAME
    valueFrom: # Reference to the secret | openvpn.username
      secretKeyRef:
        name: "openvpn"
        key: "username"
  - name: OPENVPN_PASSWORD
    valueFrom: # Reference to the secret | openvpn.password
      secretKeyRef:
        name: "openvpn"
        key: "password"
  - name: LOCAL_NETWORK
    value: "192.168.0.0/24"
  - name: TRANSMISSION_PEER_PORT
    value: "47444"
  - name: TRANSMISSION_DOWNLOAD_DIR
    value: "/downloads/transmission"
  - name: PUID
    value: "1000"
  - name: PGID
    value: "1000"

service:
  type: ClusterIP
  port: 80

volumes:
  - name: "media-ssd"
    persistentVolumeClaim:
      claimName: "media-ssd"
  - name: dev-tun
    hostPath:
      path: "/dev/net/tun"
  - name: config
    configMap:
      name: "openvpn-common-config"

volumeMounts:
  - name: "media-ssd"
    mountPath: "/data"
    subPath: "configs/transmission-data" # Path /mnt/ssd/media/configs/transmission-data where transmission writes the configuration
  - name: "media-ssd"
    mountPath: "/downloads/transmission"
    subPath: "downloads/transmission" # Path /mnt/ssd/media/downloads/transmission where transmission downloads Torrents
  - name: dev-tun
    mountPath: "/dev/net/tun"
  - name: config
    mountPath: "/etc/openvpn/custom/default.ovpn"

securityContext:
  #privileged: true
  capabilities: # Needed for VPN
    add:
      - NET_ADMIN 
11jwolfe2 commented 3 years ago

You guys need to add more env variables see this here. Also you can see a good set up here It uses NORDVPN in the transmission part.

Edits were for links

ianhundere commented 3 years ago

i got it working with the following values:


image:
  repository: "haugene/transmission-openvpn"
  tag: "latest"
  pullPolicy: "IfNotPresent"

env:
  - name: OPENVPN_PROVIDER
    value: "PROTONVPN"
  - name: OPENVPN_USERNAME
    valueFrom:
      secretKeyRef:
        name: "openvpn"
        key: "username"
  - name: OPENVPN_PASSWORD
    valueFrom:
      secretKeyRef:
        name: "openvpn"
        key: "password"
  - name: OPENVPN_CONFIG 
    value: "ch-05.protonvpn.com.udp,ch-08.protonvpn.com.udp,nl-04.protonvpn.com.udp,nl-11.protonvpn.com.udp"
  - name: LOCAL_NETWORK
    value: "192.168.3.0/24"
  - name: TRANSMISSION_PEER_PORT
    value: "47444"
  - name: TRANSMISSION_DOWNLOAD_DIR
    value: "/downloads/transmission"
  - name: PUID
    value: "1000"
  - name: PGID
    value: "1000"

service:
  type: ClusterIP
  port: 80

volumes:
  - name: "media-ssd"
    persistentVolumeClaim:
      claimName: "media-ssd"
  - name: "dev-tun"
    hostPath:
      path: "/dev/net/tun"

volumeMounts:
  - name: "media-ssd"
    mountPath: "/data"
    subPath: "configs/transmission-data"
  - name: "media-ssd"
    mountPath: "/downloads/transmission"
    subPath: "downloads/transmission"
  - name: "dev-tun"
    mountPath: "/dev/net/tun"

securityContext:
  capabilities:
    add:
      - NET_ADMIN