flant / ovpn-admin

Simple web UI to manage OpenVPN users.
Apache License 2.0
1.37k stars 255 forks source link

Creating user configs hardcodes the server host to 127.0.0.1 #249

Closed burnerlee closed 10 months ago

burnerlee commented 10 months ago

I have hosted the server using the following docker-compose file:

version: '3'

services:
  openvpn:
    image: flant/ovpn-admin:openvpn-latest
    command: /etc/openvpn/setup/configure.sh
    environment:
      OVPN_SERVER_NET: "192.168.100.0"
      OVPN_SERVER_MASK: "255.255.255.0"
      OVPN_PASSWD_AUTH: "true"
    cap_add:
      - NET_ADMIN
    ports:
      - 7777:1194 # for openvpn
      - 8080:8080 # for ovpn-admin because of network_mode
    volumes:
      - ./easyrsa_master:/etc/openvpn/easyrsa
      - ./ccd_master:/etc/openvpn/ccd
  ovpn-admin:
    build:
      context: .
    image: flant/ovpn-admin
    command: /app/ovpn-admin
    environment:
      OVPN_DEBUG: "true"
      OVPN_VERBOSE: "true"
      OVPN_NETWORK: "192.168.100.0/24"
      OVPN_CCD: "true"
      OVPN_CCD_PATH: "/mnt/ccd"
      EASYRSA_PATH: "/mnt/easyrsa"
      OVPN_SERVER: "18.139.111.78:7777:tcp"
      OVPN_INDEX_PATH: "/mnt/easyrsa/pki/index.txt"
      OVPN_AUTH: "true"
      OVPN_AUTH_DB_PATH: "/mnt/easyrsa/pki/users.db"
      LOG_LEVEL: "debug"
    network_mode: service:openvpn
    volumes:
      - ./easyrsa_master:/mnt/easyrsa
      - ./ccd_master:/mnt/ccd

Where 18.139.111.78:7777:tcp is public ip of my server. When I create a user's config from the dashboard, the server port in that is locked to 127.0.0.1. This should point to the public ip of my vpn server the users can connect to. How can i configure it?

pashcovich commented 10 months ago

I tried to test using the docker-compose file you provided, and everything is fine

which version did you use?

burnerlee commented 10 months ago

oh got it. There was some issue with file I was importing

burnerlee commented 10 months ago

thanks btw :), sorry for the trouble