Closed DaanSelen closed 1 month ago
👀
Oops, totally forgot about this..
Yes, one way is to CURL the API and change the settings. Or, use a bash script to create wg-dashboard.ini
after Docker started.
Oops, totally forgot about this..
Yes, one way is to CURL the API and change the settings. Or, use a bash script to create
wg-dashboard.ini
after Docker started.
Modifying is what it does now, but this causes the docker container to perform:
Which takes unnecessary long. How would I change this with the API? Specifically the DNS and external IP.
Ahh.. I see.. then I don't think API is suitable for this. What we can do is to use bash to create a minimal version of wg-dashboard.ini
:
$ touch wg-dashboard.ini
$ echo [Peers] >> wg-dashboard.ini
$ echo "remote_endpoint = $(ip addr show "$(route | grep '^default' | grep -o '[^ ]*$')" | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)" >> wg-dashboard.ini
$ echo "peer_global_dns = 1.1.1.1" >> wg-dashboard.ini
Then the wg-dashboard.ini
should something like this:
[Peers]
remote_endpoint = 10.0.3.6
peer_global_dns = 1.1.1.1
Does WGDashboard expand on this file? Or overwrite it?
Yes, WGDashboard will expand on it. Basically, it will loop through every section and see if a key exists or not. If not, it will write to it with the default value specified in dashboard.py
where the DashboardConfig
class is :)
Okay will update on next PR!
Hi @donaldzou,
I wanted to ask if there is a way to modify the wg-dashboard.ini that is being generated. For my current WGDashboard docker container I just copy a template and it works well. But the way the current Docker container in the main repo works is through:
I would like to shorten that.
regarding: https://github.com/donaldzou/WGDashboard/pull/420
What is your opinion?