@drumee/setup-infra 1.0.14 → 1.0.16

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 (75) hide show
  1. package/bin/create-local-certs +38 -0
  2. package/bin/env +8 -5
  3. package/bin/init-acme +23 -4
  4. package/bin/init-named +1 -1
  5. package/bin/install +28 -4
  6. package/bin/prosody +21 -12
  7. package/index.js +314 -184
  8. package/package.json +2 -2
  9. package/templates/etc/bind/named.conf.local +39 -0
  10. package/templates/etc/bind/named.conf.options +13 -4
  11. package/templates/etc/dhcp/dhclient.conf +55 -0
  12. package/templates/etc/drumee/certs/jitsi.private.cnf +13 -0
  13. package/templates/etc/drumee/certs/private.cnf +13 -0
  14. package/templates/etc/drumee/conf.d/conference.private.json +9 -0
  15. package/templates/etc/drumee/conf.d/conference.public.json +9 -0
  16. package/templates/etc/drumee/conf.d/myDrumee.json.tpl +2 -1
  17. package/templates/etc/drumee/drumee.sh.tpl +32 -17
  18. package/templates/etc/drumee/infrastructure/internals/accel.private.conf.tpl +47 -0
  19. package/templates/etc/drumee/infrastructure/internals/{accel.conf.tpl → accel.public.conf.tpl} +1 -1
  20. package/templates/etc/drumee/infrastructure/{platform.json.tpl → mfs.private.conf.tpl} +5 -5
  21. package/templates/etc/drumee/infrastructure/{mfs.conf.tpl → mfs.public.conf.tpl} +1 -1
  22. package/templates/etc/drumee/infrastructure/routes/private.conf.tpl +143 -0
  23. package/templates/etc/drumee/infrastructure/routes/{main.conf.tpl → public.conf.tpl} +18 -28
  24. package/templates/etc/drumee/infrastructure/servers/tt.conf +9 -9
  25. package/templates/etc/drumee/ssl/private.conf.tpl +2 -1
  26. package/templates/etc/drumee/ssl/public.conf.tpl +1 -1
  27. package/templates/etc/jitsi/jicofo/jicofo.private.conf.tpl +46 -0
  28. package/templates/etc/jitsi/jicofo/{jicofo.conf.tpl → jicofo.public.conf.tpl} +7 -7
  29. package/templates/etc/jitsi/jicofo/sip-cmmunicator.private.properties +3 -0
  30. package/templates/etc/jitsi/jicofo/sip-cmmunicator.public.properties +3 -0
  31. package/templates/etc/jitsi/meet.private.conf.tpl +132 -0
  32. package/templates/etc/jitsi/{meet.conf.tpl → meet.public.conf.tpl} +5 -5
  33. package/templates/etc/jitsi/ssl.private.conf.tpl +25 -0
  34. package/templates/etc/jitsi/{ssl.conf.tpl → ssl.public.conf.tpl} +3 -3
  35. package/templates/etc/jitsi/videobridge/defaults/jvb.conf +1 -1
  36. package/templates/etc/jitsi/videobridge/jvb.private.conf +67 -0
  37. package/templates/etc/jitsi/videobridge/{jvb.conf → jvb.public.conf} +6 -6
  38. package/templates/etc/jitsi/web/config.private.js.tpl +208 -0
  39. package/templates/etc/jitsi/web/{config.js.tpl → config.public.js.tpl} +4 -4
  40. package/templates/etc/jitsi/web/defaults/default +2 -2
  41. package/templates/etc/jitsi/web/defaults/meet.conf +3 -3
  42. package/templates/etc/mysql/mariadb.conf.d/50-server.cnf +3 -3
  43. package/templates/etc/nginx/modules-enabled/{90-turn-relay.conf → 90-turn-relay.private.conf.tpl} +6 -6
  44. package/templates/etc/nginx/modules-enabled/{90-turn-relay.conf.tpl → 90-turn-relay.public.conf.tpl} +4 -4
  45. package/templates/etc/nginx/nginx.conf +2 -0
  46. package/templates/etc/nginx/sites-enabled/{public.conf.tpl → 01-public.conf.tpl} +7 -7
  47. package/templates/etc/nginx/sites-enabled/{private.conf.tpl → 02-private.conf.tpl} +6 -6
  48. package/templates/etc/nginx/sites-enabled/{jitsi.conf.tpl → 20-jitsi.private.conf.tpl} +9 -9
  49. package/templates/etc/nginx/sites-enabled/{pivate.jitsi.conf.tpl → 20-jitsi.public.conf.tpl} +9 -9
  50. package/templates/etc/nginx/sites-enabled/{localhost.conf → loopback.tpl} +10 -9
  51. package/templates/etc/nginx/sites-enabled/turnrelay.conf.tpl +4 -4
  52. package/templates/etc/prosody/conf.d/private.cfg.lua.tpl +51 -51
  53. package/templates/etc/prosody/conf.d/public.cfg.lua.tpl +47 -47
  54. package/templates/etc/prosody/defaults/conf.d/jitsi-meet.cfg.lua +3 -3
  55. package/templates/etc/turnserver.private.conf.tpl +46 -0
  56. package/templates/etc/{turnserver.conf.tpl → turnserver.public.conf.tpl} +3 -3
  57. package/templates/index.js +3 -2
  58. package/templates/utils.js +22 -99
  59. package/templates/var/lib/bind/domain.tpl +70 -0
  60. package/templates/var/lib/bind/private-reverse.tpl +1 -1
  61. package/templates/var/lib/bind/{prvate.tpl → private.tpl} +1 -10
  62. package/templates/var/lib/bind/public-reverse.tpl +7 -7
  63. package/templates/var/lib/bind/public.tpl +7 -7
  64. package/bin/init-private +0 -40
  65. package/bin/set-jitsi-conf +0 -14
  66. package/template.js +0 -453
  67. package/templates/etc/bind/named.conf.private +0 -21
  68. package/templates/etc/bind/named.conf.public +0 -21
  69. package/templates/etc/drumee/conf.d/conference.json.tpl +0 -9
  70. package/templates/etc/drumee/dnsapi.sh.tpl +0 -28
  71. package/templates/etc/drumee/env.json +0 -29
  72. package/templates/etc/jitsi/jicofo/sip-cmmunicator.properties +0 -3
  73. package/templates/etc/nginx/sites-enabled/public.jitsi.conf.tpl +0 -28
  74. package/templates/etc/prosody/conf.d/vhost.cfg.lua.tpl +0 -162
  75. package/thidima.sh +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drumee/setup-infra",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
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.31",
20
+ "@drumee/server-essentials": "^1.1.26",
21
21
  "argparse": "^2.0.1",
