key-networks / ztncui

ZeroTier network controller UI
GNU General Public License v3.0
1.51k stars 227 forks source link

Login stuck loading #103

Open brantpastore opened 1 year ago

brantpastore commented 1 year ago

When i try to sign into the website using either http or https, it gets stuck loading and never authenticates (or if using the wrong password denies) me.

Not using docker, setup per read me.

.env content: NODE_ENV=production HTTP_ALL_INTERFACES=yes HTTPS_HOST=10.0.0.173 HTTPS_PORT=3443

I also can't seem to find the log location.

lideming commented 1 year ago

If the path in address bar is /controller, then maybe it was requesting to the ZT controller API. Try adding console.log before/after this line? https://github.com/key-networks/ztncui/blob/8fb29fa60771bdaa1e66157c7c383cb56afa0c8f/src/controllers/zt.js#L36

brantpastore commented 1 year ago

The path is https://10.0.0.173:3443/login and this is after finishing the setup, i get stuck trying to login with default credentials it just gets stuck loading.

I reviewed the error log and here are its contents:

cat ztnsrv-error.log Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process. SyntaxError: Unexpected token < in JSON at position 7 at JSON.parse () at Object.get_users (/srv/ztncui/src/controllers/usersController.js:25:21) at async exports.authenticate (/srv/ztncui/src/controllers/auth.js:27:17) at async /srv/ztncui/src/routes/index.js:46:3

lideming commented 1 year ago

It failed to parse the passwd file. Did you run this command to initialize it?

cp -v etc/default.passwd etc/passwd
brantpastore commented 1 year ago

Looks like that fixed it! Thank you very much.