@drumee/setup-infra 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/bin/init-private +40 -0
  2. package/bin/set-jitsi-conf +14 -0
  3. package/index.js +2 -1
  4. package/package.json +1 -1
  5. package/template.js +453 -0
  6. package/templates/etc/bind/named.conf.private +21 -0
  7. package/templates/etc/bind/named.conf.public +21 -0
  8. package/templates/etc/drumee/conf.d/conference.json.tpl +9 -0
  9. package/templates/etc/drumee/dnsapi.sh.tpl +28 -0
  10. package/templates/etc/drumee/env.json +29 -0
  11. package/templates/etc/drumee/infrastructure/internals/accel.conf.tpl +47 -0
  12. package/templates/etc/drumee/infrastructure/mfs.conf.tpl +16 -0
  13. package/templates/etc/drumee/infrastructure/platform.json.tpl +16 -0
  14. package/templates/etc/drumee/infrastructure/routes/main.conf.tpl +153 -0
  15. package/templates/etc/drumee/infrastructure/routes/private.conf.tpl +1 -1
  16. package/templates/etc/drumee/infrastructure/routes/public.conf.tpl +1 -1
  17. package/templates/etc/jitsi/jicofo/jicofo.conf.tpl +46 -0
  18. package/templates/etc/jitsi/jicofo/sip-cmmunicator.properties +3 -0
  19. package/templates/etc/jitsi/meet.conf.tpl +132 -0
  20. package/templates/etc/jitsi/ssl.conf.tpl +25 -0
  21. package/templates/etc/jitsi/videobridge/jvb.conf +67 -0
  22. package/templates/etc/jitsi/web/config.js.tpl +208 -0
  23. package/templates/etc/nginx/modules-enabled/90-turn-relay.conf +27 -0
  24. package/templates/etc/nginx/modules-enabled/90-turn-relay.conf.tpl +27 -0
  25. package/templates/etc/nginx/sites-enabled/jitsi.conf.tpl +28 -0
  26. package/templates/etc/nginx/sites-enabled/localhost.conf +31 -0
  27. package/templates/etc/nginx/sites-enabled/pivate.jitsi.conf.tpl +28 -0
  28. package/templates/etc/nginx/sites-enabled/private.conf.tpl +40 -0
  29. package/templates/etc/nginx/sites-enabled/public.conf.tpl +40 -0
  30. package/templates/etc/nginx/sites-enabled/public.jitsi.conf.tpl +28 -0
  31. package/templates/etc/prosody/conf.d/vhost.cfg.lua.tpl +162 -0
  32. package/templates/etc/turnserver.conf.tpl +46 -0
  33. package/templates/var/lib/bind/prvate.tpl +70 -0
