aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKana <[email protected]>2019-02-19 11:30:10 +0900
committerGitHub <[email protected]>2019-02-19 11:30:10 +0900
commit2e0cbd3ea7d8317501d75a5e97eb847769c48c2e (patch)
tree897e443a94c43725a5dc0bf8350d058f88e53cfc /src
parentUpdate package.json (diff)
downloadhost.fuwn.me-2e0cbd3ea7d8317501d75a5e97eb847769c48c2e.tar.xz
host.fuwn.me-2e0cbd3ea7d8317501d75a5e97eb847769c48c2e.zip
Create wizard.js
Diffstat (limited to 'src')
-rw-r--r--src/wizard.js86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/wizard.js b/src/wizard.js
new file mode 100644
index 0000000..c9fdbc0
--- /dev/null
+++ b/src/wizard.js
@@ -0,0 +1,86 @@
+const qoa = require('qoa');
+qoa.config({
+ prefix: '>',
+ underlineQuery: false
+});
+
+async function start() {
+ const confirm = await qoa.confirm({
+ type: 'confirm',
+ query: 'Would you like to run the setup wizard now?',
+ handle: 'run',
+ accept: 'y',
+ deny: 'n'
+ });
+ if (!confirm.run) process.exit(0);
+
+ const wizard = [
+ {
+ type: 'input',
+ query: 'Port to run the API in:',
+ handle: 'serverPort'
+ },
+ {
+ type: 'input',
+ query: 'Port to run the Website in:',
+ handle: 'websitePort'
+ },
+ {
+ type: 'input',
+ query: 'Full domain this instance is gonna be running on (Ex: https://lolisafe.moe):',
+ handle: 'fullDomain'
+ },
+ {
+ type: 'input',
+ query: 'Maximum allowed upload file size in MB (Ex: 100):',
+ handle: 'maxSize'
+ },
+ {
+ type: 'confirm',
+ query: 'Generate thumbnails for images/videos? (Requires ffmpeg installed and in your PATH)',
+ handle: 'generateThumbnails',
+ accept: 'y',
+ deny: 'n'
+ },
+ {
+ type: 'confirm',
+ query: 'Allow users to download entire albums in ZIP format?',
+ handle: 'generateZips',
+ accept: 'y',
+ deny: 'n'
+ },
+ {
+ type: 'interactive',
+ query: 'How would you like to serve the uploaded files?',
+ handle: 'serveWithNode',
+ menu: [
+ 'With NGINX (Faster but needs a bit more setup)',
+ 'With node'
+ ]
+ },
+ {
+ type: 'confirm',
+ query: 'Run lolisafe in public mode?',
+ handle: 'publicMode',
+ accept: 'y',
+ deny: 'n'
+ },
+ {
+ type: 'confirm',
+ query: 'Enable user signup for new accounts?',
+ handle: 'enableUserAccounts',
+ accept: 'y',
+ deny: 'n'
+ },
+ {
+ type: 'secure',
+ query: 'Type a secure password for the root user:',
+ handle: 'rootPassword'
+ }
+ ];
+
+ const response = await qoa.prompt(wizard);
+ console.log(response);
+}
+
+start();