From e29de0d001888ac10bdaa4b3303ff9009ef27c19 Mon Sep 17 00:00:00 2001 From: thelamer Date: Mon, 31 Jan 2022 15:05:27 -0800 Subject: [PATCH] logic updates for downstream and style tweaks for black backgrounds --- README.md | 2 +- app.js | 9 +++++---- public/css/vdi.css | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d621640..4f45b28 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ All application settings are passed via environment variables: | PASSWORD | Desktop session password for the RDP connection, default abc. | | RDP_HOST | IP address of RDP endpoint, default "127.0.0.1". | | RDP_PORT | RDP port to connect to, default "3389".(quotes important not an integer) | -| AUTO_LOGIN | Set to false to disable auto login, default true. | +| AUTO_LOGIN | Set to false to disable auto login or true to force it, default unset. | | SUBFOLDER | Subfolder for the application if running a subfolder reverse proxy, need both slashes IE `/subfolder/` | | TITLE | The page title displayed on the web browser, default "Guacamole Client". | | CYPHER | The cipher key to user for encoding the connection string token for guacamole, default "LSIOGCKYLSIOGCKYLSIOGCKYLSIOGCKY" | diff --git a/app.js b/app.js index 8e99581..6e41479 100644 --- a/app.js +++ b/app.js @@ -6,11 +6,11 @@ var CUSTOM_USER = process.env.CUSTOM_USER || 'abc'; var PASSWORD = process.env.PASSWORD || 'abc'; var RDP_HOST = process.env.RDP_HOST || '127.0.0.1'; var RDP_PORT = process.env.RDP_PORT || '3389'; -var AUTO_LOGIN = process.env.AUTO_LOGIN || true; +var AUTO_LOGIN = process.env.AUTO_LOGIN || null; var SUBFOLDER = process.env.SUBFOLDER || '/'; var TITLE = process.env.TITLE || 'Guacamole Client'; var CYPHER =process.env.CYPHER || 'LSIOGCKYLSIOGCKYLSIOGCKYLSIOGCKY'; -var FM_NO_AUTH = process.env.FM_NO_AUTH || false; +var FM_NO_AUTH = process.env.FM_NO_AUTH || 'false'; var FM_HOME = process.env.FM_HOME || '/config'; //// Application Variables //// @@ -70,7 +70,8 @@ baseRouter.get('/', function (req, res) { } } }; - if ((! req.query.login) || (AUTO_LOGIN == true) || (PASSWORD == 'abc')) { + console.log(AUTO_LOGIN); + if (((! req.query.login) && (AUTO_LOGIN == 'true')) || ((! req.query.login) && (PASSWORD == 'abc') && (AUTO_LOGIN !== 'false'))) { Object.assign(connectString.connection.settings, {'username':CUSTOM_USER,'password':PASSWORD}); } res.render(__dirname + '/rdp.ejs', {token : encrypt(connectString), title: TITLE}); @@ -95,7 +96,7 @@ io.on('connection', async function (socket) { username: CUSTOM_USER, password: password, }; - if (FM_NO_AUTH) { + if (FM_NO_AUTH == 'true') { authData = {id: true}; getFiles(FM_HOME); return; diff --git a/public/css/vdi.css b/public/css/vdi.css index eaa9074..57b3fb9 100644 --- a/public/css/vdi.css +++ b/public/css/vdi.css @@ -45,6 +45,7 @@ button { text-decoration: none; font-size: 1.2em; border-radius: 5px; + border:1px solid white; } .sidenav { @@ -57,7 +58,7 @@ button { } .sidenav:hover { - background: rgba(0, 0, 0, 0.5); + background: rgba(255, 255, 255, 0.3); } #sideopen { @@ -81,6 +82,7 @@ button { border-radius:50%; width: 20px; height: 20px; + border:1px solid white; } #clipboard {