perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
594 stars 74 forks source link

Tested "Bare Metal" installation of wg-manager #8

Closed M3Du5AL3M closed 4 years ago

M3Du5AL3M commented 4 years ago

I'm really not an linux expert, I only can copy and paste and did not really understand what some lines are meaning... So only some hints for other linux noobs that wan't to start with...

I tried the given steps in a default Raspian "Desktop" Environment, hosted in a Hyper-V virtual machine, caused by missing RPi4 physical in the Datacenter. (my other endpint is a physical RPi 3 B @ home)

_PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSIONCODENAME=buster ID=debian

Linux version 4.19.0-8-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.98-1 (2020-01-26)

  1. First I struggled with add Environment variables to .bashrc, so for the noobs like me: Edit .bashrc file sudo nano ~/.bashrc

Then add these lines at the end of the file (customize some Values if required, I tried with the listed defaults) # ADD Environment Variables for wg-manager export GUNICORN_CONF="default" export WORKERS_PER_CORE="default" export WEB_CONCURRENCY="1" export HOST="0.0.0.0" export PORT="80" export LOG_LEVEL="info" export ADMIN_USERNAME="admin" export ADMIN_PASSWORD="admin"

  1. Before No. 3 "Building the Frontend" you should:

    sudo apt update
    sudo apt upgrade
    sudo apt install nodejs npm  ### prevent missing pm message
    sudo npm cache clean -f
    sudo npm install npm@latest -g   ### prevent issue "npm does not support Node.js v10.15.2"
  2. BUT: then I struggled with these line: sudo node_modules/@angular/cli/bin/ng build --configuration="production" > /dev/null _bash: nodemodules/@angular/cli/bin/ng: Datei oder Verzeichnis nicht gefunden

I'm still in _/opt/wg-manager/wg_dashboardfrontend if it's important.

Also I tried to move forward with: sudo mv dist ../wg_dashboard_backend/build File or Folder not found...

I'm not sure what's going on, but I'm sure I'm unable to fix this... :-)

perara commented 4 years ago

Hi, I would recommend you to try out the docker version if that is possible. The overhead of running docker is equal to zero and generally the preferred way. If you would like it to run as it were in the host system, simply add the network_mode: host flag in the docker arguments. This would save you a lot of unnecessary struggles

if not:

Regarding step 3, you would need to run npm install in the wg_dashboard_frontend directory then run the command you listed after that a build directory should appear (if everything went ok) and you can move it as instructed :)

M3Du5AL3M commented 4 years ago

Yes I've run npm install and also anguar.js but the command failed again and again, with a strange memory leak message, so I think I've built the whole system wrong, from scratch. But you 're right, the container solution should be much better. I'll play with. It's quiet more complex for me, because until now, I don't understand the whole docker / container thing... :-) But I'll give it a try. Backup and Snapshot's are my best friends these days... :-D

perara commented 4 years ago

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 to get you set up with docker

and then you should be able to run the command found for vanilla docker setup :)

M3Du5AL3M commented 4 years ago

Thanks a lot, container is already running.

I'm now struggle with the access to the WebGUI. Should it be possible to access i.e. http://IP_of_container_host:8888 from another machine??? Because thats currently not working and I tried the docker run command. If not, I have to run any Browser at the Pi, which is currently headless running...

sudo docker run -d \
--cap-add NET_ADMIN \
--name wg-manager \
--net host \
-p "51800-51900:51800-51900/udp" \
-v wg-manager:/config \
-e PORT="8888" \
-e ADMIN_USERNAME="admin" \
-e ADMIN_PASSWORD="admin" \
perara/wg-manager
M3Du5AL3M commented 4 years ago

Oh now I see, the container is directly after run excited with Code 159... It's too late for now, maybe tomorrow I'll find the source of this issue...

Lorim commented 4 years ago

The issue is still there. I tested it with a fresh ubuntu 18.04 installation. Docker is no option because i run the host als lxc container. Why should a add another layer?

perara commented 4 years ago

Hi, I've done secondary tests are not able to reproduce. The application should work equally well in bare-metal setups (developed in bare-metal Arch, tested on 20.04)

What I can do is to create a CI for setting it up when I have some spare time. In the mean time, if you figure this out, PR your setup steps and I'll add them to the documentation :)