This repository was archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.js
More file actions
149 lines (140 loc) · 2.79 KB
/
Copy pathpostinstall.js
File metadata and controls
149 lines (140 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#! /usr/bin/env node --harmony
var c7 = require('configurator7');
var configJson = require('./install_files/server/config.json');
var datasourcesJson = require('./install_files/server/datasources.json');
var configFiles = {
"config": {
data: configJson,
targetFile: "./server/config.json",
},
"datasources": {
data: datasourcesJson,
targetFile: "./server/datasources.json",
}
};
var questions = [
{
title: "How is your app called?",
type: "default",
required: true,
target: {
file: "config",
position: 'custom.appName'
},
default: 'myApp',
},
{
title: "Please provide the sender email address for verification mails among others",
type: "email",
required: true,
target: {
file: "config",
position: 'custom.senderMail'
}
},
{
title: "Please provide your email host for sending mails.",
type: "default",
required: true,
target: {
file: "datasources",
position: "mailer.transports.0.host"
}
},
{
title: "Please provide your email host port for sending mails.",
type: "number",
required: true,
default: 587,
target: {
file: "datasources",
position: "mailer.transports.0.port"
}
},
{
title: "Now the username for this email-account:",
type: "default",
required: true,
target: {
file: "datasources",
position: "mailer.transports.0.auth.user"
}
},
{
title: "password:",
type: "password",
required: true,
target: {
file: "datasources",
position: "mailer.transports.0.auth.pass"
}
},
{
title: "mongo database name:",
type: "default",
required: true,
target: {
file: "datasources",
position: "mongo.database"
}
},
{
title: "Now let's create a administrator account. Start with the username:",
type: "default",
required: true,
target: {
file: "config",
position: "custom.admin.username"
}
},
{
title: "Administrator email:",
type: "email",
required: true,
target: {
file: "config",
position: "custom.admin.email"
}
},
{
title: "Administrator password:",
type: "password",
required: true,
target: {
file: "config",
position: "custom.admin.password"
}
},
{
title: "Do you want to create a hierachical user role system?",
type: "boolean",
required: true,
target: {
file: "config",
position: "custom.rbac.hierachical"
}
},
{
title: "Choose your roles (the first is the one with the fewest rights)",
type: "array",
required: true,
target: {
file: "config",
position: "custom.rbac.roles"
}
},
{
title: "Which role should be assigned to a recently registered user?",
type: "default",
required: true,
target: {
file: "config",
position: "custom.rbac.defaultRole"
}
}
];
var configurator = new c7.configurator(configFiles, questions);
configurator.run(function(err){
if(err) throw err;
console.log("done!");
});