WGDashboard icon indicating copy to clipboard operation
WGDashboard copied to clipboard

wgdashboard-dockerized available, ubuntu 20.04 based

Open ikidd opened this issue 3 years ago • 14 comments

So I don't know if merging a docker version of this project is necessarily the best thing to do, so I've forked your repo and added dockerization that I'm fairly confident works well and should be maintainable.

If you wanted to mention it in your repo readme for those that want to be able to deploy via docker, I would maintain it independently to keep it even with your original for commits.

If you'd prefer to merge it, I can do a PR, or if you have any changes you'd suggest, I'm all ears.

I'd love for people to try it and let me know what improvements I could make.

https://github.com/ikidd/wgdashboard-dockerized

ikidd avatar Jan 24 '22 09:01 ikidd

Hi @ikidd , thank you for helping out!! Since i'm not an expert on Docker, will it hard to maintain and is there a way that the docker will get auto update after I release a newer version?

donaldzou avatar Jan 24 '22 16:01 donaldzou

I'm seeing how that goes. I'm currently manually applying your updates to my branch, bring the docker-compose down and up again, and seeing if it propagates/rebuilds the image without breaking the database persistence.

Also, I was thinking that it might be necessary to reorganize where it keeps the web files so I can attach named volumes without having them overwritten. Ideally, if application.ini went into it's own subfolder with the db and logs (./data), and the actual website files were in another folder(./app), that might make it more robust for updating the wgdashboard components. I have not looking into how that would affect everything else in the program as it's laid out today.

There's still a lot of places for this to fail; if they change the address of the wg0 server, then will the db stay consistent or is it indexed/recorded by the database and that would break it? That's not just a potential problem for the docker, but it is much easier for it to be changed as it's just one line in the .env file vs. having to do it manually in /etc/wireguard.

I was also looking at making it possible to define multiple tunnels in the .env file or an additional file, and it would just iterate through and make all the tunnels in the build image or via the entrypoint.sh script. I still think this is better done right in the application but until (or if) that's done, this does get a working single tunnel wgd up and running with very minimal effort, and seems to work. I've not looked how you ensure that the db stays in sync with the tunnel.

A change I just thought about was to bring the /etc/wireguard folder out into a named volume so that stays persistent, I should have thought about that earlier.

ikidd avatar Jan 24 '22 20:01 ikidd

There's still a lot of places for this to fail; if they change the address of the wg0 server, then will the db stay consistent or is it indexed/recorded by the database and that would break it? That's not just a potential problem for the docker, but it is much easier for it to be changed as it's just one line in the .env file vs. having to do it manually in /etc/wireguard.

Regarding to this, I believe the dashboard will detect any changes and apply to the database and should not break (it shouldn't.. I think... It should 🤣 )

donaldzou avatar Jan 25 '22 01:01 donaldzou

I'm still not quite sure how Docker works.. Does it just works like a normal ubuntu VM but work out of the box?

donaldzou avatar Jan 25 '22 01:01 donaldzou

Docker is basically a static image of an operating system. You expose some ports (51820) and maybe folders (like /etc/wireguard). You can refresh it by rebuilding the image or just download a pre-built image and use it. The idea is to keep the bits like databases and config files persistent, but update the underlying operating system at will without affecting those services.

It's a pretty nice way to just drop a service in and there's certainly a lot of people that don't want to dedicate and entire VM or machine to something.

ikidd avatar Jan 25 '22 07:01 ikidd

I see, it is actually a good way to do it. I'll continue to look into the docker documentation. I might find a good way to integrate it.

donaldzou avatar Jan 26 '22 16:01 donaldzou

i dont have internetacess with my clients, i get the handshake and i can open the dashboard from the container with the container ip. and the container self has also internet. but when i connect with a client i cant get connection to other ipˋs and to the internet

Trackhe avatar Jan 31 '22 07:01 Trackhe

I had mainly done this as a self-contained WG group without NAT for use as a gateway.

If you're using my dockerized repo, please raise an issue there so I get notified and might make some changes to allow that to be enabled.

ikidd avatar Feb 05 '22 21:02 ikidd

@ikidd i cant make an issue on your fork. so say me how ?

Trackhe avatar Feb 05 '22 22:02 Trackhe

Should be able to make an issue now.

ikidd avatar Feb 06 '22 02:02 ikidd

Heyy @ikidd, i've merged your dockerfile and the docker-compose manually to my dev branch and it work perfectly!! Thank you very much! But I do found some imperfect with docker, which is if we wrap up everything into a docker image, the user won't be able to update the dashboard without losing all the data (re-pull the whole image), and now we could update the dashboard without losing all the data with your solution, but then we won't be able to push it to docker hub, because the image won't include the dashboard files. But I guess this is the best solution we have now ;)

donaldzou avatar Apr 09 '22 18:04 donaldzou

There is definitely work to do on that, I wanted to have the entry point script to init the app and install updates instead of doing it in the build

We should also add the docker file build to CI so it will upload to docker hub instead of people having to build it every time. I'm a little suspicious of how stable it will be included in your repo vs what I have set up. I'll try to take a look at it tomorrow and see if I can upgrade it properly.

ikidd avatar Apr 09 '22 18:04 ikidd

For sure for sure, let me know how it goes!! Thank u for your help on this project ;)

donaldzou avatar Apr 09 '22 18:04 donaldzou

I am searching for wireguard dashboard for some time now and this project looks the best! Hope you manage to progress with the container... Cant wait to test it

dgkovachev avatar Jan 30 '23 20:01 dgkovachev