d3vilh / openvpn-ui

Web User Interface for OpenVPN
MIT License
169 stars 39 forks source link

/etc/openvpn/server.conf issue #53

Closed reamasesa closed 4 months ago

reamasesa commented 4 months ago

Hi,

Thank you for all the latest updates, however, I was not aware that the server also got release versions and used the latest with ui 0.9.4.1 and now I'm in a bit of a mess :)

When using "- ./server.conf:/etc/openvpn/server.conf" as the example in docker-compose.yml shows, it creates an empty directory Touching an empty file and mounting it as a volume doesn't have the configuration written to it The only thing that worked was commenting out the "server.conf" line from the docker-compose.yml, let the container start and create the server.conf, down everything, and uncomment out the "server.conf" line, which means, I'll have to save the server.conf and copy it over to all my future setups

Eventually, what I did was this

`services: openvpn: container_name: openvpn image: d3vilh/openvpn-server:0.5.1 privileged: true ports:

So, all is working again and thank yo uagain for all your hard work on this

d3vilh commented 4 months ago

Hi @reamasesa Agree, such kind of core changes always brings mess without proper documentation and upgrade procedure. We have Important changes in Server documents, but for UI I just add release note.

So, I'll push upgrade procedure for UI on this weekend.

Basically, you have to move server.conf from openvpn-server/conf catalog to root of openvpn-server.

cp ~/openvpn-server/conf/server.conf ../server.conf 

and re-create container from the updated compose file (- ./server.conf:/etc/openvpn/server.conf as volume option):

---
version: "3.5"

services:
    openvpn:
       container_name: openvpn
       image: d3vilh/openvpn-server:latest
       privileged: true
       ports: 
          - "1194:1194/udp"
       environment:
           TRUST_SUB: 10.0.70.0/24
           GUEST_SUB: 10.0.71.0/24
           HOME_SUB: 192.168.88.0/24
       volumes:
           - ./pki:/etc/openvpn/pki
           - ./clients:/etc/openvpn/clients
           - ./config:/etc/openvpn/config
           - ./staticclients:/etc/openvpn/staticclients
           - ./log:/var/log/openvpn
           - ./fw-rules.sh:/opt/app/fw-rules.sh
           - ./server.conf:/etc/openvpn/server.conf
       cap_add:
           - NET_ADMIN
       restart: always

    openvpn-ui:
       container_name: openvpn-ui
       image: d3vilh/openvpn-ui:latest
       environment:
           - OPENVPN_ADMIN_USERNAME=admin
           - OPENVPN_ADMIN_PASSWORD=gagaZush
       privileged: true
       ports:
           - "8080:8080/tcp"
       volumes:
           - ./:/etc/openvpn
           - ./db:/opt/openvpn-ui/db
           - ./pki:/usr/share/easy-rsa/pki
           - /var/run/docker.sock:/var/run/docker.sock:ro
       restart: always

I think it is a good idea to add Important changes with reference to updated upgrade procedure as I did for the version 0.4.

Glad you manage it and thank you for the reporting!

reamasesa commented 4 months ago

Thanks :)