From 73e91783e37ef2fc97109a2f044386ca1c2b3481 Mon Sep 17 00:00:00 2001 From: knotteye Date: Sun, 10 Nov 2019 08:27:00 -0600 Subject: [PATCH] Fix handling of usernames with capital letters in the web page. Add updating and backup/restore instructions. --- docs/INSTALLATION.md | 16 +++++++++++++++- src/http.ts | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 37792db..abcf2eb 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -32,4 +32,18 @@ npm start ``` It is reccomended that you run Satyr behind a TLS terminating reverse proxy, like nginx. -An example systemd service is provided at install/satyr.service. It assumes you've installed satyr into /opt/satyr, and created a satyr user with the home directory /var/lib/satyr for the purpose of running the service. \ No newline at end of file +An example systemd service is provided at install/satyr.service. It assumes you've installed satyr into /opt/satyr, and created a satyr user with the home directory /var/lib/satyr for the purpose of running the service. + +## Updating Satyr +Updating should be as simple as pulling the latest code and dependencies, then building and restarting the server. + +```bash +git pull +npm i +npm run build +``` + +Then restart the server. + +## Migrating Satyr +To backup and restore, you will need to export the mysqlDB. Restore the new database from the backup, then copy the config/local.toml file and the site directory to the new install. \ No newline at end of file diff --git a/src/http.ts b/src/http.ts index 2e1c7b2..49f4a42 100644 --- a/src/http.ts +++ b/src/http.ts @@ -52,9 +52,9 @@ async function init(satyr: any, port: number, ircconf: any){ }); }); app.get('/users/*', (req, res) => { - njkconf.user = req.url.split('/')[2].toLowerCase(); - db.query('select title,about from user_meta where username='+db.raw.escape(njkconf.user)).then((result) => { + db.query('select username,title,about from user_meta where username='+db.raw.escape(req.url.split('/')[2].toLowerCase())).then((result) => { if(result[0]){ + njkconf.user = result[0].username; njkconf.streamtitle = result[0].title; njkconf.about = result[0].about; res.render('user.njk', njkconf);