d3vilh / openvpn-ui

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

Reverse-proxy support #1

Closed henryk-radoslaw-rychlik closed 11 months ago

henryk-radoslaw-rychlik commented 1 year ago

Hello,

Thank you for your improvements to the original. I needed support for complete ovpn files that include the certs and this fork provided that. I struggled quite a bit though and have some related questions:

HTTP/2 400 date: Wed, 01 Feb 2023 01:40:45 user-agent: COOLWSD HTTP Agent 22.05.9.3 content-length: 0


 - I used your image from docker hub because I couldn't build the app, what are the steps?
 - `docker-entrypoint.sh` seems to be missing and I had to find it in git hostory. I see there is a template in the repo but still, don't know how to build the app.
 - container crashed due to missing vars file, had to add that, most likely because of the above?
d3vilh commented 1 year ago

Hi @henryk-radoslaw-rychlik if you would like to build your own image, then I recommend to use this builder for x86-64 or this one for armv7 64/32.

You need to set local path to openvpn-ui sources into OVPN_UI_HOME var in the build_openvpn-ui.sh and openvpn-ui-pack2.sh files. For example:

# Set the home directory of the openvpn-ui project
OVPN_UI_HOME="/home/admin/build/openvpn-ui"

Then run build_openvpn-ui.sh to build the image.

henryk-radoslaw-rychlik commented 1 year ago

I think I figured the same after a few hours. Still, the application built from source didn't allow me to download the profile. Will try tomorrow and confirm it wasn't a mistake of some sort.

I was able to change what path files are served on but not what the app requests. So I can serve on openvpn-ui/static but requests still come for static. From what I understand it, that's all hardcoded:/ https://github.com/d3vilh/openvpn-ui/blob/9a788b01dc73b6b65e46a6d4b4da6999d1af0ebe/views/common/footer.html#L22

On top of that, I had no traffic coming out of the VPN, that's probably iptables though as that pi setup is a different animal.

Oops, closed by mistake.

henryk-radoslaw-rychlik commented 1 year ago

Yeah, I did exactly what you said above. Was able to build it after modifying the defaults to my needs. Also found a way to move it from root to openvpn-ui path. Made it work with the following image I was already using: https://github.com/kylemanna/docker-openvpn

Have one more question. When you revoke a cert, does it take effect right away or after restart of openvpn?

d3vilh commented 1 year ago

@henryk-radoslaw-rychlik yes, you need to restart it after the revocation.

That is why there is a button to restart container, at the bottom of the page.

henryk-radoslaw-rychlik commented 1 year ago

Thank you, that answers all my questions. Would you like me to create a PR with instructions and changes so you can include whatever you want?