22
22
  "crypto": "^1.0.1",
23
23
  "jsonfile": "^5.0.0",
@@ -0,0 +1,39 @@
1
+ //
2
+ // Configs setup by Drumee setup-infra utility
3
+ //
4
+
5
+ include "/etc/bind/named.conf.log";
6
+ include "<%= nsupdate_key %>";
7
+ <% if (typeof(public_domain) !== "undefined" && public_domain != "" ) { %>
8
+ zone "<%= public_domain %>" {
9
+ type master;
10
+ file "/var/lib/bind/<%= public_domain %>";
11
+ allow-query { any; };
12
+ allow-update { key "update"; };
13
+ allow-transfer { <%= public_ip4 %>; };
14
+ };
15
+ <% } %>
16
+ <% if (typeof(reverse_public_ip4) !== "undefined" && reverse_public_ip4 != "" ) { %>
17
+ zone "<%= reverse_public_ip4 %>.in-addr.arpa" {
18
+ type master;
19
+ file "/var/lib/bind/<%= reverse_public_ip4 %>";
20
+ allow-query { any; };
21
+ };
22
+ <% } %>
23
+
24
+ <% if (typeof(private_domain) !== "undefined" && private_domain != "" ) { %>
25
+ zone "<%= private_domain %>" {
26
+ type master;
27
+ file "/var/lib/bind/<%= private_domain %>";
28
+ allow-query { any; };
29
+ allow-update { key "update"; };
30
+ allow-transfer { <%= private_ip4 %>; };
31
+ };
32
+ <% } %>
33
+ <% if (typeof(reverse_private_ip4) !== "undefined" && reverse_private_ip4 != "" ) { %>
34
+ zone "<%= reverse_private_ip4 %>.in-addr.arpa" {
35
+ type master;
36
+ file "/var/lib/bind/<%= private_ip4 %>";
37
+ allow-query { any; };
38
+ };
39
+ <% } %>
@@ -14,20 +14,29 @@ options {
14
14
  // If BIND logs error messages about the root key being expired,
15
15
  // you will need to update your keys. See https://www.isc.org/bind-keys
16
16
  //============================================================
17
- dnssec-validation auto;
18
-
19
- listen-on-v6 { any; };
20
17
 
21
18
  // hide version number from clients for security reasons.
22
19
  version "not currently available";
23
20
 
24
21
  // allow recursion for trusted clients only.
25
- recursion yes;
26
22
  allow-query { <%= allow_recursion %> };
27
23
 
24
+ recursion yes;
25
+ allow-recursion { ::/0; 0.0.0.0/0; };
26
+
28
27
  // enable the query log
29
28
  querylog yes;
30
29
 
31
30
  // disallow zone transfer
32
31
  allow-transfer { none; };
32
+
33
+ forwarders {
34
+ 8.8.8.8;
35
+ 8.8.4.4;
36
+ };
37
+
38
+ dnssec-validation no;
39
+ auth-nxdomain no; # conform to RFC1035
40
+ listen-on-v6 { any; };
41
+
33
42
  };
