-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Added updated Docker functionality. #277
Conversation
…stency among recreations, looking into that...
…ile. Looking great!
…g which can happen with iptables (-s illegal option). Pushing to repo.
… from the Dockerfile directly. But the wg0.conf file needs a re-copy on run-time. Working now. Made code modifications and optimizations. Please report bugs to me.
Hi @DaanSelen thank you very much for working on this! I'm thinking I'll merge this to main once I merge my v4 to main, so I don't need to mess up my current changes :) Thank you again.. There are few people been asking a Docker image for the dashboard but I have zero knowledge on it, so you did a big favour for me :) |
The current Docker image is for version 3.0.6.2, the image's Dockerfile copies the main branch of donaldzou/wgdashboard so once that's updated, the image will pull it. I can work on looking into the v4 image, but do you have a estimated release period/date? |
I don't have a guaranteed timeline.. But if the docker image is pulling directly from Github, maybe it can do something like this: update_wgd() {
new_ver=$(python3 -c "import json; import urllib.request; data = urllib.request.urlopen('https://api.github.com/repos/donaldzou/WGDashboard/releases/latest').read(); output = json.loads(data);print(output['tag_name'])")
printf "%s\n" "$dashes"
printf "| Are you sure you want to update to the %s? (Y/N): " "$new_ver"
read up
if [ "$up" = "Y" ]; then
printf "| Shutting down WGDashboard... |\n"
if check_wgd_status; then
stop_wgd
fi
mv wgd.sh wgd.sh.old
printf "| Downloading %s from GitHub... |\n" "$new_ver"
git stash > /dev/null 2>&1
git pull https://github.com/donaldzou/WGDashboard.git $new_ver --force > /dev/null 2>&1
printf "| Upgrading pip |\n"
python3 -m pip install -U pip > /dev/null 2>&1
printf "| Installing latest Python dependencies |\n"
python3 -m pip install -U -r requirements.txt > /dev/null 2>&1
printf "| Update Successfully! |\n"
printf "%s\n" "$dashes"
rm wgd.sh.old
else
printf "%s\n" "$dashes"
printf "| Update Canceled. |\n"
printf "%s\n" "$dashes"
fi
} This is a function used in |
This does rely on the image updating itself, with Docker images, if you have a central registry then it is more centralized if you just pull the image again. You are right that in my current version this does not work correctly. Because the entire directory of /src is saved with docker. If you in the future separate the files that contain data in a directory I could instead only use that, but I don't know if thats easily done. |
Ahh I see, I wonder how other docker images do an "update"? Maybe what we can do is force to check update every single time the docker image start? since it is just an "Ubuntu VM" (correct me if I'm wrong) and run the bash commands to do the update? |
Close! But it is a Debian VM, at least in the version I made. You can see that at the top of the file Using it that way, end-users don't have to go into the container and see if everything is still okay, we should centralize that from the registry and let the users just pull the new docker image and run it with the previous files needed to personalize the environment, such as the database and the .ini files. Do you understand what I mean? |
Ah I think any major distro should work, and yes that's a good idea :) |
I myself am totally not familiar with GitHub and pull requests etc, but you could already merge this into the main (so I can fork it again) and then I can fork the 4.0 and start working on that already, now I am only allowed to have 1 fork of this repository without breaking GitHub's ToS. And then people have a way to use the current one. If possible we can upload the compiled image to Docker Hub (right now its on my personal registry which is fine, but the uplink is only 100mbit). |
Ah gotcha yeah for sure I'll do it now :) |
Doneeeee ;) |
Thanks forking v4 soon! If you want, can you give me an idea on which files WGDashboard needs to "remember", I've noticed its the wg-dashboard.ini file and you talked about a database file. Are there more? otherwise it can perhaps be done with only those 2 files (and the /etc/wireguard/wg0.conf). But feel free to submit issues on the docker container. I will pick those up! |
For sure! I think besides those 2 files (db and dashboard config file), all |
I'll also explain for your knowledge what the Docker container does for 'saving' the data between containers. I have made it so the files get installed in Think of it like: there is a part which is generic, such as the |
@donaldzou any plans to publish the image by your self? No offense to the great work of Daan but imho, in a safety perspective its a no go to let someone else build your docker images. I'm pretty sure Daan or otherwise me, can help you to set up Additional I got some other ideas as well to make it more customizable for the end user, such as entering some custom configs for Wireguard config instead of hard coded ones in the Docker file. It would be easier for and end user to adjust those values in |
I always welcome more features, please see what you can do. We all want to make it better! |
I've been working on this Dockerfile and everything regarding it for this project and hope it is well received.
Referring Issue: #272