-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.js
181 lines (168 loc) · 3.85 KB
/
config.js
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/**
* NODEFONY FRAMEWORK
*
* KERNEL CONFIG
*
* Domain listen : Nodefony can listen only one domain ( no vhost )
* Example :
* domain : 0.0.0.0 // for all interfaces
* domain : [::1] // for IPV6 only
* domain : 192.168.1.1 // IPV4
* domain : mydomain.com // DNS
*
* Domain Alias : string only "<<regexp>>" use domainCheck : true
* Example :
* domainAlias:[
* "^127.0.0.1$",
* "^localhost$",
* ".*\\.nodefony\\.com",
* "^nodefony\\.eu$",
* "^.*\\.nodefony\\.eu$"
* ]
*/
const path = require("path");
const certificats = {
options: {
rejectUnauthorized: true
}
};
let CDN = null;
let statics = true;
let monitoring = true;
let documentation = true;
let unitTest = true;
let domainCheck = false;
switch (kernel.appEnvironment) {
case "production":
case "development":
default:
certificats.key = path.resolve("config", "certificates", "server", "privkey.pem");
certificats.cert = path.resolve("config", "certificates", "server", "fullchain.pem");
certificats.ca = path.resolve("config", "certificates", "ca", "nodefony-root-ca.crt.pem");
CDN = null;
statics = true;
documentation = true;
monitoring = true;
unitTest = true;
domainCheck = true;
}
module.exports = {
system: {
domain: "0.0.0.0",
domainAlias: [
"^127.0.0.1$",
"^localhost$"
],
httpPort: 5151,
httpsPort: 5152,
domainCheck,
locale: "en_en",
/**
* BUNDLES CORE
*/
security: true,
realtime: true,
monitoring,
mail: true,
documentation,
unitTest,
redis: false,
mongo: false,
elastic: false,
/**
* SERVERS
*/
servers: {
statics,
protocol: "2.0", // 2.0 || 1.1
http: true,
https: true,
ws: true,
wss: true,
certificats
},
/**
* DEV SERVER
*/
devServer: {
hot: false, // true || only || false
overlay: true,
logging: "info", // none, error, warning or info
progress: false,
protocol: "https",
websocket: true
},
/**
* BUNDLES LOCAL REGISTRATION
*
* bundles:{
* "hello-bundle" : "file:src/bundles/hello-bundle"
* "test-bundle" : path.resolve("src", "bundles", "test-bundle")
* }
*/
bundles: {
"test-bundle": path.resolve("src", "bundles", "test-bundle"),
"users-bundle": path.resolve("src", "nodefony", "cli", "builder", "bundles", "users-bundle")
// "demo-bundle": "file:src/bundles/demo-bundle",
// "webAssembly-bundle": "file:src/bundles/webAssembly-bundle",
// "ia-bundle": "file:src/bundles/ia-bundle",
// "vault-bundle": "file:src/bundles/vault-bundle"
// "keycloak-bundle": "file:src/bundles/keycloak-bundle"
},
/**
* SYSLOG NODEFONY
*/
log: {
active: true,
debug: "*" // ["WEBPACK","ROUTER","bundle-sequelize"]
}
},
/**
* ASSETS CDN
*
* You set cdn with string
* CDN : "cdn.nodefony.com",
* or
* CDN:
* global: "cdn.nodefony.com",
* or
* CDN:{
* stylesheet:[
* "cdn.nodefony.com"
* ],
* javascript:[
* "cdn.nodefony.com"
* ],
* image:[
* "cdn.nodefony.com",
* "cdn.nodefony.fr"
* ],
* font:[
* "cdn.nodefony.com"
* ]
* },
*/
CDN,
/**
* ENGINE TEMPLATE
*
* TWIG
* https://github.com/justjohn/twig.js
*
*/
templating: "twig",
/**
* ENGINE ORM
* sequelize || mongoose
* orm : mongoose
*/
orm: "sequelize",
/**
* NODE.JS PACKAGE MANAGER
*
* npm
* yarn
* pnpm
*/
packageManager: "yarn"
};