Giter VIP home page Giter VIP logo

Comments (5)

tromlet avatar tromlet commented on July 28, 2024

I'm actually looking at this too. :P

EDIT: A bit more information about my setup here, we're running this inside of a VM, and so far your management interface appears to be the best one, if ONLY because it will sit there and take existing Wireguard configs.

I HAVE gotten it working on our CentOS 7 server (and I'd be happy to share my methods for your docs!), which is great! But I need it to be able to start up if our cluster goes down and comes back up, etc. A way to run it as a system service would be ideal.

EDIT 3 Feb 2020: I'm making some progress on this!

from wg-manager.

tromlet avatar tromlet commented on July 28, 2024

Note, this is all on CentOS 7 - you may need to adapt the instructions below to your distro. @perara, @tony1661, your input here on any security considerations or "best practices" would be much appreciated - but I think I got it right!

I created a systemd unit file:

$ cat /etc/systemd/system/wg-manager.service:

[Unit]
Description=WireGuard Manager
After=syslog.target
After=network.target

[Service]
Type=simple
Environment=ADMIN_USERNAME=admin
Environment=ADMIN_PASSWORD=password
WorkingDirectory=/opt/wg-manager/wg_dashboard_backend
ExecStart=/opt/wg-manager/wg_dashboard_backend/venv/bin/gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 main:app
User=vpn
Group=vpn
Restart=always

[Install]
WantedBy=multi-user.target

I also installed Caddy, and used it to proxy to the server via HTTPS with custom certs from our internal CA.

$ cat /etc/caddy/Caddyfile:

wg.example.com {
  reverse_proxy localhost:8000

  tls /home/vpn/wg.example.com/cert.pem /home/vpn/wg.example.com/key.key {
    ca_root /home/vpn/wg.example.com/ca.pem
  }
}

Then, just do:

# systemctl enable wg-manager
# systemctl start wg-manager
# systemctl enable caddy
# systemctl start caddy

...and your service should be served up via HTTPS and should come right up after a server reboot!

from wg-manager.

pw44 avatar pw44 commented on July 28, 2024

from wg-manager.

tromlet avatar tromlet commented on July 28, 2024

Ah, yes, you probably need to do pip install gunicorn after the part of the setup instructions where you install uvicorn. From my reading, gunicorn is a preferred way of running a server like this in production, so I went ahead and figured out how to work with it. That will put gunicorn in the venv/bin directory, where you can then reference it. I didn't use uvicorn for my service file, as it seems like it's generally considered to be a development server - not a production one.

from wg-manager.

tromlet avatar tromlet commented on July 28, 2024

Any progress on this, my dude @pw44?

Another aspect I found was to be sure to never use anything BUT your final ADMIN_USERNAME and ADMIN_PASSWORD credentials during setup. Doing so will conflict with the database, and all will be lost (well not really you can just use the initial creds you started with, but).

from wg-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.