@@ -0,0 +1,55 @@
1
+ # Configuration file for /sbin/dhclient.
2
+ #
3
+ # This is a sample configuration file for dhclient. See dhclient.conf's
4
+ # man page for more information about the syntax of this file
5
+ # and a more comprehensive list of the parameters understood by
6
+ # dhclient.
7
+ #
8
+ # Normally, if the DHCP server provides reasonable information and does
9
+ # not leave anything out (like the domain name, for example), then
10
+ # few changes must be made to this file, if any.
11
+ #
12
+
13
+ option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
14
+
15
+ send host-name = gethostname();
16
+ request subnet-mask, broadcast-address, time-offset, routers,
17
+ domain-name, domain-name-servers, domain-search, host-name,
18
+ dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
19
+ netbios-name-servers, netbios-scope, interface-mtu,
20
+ rfc3442-classless-static-routes, ntp-servers;
21
+
22
+ #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
23
+ #send dhcp-lease-time 3600;
24
+ #supersede domain-name "fugue.com home.vix.com";
25
+ prepend domain-name-servers <%= private_ip4 %>;
26
+ #require subnet-mask, domain-name-servers;
27
+ #timeout 60;
28
+ #retry 60;
29
+ #reboot 10;
30
+ #select-timeout 5;
31
+ #initial-interval 2;
32
+ #script "/sbin/dhclient-script";
33
+ #media "-link0 -link1 -link2", "link0 link1";
34
+ #reject 192.33.137.209;
35
+
36
+
37
+ #alias {
38
+ # interface "eth0";
39
+ # fixed-address 192.168.0.195;
40
+ # option subnet-mask 255.255.255.0;
41
+ #}
42
+
43
+ lease {
44
+ interface "<%= private_if4 %>";
45
+ fixed-address <%= private_ip4 %>;
46
+ # medium "link0 link1";
47
+ # option host-name "andare.swiftmedia.com";
48
+ option subnet-mask <%= private_subnet_mask %>;
49
+ option broadcast-address <%= private_broadcast_address %>;
50
+ # option routers 192.33.137.250;
51
+ # option domain-name-servers 127.0.0.1;
52
+ # renew 2 2000/1/12 00:00:01;
53
+ # rebind 2 2000/1/12 00:00:01;
54
+ # expire 2 2000/1/12 00:00:01;
55
+ }
@@ -0,0 +1,13 @@
1
+ [ req ]
2
+ default_bits = 2048
3
+ prompt = no
4
+ default_md = sha256
5
+ distinguished_name = dn
6
+
7
+ [ dn ]
8
+ C = XX
9
+ ST = YourState
10
+ L = YourCity
11
+ O = Drumee Web OO
12
+ OU = Drumee Conferennce Services
13
+ CN = *.<%= jitsi_private_domain %>
@@ -0,0 +1,13 @@
1
+ [ req ]
2
+ default_bits = 2048
3
+ prompt = no
4
+ default_md = sha256
5
+ distinguished_name = dn
6
+
7
+ [ dn ]
8
+ C = XX
9
+ ST = YourState
10
+ L = YourCity
11
+ O = Drumee Web OS
12
+ OU = Drumee API services
13
+ CN = *.<%= private_domain %>
@@ -0,0 +1,9 @@
1
+ {
2
+ "domain": "<%= jitsi_private_domain %>",
3
+ "hosts": {
4
+ "domain": "<%= jitsi_private_domain %>",
5
+ "muc": "conference.<%= jitsi_private_domain %>"
6
+ },
7
+ "bosh": "https://<%= jitsi_private_domain %>/http-bind",
8
+ "auth": ["<%= app_id %>", "<%= app_password %>"]
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "domain": "<%= jitsi_public_domain %>",
3
+ "hosts": {
4
+ "domain": "<%= jitsi_public_domain %>",
5
+ "muc": "conference.<%= jitsi_public_domain %>"
6
+ },
7
+ "bosh": "https://<%= jitsi_public_domain %>/http-bind",
8
+ "auth": ["<%= app_id %>", "<%= app_password %>"]
9
+ }
@@ -8,7 +8,8 @@
8
8
  "ru",
9
9
  "zh"
10
10
  ],
11
- "verbosity": 2,
11
+ "verbosity": <%= logLevel %>,
12
+ "logLevel": <%= logLevel %>,
12
13
  "useEmail":<%= use_email %>,
13
14
  "quota": {
14
15
  "watermark": "<%= quota_watermark %>"
@@ -5,6 +5,9 @@
5
5
  # -------------------------------------------------------------
6
6
 
7
7
  export CERTS_DIR=<%= certs_dir %>
8
+ if [ -d "$OWN_CERTS_DIR" ]; then
9
+ export ACME_DIR="$OWN_CERTS_DIR"
10
+ fi
8
11
 
9
12
  <% if (typeof(public_domain) !== "undefined" && public_domain != "" ) { %>
10
13
  export ACME_CA_SERVER=<%= ca_server %>
@@ -13,11 +16,25 @@ export ACME_EMAIL_ACCOUNT=<%= acme_email_account %>
13
16
  export ACME_STORE=<%= certs_dir %>/<%= public_domain %>_ecc
14
17
  export NSUPDATE_SERVER=ns1.<%= public_domain %>
15
18
  export NSUPDATE_ZONE=<%= public_domain %>
16
- export DRUMEE_PUBLIC_DOMAIN=<%= public_domain %>
19
+ export PUBLIC_DOMAIN=<%= public_domain %>
20
+ export DRUMEE_DOMAIN_NAME=<%= public_domain %>
17
21
  <% } %>
18
22
 
19
- <% if (typeof(jitsi_domain) !== "undefined" && jitsi_domain != "" ) { %>
20
- export JITSI_DOMAIN=<%= jitsi_domain %>
23
+ <% if (typeof(private_domain) !== "undefined" && private_domain != "" ) { %>
24
+ export ACME_STORE=<%= certs_dir %>/<%= private_domain %>_ecc
25
+ export PRIVATE_DOMAIN=<%= private_domain %>
26
+ <% if (typeof(public_domain) === "undefined" || public_domain == "" ) { %>
27
+ export DRUMEE_DOMAIN_NAME=<%= private_domain %>
28
+ <% } %>
29
+
30
+ <% } %>
31
+
32
+ <% if (/^jit\.(.+)$/.test(jitsi_public_domain)) { %>
33
+ export JITSI_DOMAIN=<%= jitsi_public_domain %>
34
+ #jitsi_public_domain |<%= jitsi_public_domain %>|<%= typeof(jitsi_public_domain) %>|
35
+ <% } else if (/^jit\.(.+)$/.test(jitsi_private_domain)) { %>
36
+ #jitsi_private_domain
37
+ export JITSI_DOMAIN=<%= jitsi_private_domain %>
21
38
  <% } %>
22
39
 
23
40
  export APP_ROUTING_MARK=<%= public_ui_root %>
@@ -26,25 +43,23 @@ export NSUPDATE_KEY=<%= nsupdate_key %>
26
43
  export DRUMEE_DB_DIR=<%= db_dir %>
27
44
  export DRUMEE_CACHE_DIR=<%= cache_dir %>
28
45
  export DRUMEE_DATA_DIR=<%= data_dir %>
29
- export DRUMEE_TMP_DIR=$DRUMEE_DATA_DIR/tmp
30
- export DRUMEE_MFS_DIR=$DRUMEE_DATA_DIR/mfs
31
46
  export DRUMEE_EXPORT_DIR=<%= export_dir %>
32
47
  export DRUMEE_IMPORT_DIR=<%= import_dir %>
33
48
  export DRUMEE_LOG_DIR=<%= log_dir %>
34
- export DRUMEE_ROOT=<%= drumee_root %>
35
- export DRUMEE_RUNTIME_DIR=$DRUMEE_ROOT/runtime
36
- export DRUMEE_STATIC_DIR=$DRUMEE_ROOT/static
37
- export DRUMEE_UI_HOME=$DRUMEE_RUNTIME_DIR/ui
38
- export DRUMEE_SERVER_HOME=$DRUMEE_RUNTIME_DIR/server
39
- export DRUMEE_SCHEMAS_DIR=$DRUMEE_SERVER_HOME/schemas
40
- export DRUMEE_SERVER_NODE=$DRUMEE_SERVER_HOME/node_modules
49
+ export DRUMEE_MFS_DIR=<%= data_dir %>/mfs
50
+ export DRUMEE_ROOT='/srv/drumee'
51
+ export DRUMEE_RUNTIME_DIR=<%= runtime_dir %>
52
+ export DRUMEE_SCHEMAS_DIR=<%= runtime_dir %>/server/schemas
53
+ export DRUMEE_SERVER_HOME=<%= server_dir %>
54
+ export DRUMEE_SERVER_MAIN=<%= server_location %>
55
+ export DRUMEE_SERVER_NODE=<%= server_location %>/node_modules
56
+ export DRUMEE_STATIC_DIR=<%= static_dir %>
41
57
  export DRUMEE_SYSTEM_GROUP=<%= system_group %>
42
58
  export DRUMEE_SYSTEM_USER=<%= system_user %>
59
+ export DRUMEE_TMP_DIR=<%= data_dir %>/tmp
60
+ export DRUMEE_UI_HOME=<%= runtime_dir %>/ui
43
61
  export DRUMEE_BACKUP_STORAGE=<%= backup_storage %>
44
62
  export DRUMEE_DB_BACKUP=<%= backup_storage %>/db
45
- export OWN_CERTS_DIR=<%= own_certs_dir %>
46
63
  export PUBLIC_UI_ROOT=<%= public_ui_root %>
47
-
48
- if [ -d "$OWN_CERTS_DIR" ]; then
49
- export ACME_DIR="$OWN_CERTS_DIR"
50
- fi
64
+ export PUBLIC_HTTP_PORT=<%= public_http_port %>
65
+ export PUBLIC_HTTPS_PORT=<%= public_https_port %>
@@ -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 <%= private_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
+ }
@@ -9,7 +9,7 @@ location /mfs/ {
9
9
  internal;
10
10
  add_header Cache-Control max-age=31536000;
11
11
  add_header Content-Encoding $upstream_http_content_encoding;
12
- add_header Access-Control-Allow-Origin <%= domain %>;
12
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
13
13
  alias <%= data_dir %>/mfs/;
14
14
  }
15
15
 
@@ -5,12 +5,12 @@
5
5
  # -------------------------------------------------------------
6
6
 
7
7
  location / {
8
- location ~ (.+)\.(.+)$ {
9
- #expires 7d;
8
+ index /-/;
9
+
10
+ location ~ (.+)$ {
10
11
  add_header Cache-Control max-age=31536000;
11
- #add_header Vary "Accept-Encoding";
12
12
  fastcgi_hide_header Set-Cookie;
13
- add_header Access-Control-Allow-Origin <%= domain %>;
14
- rewrite /(.+)$ <%= public_ui_root %>/service/?service=media.raw&p=$1&d=inline;
13
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
14
+ rewrite /(.+)$ <%= public_ui_root %>/svc/media.raw?p=/$1&d=inline;
15
15
  }
16
16
  }
@@ -10,7 +10,7 @@ location / {
10
10
  location ~ (.+)$ {
11
11
  add_header Cache-Control max-age=31536000;
12
12
  fastcgi_hide_header Set-Cookie;
13
- add_header Access-Control-Allow-Origin <%= domain %>;
13
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
14
14
  rewrite /(.+)$ <%= public_ui_root %>/svc/media.raw?p=/$1&d=inline;
15
15
  }
16
16
  }
@@ -0,0 +1,143 @@
1
+ # -------------------------------------------------------------
2
+ # ! DO NOT EDIT !
3
+ # Config file automatically generated by <setup-infra>
4
+ # Date : <%= date %>
5
+ # -------------------------------------------------------------
6
+
7
+
8
+ location <%= location %>app/ {
9
+ alias <%= ui_location %>/app/;
10
+ add_header Cache-Control max-age=31536000;
11
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
12
+ fastcgi_hide_header Set-Cookie;
13
+ break;
14
+ }
15
+
16
+ # Frontend application assets
17
+ location <%= location %>api/ {
18
+ alias <%= ui_location %>/api/;
19
+ add_header Cache-Control max-age=31536000;
20
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
21
+ fastcgi_hide_header Set-Cookie;
22
+ break;
23
+ }
24
+
25
+ # Frontend application assets
26
+ location <%= location %>plugins/ {
27
+ alias <%= ui_location %>/plugins/;
28
+ add_header Cache-Control max-age=31536000;
29
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
30
+ fastcgi_hide_header Set-Cookie;
31
+ break;
32
+ }
33
+
34
+
35
+ # Frontend application templates
36
+ location <%= location %>bb-templates/ {
37
+ alias <%= ui_location %>/bb-templates/;
38
+ add_header Cache-Control max-age=31536000;
39
+ add_header Access-Control-Allow-Origin *;
40
+ fastcgi_hide_header Set-Cookie;
41
+ break;
42
+ }
43
+
44
+
45
+ location <%= location %> {
46
+ fastcgi_hide_header Set-Cookie;
47
+ add_header Cache-Control max-age=31536000;
48
+
49
+ location ~ /(svc|vdo|service)/ {
50
+ proxy_pass http://127.0.0.1:<%= restPort %>;
51
+ proxy_http_version 1.1;
52
+ proxy_set_header Upgrade $http_upgrade;
53
+ proxy_set_header Connection 'upgrade';
54
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
55
+ proxy_set_header X-Real-IP $remote_addr;
56
+ proxy_set_header X-Connecting-IP $remote_addr;
57
+ proxy_set_header Host $host;
58
+ add_header Vary "Accept-Encoding";
59
+ fastcgi_hide_header Set-Cookie;
60
+ break;
61
+ }
62
+
63
+ location ~ /(ws|websocket)/ {
64
+ proxy_pass http://127.0.0.1:<%= pushPort %>;
65
+ proxy_http_version 1.1;
66
+ proxy_set_header Upgrade $http_upgrade;
67
+ proxy_set_header Connection 'upgrade';
68
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
69
+ proxy_set_header X-Real-IP $remote_addr;
70
+ proxy_set_header X-Connecting-IP $remote_addr;
71
+ proxy_set_header Host $host;
72
+ add_header Vary "Accept-Encoding";
73
+ fastcgi_hide_header Set-Cookie;
74
+ break;
75
+ }
76
+
77
+ #------------ parts/apis ------------
78
+ location ~ /file/(.+)/(.*)$ {
79
+ fastcgi_hide_header Set-Cookie;
80
+ rewrite /file/(.+)/(.+)/(.+)\.(.*)$ /-/svc/media.$1?nid=$2&hub_id=$3 last;
81
+ rewrite /file/(.+)/(.+)/(.+)/(.*)$ /-/svc/media.$1?nid=$2&hub_id=$3 last;
82
+ rewrite /file/(.+)/(.+)/(.+)$ /-/svc/media.$1?nid=$2&hub_id=$3 last;
83
+ rewrite /file/(.+)/(.+)\.(.+)$ /-/svc/media.$1?nid=$2 last;
84
+ rewrite /file/(.+)/(.+)$ /-/svc/media.$1?nid=$2 last;
85
+ break;
86
+ }
87
+
88
+
89
+ location ~ /doc/(.+)/(.*)$ {
90
+ add_header Cache-Control max-age=31536000;
91
+ fastcgi_hide_header Set-Cookie;
92
+ rewrite /doc/(.+)/(.+)/(.+)\.(.*)$ /-/svc/media.read?page=$1&nid=$2&hub_id=$3 last;
93
+ rewrite /doc/(.+)/(.+)/(.+)$ /-/svc/media.read?page=$1&nid=$2&hub_id=$3 last;
94
+ rewrite /doc/(.+)/(.+)\.(.+)$ /-/svc/media.read?page=$1&nid=$2 last;
95
+ rewrite /doc/(.+)/(.+)$ /-/svc/media.read?page=$1&nid=$2 last;
96
+ break;
97
+ }
98
+
99
+ location ~ /letc/(.+)$ {
100
+ add_header Cache-Control max-age=31536000;
101
+ fastcgi_hide_header Set-Cookie;
102
+ rewrite /letc/(.+)\@(.+)$ /-/svc/block.content?hashtag=$1&owner=$2 last;
103
+ rewrite /letc/(.+)/(.+)$ /-/svc/block.content?hashtag=$1&owner=$2 last;
104
+ rewrite /letc/(.+)$ /-/svc/block.content?hashtag=$1 last;
105
+ break;
106
+ }
107
+
108
+
109
+ location ~ /avatar/(.+)$ {
110
+ add_header Pragma public;
111
+ add_header Cache-Control max-age=31536000;
112
+ fastcgi_hide_header Set-Cookie;
113
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
114
+ rewrite /avatar/(.+)$ /-/svc/yp.avatar?id=$1 last;
115
+ break;
116
+ }
117
+
118
+ location ~ (.+)\.(.+)$ {
119
+ fastcgi_hide_header Set-Cookie;
120
+ add_header Cache-Control max-age=31536000;
121
+ add_header Access-Control-Allow-Origin <%= private_domain %>;
122
+ rewrite /somanos/(.+)$ /-/svc/media.raw&p=$1&d=inline;
123
+ break;
124
+ }
125
+
126
+
127
+ #------------ parts/index ------------
128
+ location ~ (/|)$ {
129
+ proxy_pass http://127.0.0.1:<%= pushPort %>;
130
+ proxy_http_version 1.1;
131
+ proxy_set_header Upgrade $http_upgrade;
132
+ proxy_set_header Connection 'upgrade';
133
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
134
+ proxy_set_header X-Real-IP $remote_addr;
135
+ proxy_set_header X-Connecting-IP $remote_addr;
136
+ proxy_set_header Host $host;
137
+ proxy_set_header Referer $http_referer;
138
+ add_header Access-Control-Allow-Credentials true;
139
+ add_header Vary "Accept-Encoding";
140
+ fastcgi_hide_header Set-Cookie;
141
+ }
142
+
143
+ }
@@ -6,28 +6,27 @@
6
6
 
7
7
 
8
8
  location <%= location %>app/ {
9
- alias <%= drumee_root %>/runtime/ui/<%= endpoint_name %>/app/;
9
+ alias <%= ui_location %>/app/;
10
10
  add_header Cache-Control max-age=31536000;
11
- add_header Access-Control-Allow-Origin <%= domain %>;
11
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
12
12
  fastcgi_hide_header Set-Cookie;
13
13
  break;
14
14
  }
15
15
 
16
16
  # Frontend application assets
17
17
  location <%= location %>api/ {
18
- alias <%= drumee_root %>/runtime/ui/<%= endpoint_name %>/api/;
18
+ alias <%= ui_location %>/api/;
19
19
  add_header Cache-Control max-age=31536000;
20
- add_header Access-Control-Allow-Origin <%= domain %>;
20
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
21
21
  fastcgi_hide_header Set-Cookie;
22
22
  break;
23
23
  }
24
24
 
25
25
  # Frontend application assets
26
- location
27
- plugins/ {
28
- alias <%= drumee_root %>/runtime/ui/<%= endpoint_name %>/plugins/;
26
+ location <%= location %>plugins/ {
27
+ alias <%= ui_location %>/plugins/;
29
28
  add_header Cache-Control max-age=31536000;
30
- add_header Access-Control-Allow-Origin <%= domain %>;
29
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
31
30
  fastcgi_hide_header Set-Cookie;
32
31
  break;
33
32
  }
@@ -35,7 +34,7 @@ plugins/ {
35
34
 
36
35
  # Frontend application templates
37
36
  location <%= location %>bb-templates/ {
38
- alias <%= drumee_root %>/runtime/ui/<%= endpoint_name %>/bb-templates/;
37
+ alias <%= ui_location %>/bb-templates/;
39
38
  add_header Cache-Control max-age=31536000;
40
39
  add_header Access-Control-Allow-Origin *;
41
40
  fastcgi_hide_header Set-Cookie;
@@ -53,12 +52,9 @@ location <%= location %> {
53
52
  proxy_set_header Upgrade $http_upgrade;
54
53
  proxy_set_header Connection 'upgrade';
55
54
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
56
- proxy_set_header X-Real-IP $remote_addr;
55
+ proxy_set_header X-Real-IP $remote_addr;
57
56
  proxy_set_header X-Connecting-IP $remote_addr;
58
- proxy_set_header X-Forwarded-Proto $scheme;
59
- proxy_set_header Host $host;
60
- proxy_set_header X-Forwarded-Port $server_port; # The port Nginx is listening on
61
- proxy_set_header X-Original-Port $http_host;
57
+ proxy_set_header Host $host;
62
58
  add_header Vary "Accept-Encoding";
63
59
  fastcgi_hide_header Set-Cookie;
64
60
  break;
@@ -70,12 +66,9 @@ location <%= location %> {
70
66
  proxy_set_header Upgrade $http_upgrade;
71
67
  proxy_set_header Connection 'upgrade';
72
68
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
73
- proxy_set_header X-Real-IP $remote_addr;
69
+ proxy_set_header X-Real-IP $remote_addr;
74
70
  proxy_set_header X-Connecting-IP $remote_addr;
75
- proxy_set_header X-Forwarded-Proto $scheme;
76
- proxy_set_header Host $host;
77
- proxy_set_header X-Forwarded-Port $server_port; # The port Nginx is listening on
78
- proxy_set_header X-Original-Port $http_host;
71
+ proxy_set_header Host $host;
79
72
  add_header Vary "Accept-Encoding";
80
73
  fastcgi_hide_header Set-Cookie;
81
74
  break;
@@ -117,7 +110,7 @@ location <%= location %> {
117
110
  add_header Pragma public;
118
111
  add_header Cache-Control max-age=31536000;
119
112
  fastcgi_hide_header Set-Cookie;
120
- add_header Access-Control-Allow-Origin <%= domain %>;
113
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
121
114
  rewrite /avatar/(.+)$ /-/svc/yp.avatar?id=$1 last;
122
115
  break;
123
116
  }
@@ -125,8 +118,8 @@ location <%= location %> {
125
118
  location ~ (.+)\.(.+)$ {
126
119
  fastcgi_hide_header Set-Cookie;
127
120
  add_header Cache-Control max-age=31536000;
128
- add_header Access-Control-Allow-Origin <%= domain %>;
129
- rewrite /<%= endpoint_name %>/(.+)$ /-/svc/media.raw&p=$1&d=inline;
121
+ add_header Access-Control-Allow-Origin <%= public_domain %>;
122
+ rewrite /somanos/(.+)$ /-/svc/media.raw&p=$1&d=inline;
130
123
  break;
131
124
  }
132
125
 
@@ -138,13 +131,10 @@ location <%= location %> {
138
131
  proxy_set_header Upgrade $http_upgrade;
139
132
  proxy_set_header Connection 'upgrade';
140
133
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
141
- proxy_set_header X-Real-IP $remote_addr;
134
+ proxy_set_header X-Real-IP $remote_addr;
142
135
  proxy_set_header X-Connecting-IP $remote_addr;
143
- proxy_set_header Host $host;
144
- proxy_set_header X-Forwarded-Port $server_port; # The port Nginx is listening on
145
- proxy_set_header X-Original-Port $http_host;
146
- proxy_set_header Referer $http_referer;
147
- proxy_set_header X-Forwarded-Proto $scheme;
136
+ proxy_set_header Host $host;
137
+ proxy_set_header Referer $http_referer;
148
138
  add_header Access-Control-Allow-Credentials true;
149
139
  add_header Vary "Accept-Encoding";
150
140
  fastcgi_hide_header Set-Cookie;