Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variables for configuration #189

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

fin-ger
Copy link
Contributor

@fin-ger fin-ger commented Apr 22, 2022

Hi,

first of all, thank you for this awesome project!

I added a bunch of environment variables which can set defaults for many of the values visible in the web-interface. This makes it easier to automatically deploy wireguard-ui e.g. with Ansible, K8S, etc. with a predefined configuration. This also includes the option to control the defaults entered in the New Client dialog, which helps reducing errors where e.g. a CIDR of 0.0.0.0/0 is not suitable as only a number of subnets should be routed to the WireGuard server.

I welcome any suggestions to my changes and would be happy to see this merged upstream.

#99 would be fixed by this.

@fin-ger
Copy link
Contributor Author

fin-ger commented Apr 26, 2022

I rebased and added environment variables for ForwardMark and EndpointAddress.

Copy link
Owner

@ngoduykhanh ngoduykhanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution @fin-ger

@ngoduykhanh ngoduykhanh merged commit 569eaae into ngoduykhanh:master Apr 26, 2022
@olegStreejak
Copy link

Hello. Trying to set it up under FreeBSD, latest available binary
Wireguard UI
App Version : v0.3.7
Git Commit : ad4ca4d9bb344236a2793fee54ec24cf07d6cd8c
Git Ref : refs/tags/v0.3.7
Build Time : 05-14-2022 16:51:29
Git Repo : https://github.com/ngoduykhanh/wireguard-ui
Authentication : true
Bind address : 192.168.0.1:5000
Email from : noreply@to.me
Email from name : WireGuard UI
⇨ http server started on 192.168.0.1:5000
started by daemon, set its env so that
$ procstat environment 3799
PID COMM ENVIRONMENT
3799 wireguard-ui WGUI_DEFAULT_CLIENT_ALLOWED_IPS="10.0.1.0/24,192.168.0.0/24"

but if I press + New Client button, there's always the default 0.0.0.0/0

Why?

p.s.: tried only one CIDК net, tried WGUI_DEFAULT_CLIENT_EXTRA_ALLOWED_IPS - all in vain

@fin-ger
Copy link
Contributor Author

fin-ger commented May 15, 2022

This feature is currently only available on the latest git master. It has not been released, yet.

@olegStreejak
Copy link

Thank you for reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants