glenndehaan / unifi-voucher-site

UniFi Voucher Site is a web-based platform for generating and managing UniFi network guest vouchers
MIT License
60 stars 13 forks source link

config file? #20

Closed aroundmyroom closed 1 year ago

aroundmyroom commented 1 year ago

Just installed it without docker and its running, but wondering if I do miss the config file? cause in 2 files I had to change IP / site and at the end somewhere in the /modules/unifi.js the username / password. (and/or site / ip as well)

glenndehaan commented 1 year ago

No you are not missing a config file the application uses environment variables to configure itself. So you can just supply those when launching the app, the variables are described in the example docker compose file.

aroundmyroom commented 1 year ago

Ah clear ..

for what's worth

!/bin/bash

export UNIFI_IP='10.1.1.1' export UNIFI_PORT='443' export UNIFI_USERNAME='username' export UNIFI_PASSWORD='password' export UNIFI_SITE_ID='default' export SECURITY_CODE='000' export VOUCHER_TYPES='480,0,,,;1440,1,,,;10080,1,,,;525600,1,,,;' export WEBPORT='80'

cd /home/unifi-voucher-site /root/.nvm/versions/node/v19.3.0/bin/node server.js

Notes: npm start does not work with systemctl (I could not get it working) so I start the application with node server.js. and now systemctl is working fine.

Would love to have support for SSL so that I can use my own certificates

(using your script on a debian machine with npm 19 replacing my own ugly php script) ;) (NB. as it is an home LXC server I do not care about usernames or things being root yes/no). stuff is not outside my network available

glenndehaan commented 1 year ago

I would always recommend using a reverse proxy and not to expose the node process directly. The reverse proxy would then handle the SSL termination and could for example integrate with letsencrypt.

aroundmyroom commented 1 year ago

Agree and can do that I have nginx proxy manager running, but is unnecessary when you run this locally. It's not a strong need, but a nice to have ;)