@drumee/setup-infra 1.0.20 → 1.0.21

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.
package/bin/install CHANGED
@@ -10,7 +10,7 @@ export base=$(dirname $script_dir)
10
10
  export PUBLIC_DOMAIN=$DRUMEE_DOMAIN_NAME
11
11
 
12
12
  if [ "$PUBLIC_DOMAIN" != "" ]; then
13
- $base/bin/init-mail $DRUMEE_DOMAIN_NAME$PUBLIC_DOMAIN
13
+ $base/bin/init-mail $PUBLIC_DOMAIN
14
14
  fi
15
15
 
16
16
  # Generate all the required settings
package/index.js CHANGED
@@ -49,6 +49,7 @@ if (PUBLIC_DOMAIN) {
49
49
  }
50
50
 
51
51
  PRIVATE_DOMAIN = PRIVATE_DOMAIN || 'local.drumee';
52
+ if (OWN_CERTS_DIR) PRIVATE_DOMAIN = null;
52
53
  DRUMEE_HTTPS_PORT = DRUMEE_HTTPS_PORT || 443;
53
54
  DRUMEE_LOCAL_PORT = DRUMEE_LOCAL_PORT || 8443;
54
55
  DRUMEE_HTTP_PORT = DRUMEE_HTTP_PORT || 80;
@@ -338,6 +339,7 @@ function getSysConfigs() {
338
339
  exit(0)
339
340
  }
340
341
  const nsupdate_key = Template.chroot('etc/bind/keys/update.key')
