aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/scripts/setupSchema
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2019-11-07 08:35:23 +0100
committermarzavec <admin@marzavec.com>2019-11-07 08:35:23 +0100
commitf28e65ab8035682372edbe1c11d9ca2581e0a2e6 (patch)
treea75c9b682ca245baa3f01df5ea704ba95205cef3 /server/src/scripts/setupSchema
parentMerge pull request #79 from 0x17de/feature-emote-trip (diff)
downloadhackchat-f28e65ab8035682372edbe1c11d9ca2581e0a2e6.tar.gz
hackchat-f28e65ab8035682372edbe1c11d9ca2581e0a2e6.zip
Syntax update and formatting tweaks
Diffstat (limited to '')
-rw-r--r--server/src/scripts/setupSchema/Banner.js12
-rw-r--r--server/src/scripts/setupSchema/Questions.js20
2 files changed, 16 insertions, 16 deletions
diff --git a/server/src/scripts/setupSchema/Banner.js b/server/src/scripts/setupSchema/Banner.js
index 823f0fe..f13fde7 100644
--- a/server/src/scripts/setupSchema/Banner.js
+++ b/server/src/scripts/setupSchema/Banner.js
@@ -5,8 +5,8 @@
*
*/
-const stripIndents = require('common-tags').stripIndents;
-const chalk = require('chalk');
+import { stripIndents } from 'common-tags';
+import chalk from 'chalk';
// gotta have that sexy console
console.log(stripIndents`
@@ -20,9 +20,9 @@ console.log(stripIndents`
${chalk.white('Note:')} ${chalk.green('npm/yarn run config')} will re-run this utility.
You will now be asked for the following:
- - ${chalk.magenta(' Salt')}, the salt for username trip
- - ${chalk.magenta('Admin Name')}, the initial admin username
- - ${chalk.magenta('Admin Pass')}, the initial admin password
- - ${chalk.magenta(' Port')}, the port for the websocket
+ - ${chalk.magenta(' Salt')}, the salt for username trip
+ - ${chalk.magenta('Admin Name')}, the initial admin username
+ - ${chalk.magenta('Admin Pass')}, the initial admin password
+ - ${chalk.magenta(' Port')}, the port for the websocket
\u200b
`);
diff --git a/server/src/scripts/setupSchema/Questions.js b/server/src/scripts/setupSchema/Questions.js
index f84d32f..532ba67 100644
--- a/server/src/scripts/setupSchema/Questions.js
+++ b/server/src/scripts/setupSchema/Questions.js
@@ -15,10 +15,10 @@ const Questions = {
type: 'string',
hidden: true,
replace: '*',
- before: value => {
+ before: (value) => {
salt = value;
return value;
- }
+ },
},
adminName: {
@@ -26,7 +26,7 @@ const Questions = {
pattern: /^"?[a-zA-Z0-9_]+"?$/,
type: 'string',
message: 'Nicks can only contain letters, numbers and underscores',
- before: value => value.replace(/"/g, '')
+ before: (value) => value.replace(/"/g, ''),
},
adminTrip: {
@@ -35,21 +35,21 @@ const Questions = {
replace: '*',
description: 'Admin Password',
message: 'You must enter or re-enter a password',
- before: value => {
+ before: (value) => {
const crypto = require('crypto');
- let sha = crypto.createHash('sha256');
+ const sha = crypto.createHash('sha256');
sha.update(value + salt);
return sha.digest('base64').substr(0, 6);
- }
+ },
},
websocketPort: {
type: 'integer',
message: 'The port may only be a number!',
description: 'Websocket Port',
- default: '6060'
- }
- }
-}
+ default: '6060',
+ },
+ },
+};
module.exports = Questions;