@@ -0,0 +1,40 @@
1
+ #!/bin/bash
2
+ set -e
3
+ source /etc/drumee/drumee.sh
4
+
5
+ echo "Configuring private domain name..."
6
+
7
+ if [ "$DRUMEE_PRIVATE_DOMAIN" = "" ]; then
8
+ if [ "$DRUMEE_DOMAIN_NAME" = "" ]; then
9
+ export DRUMEE_PRIVATE_DOMAIN=drumee.local
10
+ else
11
+ echo "Private domain name not found. Will run only on public mode."
12
+ exit 0
13
+ fi
14
+ fi
15
+
16
+ mydomain=$DRUMEE_PRIVATE_DOMAIN
17
+ outdir=${CERTS_DIR}/${mydomain}_ecc
18
+
19
+ key=${outdir}/${mydomain}.key
20
+ csr=${outdir}/${mydomain}.csr
21
+ cer=${outdir}/${mydomain}.cer
22
+
23
+ mkir -p $outdir
24
+
25
+ C=$(locale --all | grep utf8 | tail -1 | sed -E "s/^(.+_)|(\..+)$//g")
26
+ if [ "$C" = "" ]; then
27
+ C=XX
28
+ fi
29
+
30
+ openssl genpkey -algorithm RSA -out $key
31
+
32
+ openssl req -new -key $key -out $csr -subj "/C=${C}/ST= /L=Local Domain /O=${DRUMEE_DESCRIPTION} /OU=${DRUMEE_DESCRIPTION} /CN=*.${mydomain} /emailAddress=${ADMIN_EMAIL}"
33
+
34
+ openssl x509 -req -in $csr -signkey $key -out $cer
35
+
36
+ openssl x509 -in $cer -noout -text
37
+
38
+ cp $cer /etc/ssl/certs/
39
+
40
+ exit 0
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ if [ -e /etc/drumee/drumee.sh ]; then
3
+ if [ -e /etc/prosody/defaults/credentials.sh ]; then
4
+ . /etc/drumee/drumee.sh
5
+ . /etc/prosody/defaults/credentials.sh
6
+ . /usr/share/debconf/confmodule
7
+ turn_secret=$(grep static-auth-secret /etc/turnserver.conf | sed -E "s/^.+=//")
8
+ db_set jitsi-videobridge/jvb-hostname $JITSI_DOMAIN
9
+ db_set jitsi-videobridge/jvbsecret $JVB_PASSWORD
10
+ db_set jicofo/jicofo-authpassword $JICOFO_PASSWORD
11
+ db_set jitsi-meet-prosody/jvb-hostname $JITSI_DOMAIN
12
+ db_set jitsi-meet-prosody/turn-secret $turn_secret
13
+ fi
14
+ fi
package/index.js CHANGED
@@ -324,7 +324,7 @@ function loadEnvFile(file, opt) {
324
324
  */
325
325
  function getSysConfigs() {
326
326
  let {
327
- public_domain, private_domain, private_ip4, public_ip4, public_ip6, backup_storage
327
+ public_domain, private_domain, private_ip4, public_ip4, public_ip6, backup_storage, ui_plugins_home,
328
328
  } = sysEnv();
329
329
  if (hasExistingSettings(Template.chroot('etc/drumee/drumee.json'))) {
330
330
  exit(0)
@@ -364,6 +364,7 @@ function getSysConfigs() {
364
364
  ["public_https_port", DRUMEE_HTTPS_PORT],
365
365
  ["public_ip4", public_ip4],
366
366
  ["public_ip6", public_ip6],
367
+ ["ui_plugins_home", ui_plugins_home],
367
368
  ["storage_backup", backup_storage], /** Legacy */
368
369
  ]
369
370
  let data = makeData(opt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drumee/setup-infra",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Drumee Infrastructure Setup Utilities",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/template.js ADDED
@@ -0,0 +1,453 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ======================================================
4
+ //
5
+ // ======================================================
6
+ const Template = require("./templates");
7
+ const { writeFileSync, readFileSync } = require(`jsonfile`);
8
+ const { exec } = require("shelljs");
9
+ const { join } = require("path");
10
+ const { isString } = require("lodash");
11
+ const { exit } = process;
12
+ const { sysEnv } = require("@drumee/server-essentials");
13
+ const { totalmem } = require('os');
14
+ const ARGV = require('minimist')(process.argv.slice(2));
15
+ const { existsSync } = require("fs");
16
+
17
+ const {
18
+ ACME_DIR,
19
+ ACME_EMAIL_ACCOUNT,
20
+ ADMIN_EMAIL,
21
+ DRUMEE_DESCRIPTION,
22
+ DRUMEE_DOMAIN_NAME,
23
+ FORCE_INSTALL,
24
+ NSUPDATE_KEY,
25
+ PUBLIC_IP4,
26
+ PUBLIC_IP6,
27
+ } = process.env;
28
+
29
+ let Dns = require("dns");
30
+ /**
31
+ *
32
+ * @param {*} l
33
+ * @returns
34
+ */
35
+ function randomString(l = 16) {
36
+ let crypto = require("crypto");
37
+ return crypto
38
+ .randomBytes(16)
39
+ .toString("base64")
40
+ .replace(/[\+\/=]+/g, "");
41
+ }
42
+
43
+ /**
44
+ *
45
+ * @param {*} data
46
+ * @returns
47
+ */
48
+ function copyFields(data, keys) {
49
+ let r = {};
50
+ for (let key of keys) {
51
+ if (data[key] !== null) {
52
+ r[key] = data[key];
53
+ }
54
+ }
55
+ return r;
56
+ }
57
+
58
+ /**
59
+ *
60
+ * @param {*} data
61
+ * @returns
62
+ */
63
+ function factory(data) {
64
+ let route = "main";
65
+ let mode = "dist";
66
+ let base = `${data.server_dir}/${mode}/${route}/`;
67
+ return {
68
+ name: "factory",
69
+ script: `./index.js`,
70
+ autorestart: false,
71
+ cwd: `${base}/offline/factory`,
72
+ env: copyFields(data, [
73
+ "domain_name",
74
+ "domain_desc",
75
+ "data_dir",
76
+ "system_user",
77
+ "system_group",
78
+ "drumee_root",
79
+ "cache_dir",
80
+ "acme_dir",
81
+ "acme_dns",
82
+ "acme_email_account",
83
+ "static_dir",
84
+ "runtime_dir",
85
+ "credential_dir",
86
+ ]),
87
+ dependencies: [`pm2-logrotate`],
88
+ };
89
+ }
90
+
91
+ /**
92
+ *
93
+ * @param {*} data
94
+ * @returns
95
+ */
96
+ function worker(data, instances = 1, exec_mode = 'fork_mode') {
97
+ let {
98
+ script,
99
+ pushPort,
100
+ route,
101
+ restPort,
102
+ name,
103
+ server_dir,
104
+ runtime_dir,
105
+ mode,
106
+ } = data;
107
+ if (!server_dir) server_dir = join(runtime_dir, 'server');
108
+ let base = `${server_dir}/${mode}/${route}`;
109
+ return {
110
+ name,
111
+ script,
112
+ cwd: base,
113
+ args: `--pushPort=${pushPort} --restPort=${restPort}`,
114
+ route,
115
+ env: {
116
+ cwd: base,
117
+ route,
118
+ server_home: base,
119
+ },
120
+ dependencies: [`pm2-logrotate`],
121
+ exec_mode,
122
+ instances
123
+ };
124
+ }
125
+
126
+ /***
127
+ *
128
+ */
129
+ function writeTemplates(data, targets) {
130
+ if (ARGV.readonly || ARGV.noCheck) {
131
+ console.log("Readonly", targets, data);
132
+ return
133
+ }
134
+ for (let target of targets) {
135
+ if (isString(target)) {
136
+ Template.write(data, target, target);
137
+ } else {
138
+ let { out, tpl } = target;
139
+ Template.write(data, out, tpl);
140
+ }
141
+ }
142
+ }
143
+
144
+ /**
145
+ *
146
+ */
147
+ function writeEcoSystem(data) {
148
+ const ports = {
149
+ pushPort: 23000,
150
+ restPort: 24000,
151
+ mode: "dist",
152
+ route: "main",
153
+ };
154
+
155
+ let main = worker({
156
+ ...data,
157
+ ...ports,
158
+ name: "main",
159
+ script: "./index.js",
160
+ });
161
+
162
+ let instances = 4;
163
+ if ((totalmem() / (1024 * 1024 * 1024)) < 2) {
164
+ instances = 2;
165
+ } else if ((totalmem() / (1024 * 1024 * 1024) < 6)) {
166
+ instances = 3;
167
+ }
168
+
169
+ let main_service = worker({
170
+ ...data,
171
+ ...ports,
172
+ name: "main/service",
173
+ script: "./service.js"
174
+ }, instances, 'cluster_mode');
175
+
176
+ let f = factory(data);
177
+ let routes = [main, main_service, f];
178
+ let ecosystem = "/etc/drumee/infrastructure/ecosystem.json";
179
+ if (ARGV.readonly) {
180
+ console.log("Readonly", ecosystem, routes);
181
+ return
182
+ }
183
+ writeFileSync(ecosystem, routes, { spaces: 2, EOL: "\r\n" });
184
+ let targets = [
185
+ {
186
+ out: `${data.server_dir}/ecosystem.config.js`,
187
+ tpl: "server/ecosystem.config.js",
188
+ },
189
+ ];
190
+ writeTemplates({ ecosystem, chroot: Template.chroot }, targets);
191
+ }
192
+
193
+ /**
194
+ *
195
+ */
196
+ function getSysConfigs() {
197
+ let { domain_name } = sysEnv();
198
+ if (existsSync('/etc/drumee/drumee.sh') && !FORCE_INSTALL) {
199
+ console.log(
200
+ `There is already a domain name configured on this server (${domain_name})\n`, `Use FORCE_INSTALL=yes to override`);
201
+ exit(0)
202
+ }
203
+ domain_name = domain_name || ARGV.domain || DRUMEE_DOMAIN_NAME;
204
+ if (!domain_name) {
205
+ console.log("There no domain name defined for the installation");
206
+ exit(0)
207
+ }
208
+
209
+ let data = { ...sysEnv(), domain_name, domain: domain_name };
210
+
211
+ data.chroot = Template.chroot();
212
+ data.acme_store = join(data.certs_dir, `${data.domain_name}_ecc`);
213
+ data.ca_server = data.ca_server || data.acme_ssl;
214
+ if (data.own_ssl && data.certs_dir) {
215
+ data.own_certs_dir = data.certs_dir;
216
+ }
217
+
218
+ if (!data.acme_dir) {
219
+ data.acme_dir = ACME_DIR || '/usr/share/acme';
220
+ }
221
+
222
+
223
+ if (!data.jitsi_domain) {
224
+ data.jitsi_domain = `jit.${data.domain_name}`;
225
+ }
226
+
227
+ if (!data.nsupdate_key) {
228
+ data.nsupdate_key = NSUPDATE_KEY || "/etc/bind/keys/update.key";
229
+ }
230
+
231
+ if (!data.domain_desc) {
232
+ data.domain_desc = DRUMEE_DESCRIPTION || 'My Drumee Box';
233
+ }
234
+
235
+ if (!data.admin_email) {
236
+ data.admin_email = ADMIN_EMAIL || `admin@${data.domain_name}`;
237
+ }
238
+
239
+ if (!data.acme_email_account) {
240
+ data.acme_email_account = ACME_EMAIL_ACCOUNT || data.admin_email;
241
+ }
242
+
243
+ if (!data.public_ip4) {
244
+ data.public_ip4 = PUBLIC_IP4;
245
+ }
246
+
247
+ if (!data.public_ip6) {
248
+ data.public_ip6 = PUBLIC_IP6;
249
+ }
250
+ let d = new Date().toISOString();
251
+ let [day, hour] = d.split('T')
252
+ day = day.replace(/\-/g, '');
253
+ hour = hour.split(':')[0];
254
+ data.serial = `${day}${hour}`;
255
+ let target = [
256
+ "etc/drumee/drumee.sh",
257
+ {
258
+ tpl: "etc/bind/db.domain",
259
+ out: `etc/bind/db.${domain_name}`
260
+ },
261
+ "etc/bind/named.conf.local",
262
+ "etc/bind/named.conf.log",
263
+ "etc/bind/named.conf.options"
264
+ ];
265
+
266
+ writeTemplates(data, target);
267
+
268
+ let args = { ...data };
269
+ let keys = ["myConf", "chroot", "date"];
270
+
271
+ for (let key of keys) {
272
+ delete args[key];
273
+ }
274
+
275
+ if (ARGV.readonly) {
276
+ return args;
277
+ }
278
+ console.log("Writing main conf into drumee.json");
279
+ writeFileSync(Template.chroot("etc/drumee/drumee.json"), args, {
280
+ spaces: 2,
281
+ EOL: "\r\n",
282
+ });
283
+ return args;
284
+ }
285
+
286
+ /**
287
+ *
288
+ */
289
+ function writeInfraConf(data) {
290
+ writeEcoSystem(data);
291
+ const etc = 'etc';
292
+ const nginx = join(etc, 'nginx');
293
+ const drumee = join(etc, 'drumee');
294
+ const infra = join(drumee, 'infrastructure');
295
+ let targets = [
296
+
297
+ // Nginx
298
+ `${nginx}/sites-enabled/drumee.conf`,
299
+
300
+ // Drumee
301
+ `${drumee}/ssl/main.conf`,
302
+ `${drumee}/conf.d/conference.json`,
303
+ `${drumee}/conf.d/drumee.json`,
304
+ `${drumee}/conf.d/exchange.json`,
305
+ `${drumee}/conf.d/myDrumee.json`,
306
+ `${drumee}/conf.d/conference.json`,
307
+ `${drumee}/conf.d/drumee.json`,
308
+ `${drumee}/conf.d/exchange.json`,
309
+ `${drumee}/conf.d/myDrumee.json`,
310
+
311
+ `${infra}/mfs.conf`,
312
+ `${infra}/routes/main.conf`,
313
+ `${infra}/internals/accel.conf`
314
+ ];
315
+ writeTemplates(data, targets);
316
+
317
+ }
318
+
319
+ /**
320
+ *
321
+ */
322
+ function writeJitsiConf(data) {
323
+ const etc = 'etc';
324
+ const jitsi = join(etc, 'jitsi');
325
+ const nginx = join(etc, 'nginx');
326
+ const prosody = join(etc, 'prosody');
327
+ const drumee = join(etc, 'drumee');
328
+ let targets = [
329
+ // Jicofo
330
+ `${jitsi}/jicofo/config`,
331
+ `${jitsi}/jicofo/jicofo.conf`,
332
+ `${jitsi}/jicofo/logging.properties`,
333
+
334
+ // Jitsi Video Bridge
335
+ `${jitsi}/videobridge/config`,
336
+ `${jitsi}/videobridge/jvb.conf`,
337
+ `${jitsi}/videobridge/logging.properties`,
338
+
339
+ // Jitsi meet
340
+ `${jitsi}/ssl.conf`,
341
+ `${jitsi}/meet.conf`,
342
+ `${jitsi}/web/config.js`,
343
+ `${jitsi}/web/interface_config.js`,
344
+ `${jitsi}/web/defaults/ffdhe2048.txt`,
345
+
346
+ // Nginx
347
+ `${nginx}/sites-enabled/jitsi.conf`,
348
+ `${nginx}/modules-enabled/90-turn-relay.conf`,
349
+ //`${nginx}/sites-enabled/turnrelay.conf`,
350
+
351
+ // Prosody
352
+ `${prosody}/prosody.cfg.lua`,
353
+ `${prosody}/defaults/credentials.sh`,
354
+ {
355
+ out: `${prosody}/conf.d/${data.jitsi_domain}.cfg.lua`,
356
+ tpl: `${prosody}/conf.d/vhost.cfg.lua`
357
+ },
358
+ // `${prosody}/migrator.cfg.lua`,
359
+
360
+ // Turnserver
361
+ `${etc}/turnserver.conf`,
362
+
363
+ `${drumee}/conf.d/conference.json`,
364
+
365
+ ];
366
+ writeTemplates(data, targets);
367
+
368
+ }
369
+
370
+ /**
371
+ *
372
+ */
373
+ function makeConfData(data) {
374
+ const routes = join('etc', 'drumee', 'infrastructure', 'routes');
375
+ //let jitsi_domain = `jit.${data.domain}`;
376
+ data = {
377
+ ...data,
378
+ turn_sercret: randomString(),
379
+ prosody_plugins: "/usr/share/jitsi-meet/prosody-plugins/",
380
+ xmpp_password: randomString(),
381
+ public_port: 9090,
382
+ ice_port: 10000,
383
+ jicofo_password: randomString(),
384
+ jvb_password: randomString(),
385
+ app_id: randomString(),
386
+ app_password: randomString(),
387
+ //jitsi_domain,
388
+ ui_base: join(data.ui_base, 'dist', 'main'),
389
+ location: '/-/',
390
+ pushPort: 23000,
391
+ restPort: 24000,
392
+ };
393
+ if (!data.export_dir) data.export_dir = null;
394
+ if (!data.import_dir) data.import_dir = null;
395
+ return data
396
+ }
397
+
398
+ /**
399
+ *
400
+ */
401
+ function privateIp() {
402
+ return new Promise(async (res, rej) => {
403
+ import("private-ip").then(module => { res(module.default) });
404
+ })
405
+ }
406
+
407
+ /**
408
+ *
409
+ * @returns
410
+ */
411
+ function configure() {
412
+ return new Promise(async (res, rej) => {
413
+ let data = getSysConfigs();
414
+ data.chroot = Template.chroot();
415
+ const isPrivate = await privateIp();
416
+ let os = require("os");
417
+ let interfaces = os.networkInterfaces();
418
+ for (let name in interfaces) {
419
+ for (let dev of interfaces[name]) {
420
+ if (dev.family == 'IPv4' && !dev.internal) {
421
+ if (isPrivate(dev.address)) {
422
+ data.local_address = dev.address;
423
+ break;
424
+ }
425
+ }
426
+ }
427
+ if (data.local_address) break;
428
+ }
429
+ //console.log(addr, service);
430
+ data = makeConfData(data);
431
+ let func = [];
432
+ if (!ARGV.infra && !ARGV.jitsi) {
433
+ func = [writeInfraConf, writeJitsiConf];
434
+ } else {
435
+ if (ARGV.infra) func.push(writeInfraConf)
436
+ if (ARGV.jitsi) func.push(writeJitsiConf)
437
+ }
438
+ func.map(function (f) {
439
+ f(data);
440
+ })
441
+ res();
442
+
443
+ });
444
+ }
445
+
446
+ configure()
447
+ .then(() => {
448
+ exit(0);
449
+ })
450
+ .catch((e) => {
451
+ console.error("Failed to setup Drumee infra", e);
452
+ exit(0);
453
+ });
@@ -0,0 +1,21 @@
1
+ //
2
+ // Configs setup by Drumee setup-infra utility
3
+ //
4
+
5
+ include "/etc/bind/named.conf.log";
6
+ include "<%= nsupdate_key %>";
7
+ zone "<%= private_domain %>" {
8
+ type master;
9
+ file "/var/lib/bind/<%= private_domain %>";
10
+ allow-query { any; };
11
+ allow-update { key "update"; };
12
+ allow-transfer { <%= private_ip4 %>; };
13
+ };
14
+
15
+ <% if (typeof(private_reverse_ip4) !== "undefined" && private_reverse_ip4 != "" ) { %>
16
+ zone "<%= private_reverse_ip4 %>" {
17
+ type master;
18
+ file "/var/lib/bind/<%= private_ip4 %>";
19
+ allow-query { any; };
20
+ };
21
+ <% } %>
@@ -0,0 +1,21 @@
1
+ //
2
+ // Configs setup by Drumee setup-infra utility
3
+ //
4
+
5
+ include "/etc/bind/named.conf.log";
6
+ include "<%= nsupdate_key %>";
7
+ zone "<%= public_domain %>" {
8
+ type master;
9
+ file "/var/lib/bind/<%= public_domain %>";
10
+ allow-query { any; };
11
+ allow-update { key "update"; };
12
+ allow-transfer { <%= public_ip4 %>; };
13
+ };
14
+
15
+ <% if (typeof(reverse_ip4) !== "undefined" && reverse_ip4 != "" ) { %>
16
+ zone "<%= reverse_ip4 %>" {
17
+ type master;
18
+ file "/var/lib/bind/<%= public_ip4 %>";
19
+ allow-query { any; };
20
+ };
21
+ <% } %>
@@ -0,0 +1,9 @@
1
+ {
2
+ "domain": "<%= jitsi_domain %>",
3
+ "hosts": {
4
+ "domain": "<%= jitsi_domain %>",
5
+ "muc": "conference.<%= jitsi_domain %>"
6
+ },
7
+ "bosh": "https://<%= jitsi_domain %>/http-bind",
8
+ "auth": ["<%= app_id %>", "<%= app_password %>"]
9
+ }
@@ -0,0 +1,28 @@
1
+ # -------------------------------------------------------------
2
+ # ! DO NOT EDIT !
3
+ # Config file automatically generated by <setup-infra>
4
+ # Date : <%= date %>
5
+ # -------------------------------------------------------------
6
+
7
+ export CERTS_DIR=<%= certs_dir %>
8
+ export ACME_DIR=<%= acme_dir %>
9
+ export ACME_DNS=<%= acme_dns %>
10
+ export ACME_EMAIL_ACCOUNT=<%= acme_email_account %>
11
+ export DRUMEE_CACHE_DIR=<%= cache_dir %>
12
+ export DRUMEE_DATA_DIR=<%= data_dir %>
13
+ export DRUMEE_DOMAIN_NAME=<%= domain_name %>
14
+ export DRUMEE_LOG_DIR=<%= log_dir %>
15
+ export DRUMEE_MFS_DIR=<%= data_dir %>/mfs
16
+ export DRUMEE_RUNTIME_DIR=<%= runtime_dir %>
17
+ export DRUMEE_SCHEMAS_DIR=<%= runtime_dir %>/server/schemas
18
+ export DRUMEE_SERVER_HOME=<%= server_dir %>
19
+ export DRUMEE_SERVER_NODE=<%= runtime_dir %>/dist/main/node_modules
20
+ export DRUMEE_STATIC_DIR=<%= static_dir %>
21
+ export DRUMEE_SYSTEM_GROUP=<%= system_group %>
22
+ export DRUMEE_SYSTEM_USER=<%= system_user %>
23
+ export DRUMEE_TMP_DIR=<%= runtime_dir %>/tmp
24
+ export DRUMEE_UI_HOME=<%= runtime_dir %>/ui
25
+ export LE_WORKING_DIR=<%= acme_dir %>
26
+ export OWN_SSL_CERTS_DIR=<%= own_certs_dir %>
27
+ export OWN_SSL=<%= own_ssl %>
28
+ export PUBLIC_UI_ROOT=<%= public_ui_root %>
@@ -0,0 +1,29 @@
1
+ {
2
+ "ACME_CA_SERVER":"<%= ca_server %>",
3
+ "CERTS_DIR":"<%= certs_dir %>",
4
+ "ACME_DIR":"<%= acme_dir %>",
5
+ "ACME_DNS":"<%= acme_dns %>",
6
+ "ACME_EMAIL_ACCOUNT":"<%= acme_email_account %>",
7
+ "ACME_STORE":"<%= certs_dir %>/<%= domain_name %>_ecc",
8
+ "APP_ROUTING_MARK":"<%= public_ui_root %>",
9
+ "CREDENTIAL_DIR": "/etc/drumee/credential",
10
+ "DOMAIN_DESC": "My Drumee Box",
11
+ "CACHE_DIR":"<%= cache_dir %>",
12
+ "DATA_DIR":"<%= data_dir %>",
13
+ "DOMAIN_NAME":"<%= domain_name %>",
14
+ "EXPORT_DIR":"<%= export_dir %>",
15
+ "IMPORT_DIR":"<%= import_dir %>",
16
+ "LOG_DIR":"<%= log_dir %>",
17
+ "MFS_DIR":"<%= data_dir %>/mfs",
18
+ "RUNTIME_DIR":"<%= runtime_dir %>",
19
+ "SCHEMAS_DIR":"/opt/drumee/schemas",
20
+ "SERVER_HOME":"<%= server_dir %>",
21
+ "SERVER_NODE":"<%= runtime_dir %>/dist/main/node_modules",
22
+ "STATIC_DIR":"<%= static_dir %>",
23
+ "SYSTEM_GROUP":"<%= system_group %>",
24
+ "SYSTEM_USER":"<%= system_user %>",
25
+ "TMP_DIR":"<%= runtime_dir %>/tmp",
26
+ "UI_HOME":"<%= runtime_dir %>/ui",
27
+ "JITSI_DOMAIN":"<%= jitsi_domain %>",
28
+ "PUBLIC_UI_ROOT":"/-"
29
+ }
@@ -0,0 +1,47 @@
1
+ # -------------------------------------------------------------
2
+ # ! DO NOT EDIT !
3
+ # Config file automatically generated by <setup-infra>
4
+ # Date : <%= date %>
5
+ # -------------------------------------------------------------
6
+
7
+ location /mfs/ {
8
+ gzip off;
9
+ internal;
10
+ add_header Cache-Control max-age=31536000;
11
+ add_header Content-Encoding $upstream_http_content_encoding;
12
+ add_header Access-Control-Allow-Origin <%= domain %>;
13
+ alias <%= data_dir %>/mfs/;
14
+ }
15
+
16
+ location /accel/ {
17
+ gzip off;
18
+ internal;
19
+ add_header Cache-Control max-age=31536000;
20
+ add_header Content-Encoding $upstream_http_content_encoding;
21
+ add_header Access-Control-Allow-Origin *;
22
+ alias <%= static_dir %>/;
23
+ }
24
+
25
+ location /-/static/ {
26
+ gzip off;
27
+ add_header Cache-Control max-age=31536000;
28
+ add_header Content-Encoding $upstream_http_content_encoding;
29
+ add_header Access-Control-Allow-Origin *;
30
+ alias <%= static_dir %>/;
31
+ }
32
+
33
+ location /-/images/ {
34
+ gzip off;
35
+ add_header Cache-Control max-age=31536000;
36
+ add_header Content-Encoding $upstream_http_content_encoding;
37
+ add_header Access-Control-Allow-Origin *;
38
+ alias <%= static_dir %>/images/;
39
+ }
40
+
41
+ location /-/fonts/ {
42
+ gzip off;
43
+ add_header Cache-Control max-age=31536000;
44
+ add_header Content-Encoding $upstream_http_content_encoding;
45
+ add_header Access-Control-Allow-Origin *;
46
+ alias <%= static_dir %>/fonts/;
47
+ }