342
+ if (OWN_CERTS_DIR && existsSync(OWN_CERTS_DIR)) CERTS_DIR = OWN_CERTS_DIR;
341
343
  const opt = [
342
344
  ["acme_dir", ACME_DIR],
343
345
  ["acme_email_account", ACME_EMAIL_ACCOUNT, ADMIN_EMAIL],
@@ -390,7 +392,7 @@ function getSysConfigs() {
390
392
  configs.main_domain = data.domain;
391
393
  configs.domain_name = data.domain;
392
394
  configs.log_dir = data.log_dir;
393
-
395
+
394
396
  configs.socketPath = getSocketPath();
395
397
  let filename = Template.chroot("etc/drumee/drumee.json");
396
398
  Template.makedir(dirname(filename));
@@ -474,7 +476,7 @@ function writeInfraConf(data) {
474
476
  const postfix = join(etc, 'postfix',);
475
477
  const mariadb = join(etc, 'mysql', 'mariadb.conf.d');
476
478
  const infra = join(drumee, 'infrastructure');
477
- let { certs_dir, public_domain, private_domain, jitsi_private_domain, jits_public_domain } = data;
479
+ let { certs_dir, own_certs_dir, public_domain, private_domain, jitsi_private_domain } = data;
478
480
  let targets = [
479
481
 
480
482
  // Nginx
@@ -493,7 +495,12 @@ function writeInfraConf(data) {
493
495
  `${mariadb}/50-client.cnf`,
494
496
  `${bind}/named.conf.local`,
495
497
  ];
496
-
498
+ if (own_certs_dir) {
499
+ certs_dir = own_certs_dir;
500
+ data.certs_dir = certs_dir;
501
+ private_domain = null;
502
+ jitsi_private_domain = null;
503
+ }
497
504
  if (data.public_ip4 && public_domain) {
498
505
  targets.push(
499
506
  `${infra}/internals/accel.public.conf`,
@@ -752,7 +759,7 @@ async function getAddresses(data) {
752
759
  for (let c of b) {
753
760
  if (c == '255') {
754
761
  br.push(a[i])
755
- }else{
762
+ } else {
756
763
  br.push('255')
757
764
  }
758
765
  i++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drumee/setup-infra",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Drumee Infrastructure Setup Utilities",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "author": "Somanos Sar <somanos@drumee.com>",
18
18
  "license": "AGPL V3",
19
19
  "dependencies": {
20
- "@drumee/server-essentials": "^1.1.26",
20
+ "@drumee/server-essentials": "^1.1.37",
21
21
  "argparse": "^2.0.1",
22
22
  "crypto": "^1.0.1",
23
23
  "jsonfile": "^5.0.0",
@@ -52,6 +52,7 @@ location <%= location %> {
52
52
  proxy_set_header Upgrade $http_upgrade;
53
53
  proxy_set_header Connection 'upgrade';
54
54
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
55
+ proxy_set_header X-Forwarded-Proto $scheme;
55
56
  proxy_set_header X-Real-IP $remote_addr;
56
57
  proxy_set_header X-Connecting-IP $remote_addr;
57
58
  proxy_set_header Host $host;
@@ -66,6 +67,7 @@ location <%= location %> {
66
67
  proxy_set_header Upgrade $http_upgrade;
67
68
  proxy_set_header Connection 'upgrade';
68
69
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70
+ proxy_set_header X-Forwarded-Proto $scheme;
69
71
  proxy_set_header X-Real-IP $remote_addr;
70
72
  proxy_set_header X-Connecting-IP $remote_addr;
71
73
  proxy_set_header Host $host;
@@ -52,6 +52,7 @@ location <%= location %> {
52
52
  proxy_set_header Upgrade $http_upgrade;
53
53
  proxy_set_header Connection 'upgrade';
54
54
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
55
+ proxy_set_header X-Forwarded-Proto $scheme;
55
56
  proxy_set_header X-Real-IP $remote_addr;
56
57
  proxy_set_header X-Connecting-IP $remote_addr;
57
58
  proxy_set_header Host $host;
@@ -66,6 +67,7 @@ location <%= location %> {
66
67
  proxy_set_header Upgrade $http_upgrade;
67
68
  proxy_set_header Connection 'upgrade';
68
69
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70
+ proxy_set_header X-Forwarded-Proto $scheme;
69
71
  proxy_set_header X-Real-IP $remote_addr;
70
72
  proxy_set_header X-Connecting-IP $remote_addr;
71
73
  proxy_set_header Host $host;
@@ -12,6 +12,7 @@ proxy_cache_path <%= cache_dir %>/<%= public_domain %> levels=1:2 keys_zone=<%=
12
12
  server {
13
13
  listen <%= public_http_port %>;
14
14
  listen [::]:<%= public_http_port %>;
15
+ http2 on;
15
16
  server_name <%= public_domain %>;
16
17
  location / {
17
18
  return 301 https://$host$request_uri;
@@ -19,7 +20,8 @@ server {
19
20
  }
20
21
  server {
21
22
  listen <%= public_https_port %> ssl;
22
- listen [::]:<%= public_https_port %> ssl;
23
+ listen [::]:<%= public_https_port %> ssl;
24
+ http2 on;
23
25
  #
24
26
  root <%= server_dir %>;
25
27
  server_name <%= public_domain %>;
@@ -12,6 +12,7 @@ proxy_cache_path <%= cache_dir %>/<%= private_domain %> levels=1:2 keys_zone=<%=
12
12
  server {
13
13
  listen <%= public_http_port %>;
14
14
  listen [::]:<%= public_http_port %>;
15
+ http2 on;
15
16
  server_name <%= private_domain %>;
16
17
  location / {
17
18
  return 301 https://$host$request_uri;
@@ -19,7 +20,8 @@ server {
19
20
  }
20
21
  server {
21
22
  listen <%= public_https_port %> ssl;
22
- listen [::]:<%= public_https_port %> ssl;
23
+ listen [::]:<%= public_https_port %> ssl;
24
+ http2 on;
23
25
  #
24
26
  root <%= server_dir %>;
25
27
  server_name <%= private_domain %>;
@@ -14,13 +14,15 @@ map $http_upgrade $connection_upgrade {
14
14
  server {
15
15
  listen <%= public_http_port %> default_server;
16
16
  listen [::]:<%= public_http_port %> default_server;
17
+ http2 on;
17
18
  server_name *.<%= jitsi_private_domain %>;
18
19
  include /etc/jitsi/meet.private.conf;
19
20
  }
20
21
 
21
22
  server {
22
- listen <%= public_https_port %> ssl http2;
23
- listen [::]:<%= public_https_port %> ssl http2;
23
+ listen <%= public_https_port %> ssl;
24
+ listen [::]:<%= public_https_port %> ssl;
25
+ http2 on;
24
26
  server_name <%= jitsi_private_domain %>;
25
27
  include /etc/jitsi/ssl.private.conf;
26
28
  include /etc/jitsi/meet.private.conf;
@@ -14,13 +14,15 @@ map $http_upgrade $connection_upgrade {
14
14
  server {
15
15
  listen <%= public_http_port %> default_server;
16
16
  listen [::]:<%= public_http_port %> default_server;
17
+ http2 on;
17
18
  server_name *.<%= jitsi_public_domain %>;
18
19
  include /etc/jitsi/meet.public.conf;
19
20
  }
20
21
 
21
22
  server {
22
- listen <%= public_https_port %> ssl http2;
23
- listen [::]:<%= public_https_port %> ssl http2;
23
+ listen <%= public_https_port %> ssl ;
24
+ listen [::]:<%= public_https_port %> ssl;
25
+ http2 on;
24
26
  server_name <%= jitsi_public_domain %>;
25
27
  include /etc/jitsi/ssl.public.conf;
26
28
  include /etc/jitsi/meet.public.conf;