@drumee/setup-infra 1.0.0

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 (97) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +3 -0
  3. package/configs/etc/cron.d/drumee +6 -0
  4. package/configs/etc/postfix/master.cf +137 -0
  5. package/congigure/init/acme +69 -0
  6. package/congigure/init/mail +16 -0
  7. package/congigure/init/named +27 -0
  8. package/congigure/menu/menu -tmp +144 -0
  9. package/congigure/menu/menu-install +147 -0
  10. package/congigure/menu/menu-reinstall +15 -0
  11. package/congigure/prepare +10 -0
  12. package/congigure/preset/jitsi +9 -0
  13. package/congigure/setup-infra +58 -0
  14. package/congigure/setup-schemas +57 -0
  15. package/congigure/start +29 -0
  16. package/congigure/utils/configure +56 -0
  17. package/congigure/utils/dependencies +90 -0
  18. package/congigure/utils/jitsi +122 -0
  19. package/congigure/utils/misc +77 -0
  20. package/congigure/utils/prompt.sh +35 -0
  21. package/congigure/utils/setup-versions +7 -0
  22. package/index.js +572 -0
  23. package/package.json +30 -0
  24. package/template.js +453 -0
  25. package/templates/env/application.json.tpl +0 -0
  26. package/templates/env/logrotate.tpl +7 -0
  27. package/templates/etc/bind/named.conf.local +13 -0
  28. package/templates/etc/bind/named.conf.log +105 -0
  29. package/templates/etc/bind/named.conf.options +33 -0
  30. package/templates/etc/dkimkeys/dkim.key +1 -0
  31. package/templates/etc/drumee/conf.d/conference.json.tpl +9 -0
  32. package/templates/etc/drumee/conf.d/drumee.json.tpl +7 -0
  33. package/templates/etc/drumee/conf.d/exchange.json.tpl +4 -0
  34. package/templates/etc/drumee/conf.d/myDrumee.json.tpl +16 -0
  35. package/templates/etc/drumee/credential/db.json.tpl +6 -0
  36. package/templates/etc/drumee/credential/email.json.tpl +12 -0
  37. package/templates/etc/drumee/credential/ovh/dns.json.tpl +6 -0
  38. package/templates/etc/drumee/credential/ovh/dns.sh.tpl +7 -0
  39. package/templates/etc/drumee/credential/redis.json.tpl +6 -0
  40. package/templates/etc/drumee/credential/sms.json.tpl +6 -0
  41. package/templates/etc/drumee/dnsapi.sh.tpl +28 -0
  42. package/templates/etc/drumee/drumee.sh.tpl +43 -0
  43. package/templates/etc/drumee/env.json +29 -0
  44. package/templates/etc/drumee/infrastructure/internals/accel.conf.tpl +47 -0
  45. package/templates/etc/drumee/infrastructure/mfs.conf.tpl +16 -0
  46. package/templates/etc/drumee/infrastructure/platform.json.tpl +16 -0
  47. package/templates/etc/drumee/infrastructure/routes/main.conf.tpl +143 -0
  48. package/templates/etc/drumee/infrastructure/servers/tt.conf +199 -0
  49. package/templates/etc/drumee/ssl/main.conf.tpl +10 -0
  50. package/templates/etc/jitsi/jicofo/config +2 -0
  51. package/templates/etc/jitsi/jicofo/defaults/jicofo.conf +225 -0
  52. package/templates/etc/jitsi/jicofo/defaults/logging.properties +15 -0
  53. package/templates/etc/jitsi/jicofo/jicofo.conf.tpl +46 -0
  54. package/templates/etc/jitsi/jicofo/logging.properties.tpl +12 -0
  55. package/templates/etc/jitsi/meet.conf.tpl +131 -0
  56. package/templates/etc/jitsi/ssl.conf.tpl +25 -0
  57. package/templates/etc/jitsi/videobridge/config +2 -0
  58. package/templates/etc/jitsi/videobridge/defaults/jvb.conf +129 -0
  59. package/templates/etc/jitsi/videobridge/defaults/logging.properties +12 -0
  60. package/templates/etc/jitsi/videobridge/jvb.conf +67 -0
  61. package/templates/etc/jitsi/videobridge/logging.properties.tpl +12 -0
  62. package/templates/etc/jitsi/web/config.js.tpl +208 -0
  63. package/templates/etc/jitsi/web/defaults/default +26 -0
  64. package/templates/etc/jitsi/web/defaults/ffdhe2048.txt +8 -0
  65. package/templates/etc/jitsi/web/defaults/interface_config.js +273 -0
  66. package/templates/etc/jitsi/web/defaults/meet.conf +193 -0
  67. package/templates/etc/jitsi/web/defaults/nginx.conf +73 -0
  68. package/templates/etc/jitsi/web/defaults/settings-config.js +480 -0
  69. package/templates/etc/jitsi/web/defaults/ssl.conf +28 -0
  70. package/templates/etc/jitsi/web/defaults/system-config.js +60 -0
  71. package/templates/etc/jitsi/web/interface_config.js +273 -0
  72. package/templates/etc/mail/dkim.key +1 -0
  73. package/templates/etc/mailname +1 -0
  74. package/templates/etc/mysql/mariadb.conf.d/50-server.cnf +120 -0
  75. package/templates/etc/nginx/modules-enabled/90-turn-relay.conf +27 -0
  76. package/templates/etc/nginx/modules-enabled/90-turn-relay.conf.tpl +27 -0
  77. package/templates/etc/nginx/nginx.conf +65 -0
  78. package/templates/etc/nginx/sites-enabled/drumee.conf.tpl +33 -0
  79. package/templates/etc/nginx/sites-enabled/jitsi.conf.tpl +28 -0
  80. package/templates/etc/nginx/sites-enabled/turnrelay.conf.tpl +9 -0
  81. package/templates/etc/opendkim/KeyTable +1 -0
  82. package/templates/etc/postfix/main.cf +76 -0
  83. package/templates/etc/postfix/mysql-virtual-alias-maps.cf +5 -0
  84. package/templates/etc/postfix/mysql-virtual-mailbox-domains.cf +5 -0
  85. package/templates/etc/postfix/mysql-virtual-mailbox-maps.cf +5 -0
  86. package/templates/etc/prosody/conf.d/vhost.cfg.lua.tpl +162 -0
  87. package/templates/etc/prosody/defaults/conf.d/jitsi-meet.cfg.lua +406 -0
  88. package/templates/etc/prosody/defaults/credentials.sh +10 -0
  89. package/templates/etc/prosody/defaults/prosody.cfg.lua +225 -0
  90. package/templates/etc/prosody/defaults/saslauthd.conf +30 -0
  91. package/templates/etc/prosody/prosody.cfg.lua.tpl +203 -0
  92. package/templates/etc/turnserver.conf.tpl +46 -0
  93. package/templates/index.js +102 -0
  94. package/templates/schema/utils/configs.init.sql.tpl +20 -0
  95. package/templates/schema/utils/configs.update.sql.tpl +19 -0
  96. package/templates/server/ecosystem.config.js.tpl +8 -0
  97. package/templates/var/lib/bind/domain.tpl +70 -0
@@ -0,0 +1,225 @@
1
+ {{ $LOG_LEVEL := .Env.LOG_LEVEL | default "info" }}
2
+ {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
3
+ {{ $ENABLE_IPV6 := .Env.ENABLE_IPV6 | default "true" | toBool -}}
4
+ {{ $GC_TYPE := .Env.GC_TYPE | default "incremental" -}}
5
+ {{ $GC_INC_TH := .Env.GC_INC_TH | default 150 -}}
6
+ {{ $GC_INC_SPEED := .Env.GC_INC_SPEED | default 250 -}}
7
+ {{ $GC_INC_STEP_SIZE := .Env.GC_INC_STEP_SIZE | default 13 -}}
8
+ {{ $GC_GEN_MIN_TH := .Env.GC_GEN_MIN_TH | default 20 -}}
9
+ {{ $GC_GEN_MAX_TH := .Env.GC_GEN_MAX_TH | default 100 -}}
10
+
11
+ -- Prosody Example Configuration File
12
+ --
13
+ -- Information on configuring Prosody can be found on our
14
+ -- website at http://prosody.im/doc/configure
15
+ --
16
+ -- Tip: You can check that the syntax of this file is correct
17
+ -- when you have finished by running: luac -p prosody.cfg.lua
18
+ -- If there are any errors, it will let you know what and where
19
+ -- they are, otherwise it will keep quiet.
20
+ --
21
+ -- The only thing left to do is rename this file to remove the .dist ending, and fill in the
22
+ -- blanks. Good luck, and happy Jabbering!
23
+
24
+
25
+ ---------- Server-wide settings ----------
26
+ -- Settings in this section apply to the whole server and are the default settings
27
+ -- for any virtual hosts
28
+
29
+ -- This is a (by default, empty) list of accounts that are admins
30
+ -- for the server. Note that you must create the accounts separately
31
+ -- (see http://prosody.im/doc/creating_accounts for info)
32
+ -- Example: admins = { "user1@example.com", "user2@example.net" }
33
+ admins = { }
34
+
35
+ -- Enable use of libevent for better performance under high load
36
+ -- For more information see: http://prosody.im/doc/libevent
37
+ --use_libevent = true;
38
+
39
+ -- This is the list of modules Prosody will load on startup.
40
+ -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
41
+ -- Documentation on modules can be found at: http://prosody.im/doc/modules
42
+ modules_enabled = {
43
+
44
+ -- Generally required
45
+ "roster"; -- Allow users to have a roster. Recommended ;)
46
+ "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
47
+ "tls"; -- Add support for secure TLS on c2s/s2s connections
48
+ "dialback"; -- s2s dialback support
49
+ "disco"; -- Service discovery
50
+
51
+ -- Not essential, but recommended
52
+ "private"; -- Private XML storage (for room bookmarks, etc.)
53
+ "vcard"; -- Allow users to set vCards
54
+ "limits"; -- Enable bandwidth limiting for XMPP connections
55
+
56
+ -- These are commented by default as they have a performance impact
57
+ --"privacy"; -- Support privacy lists
58
+ --"compression"; -- Stream compression (Debian: requires lua-zlib module to work)
59
+
60
+ -- Nice to have
61
+ "version"; -- Replies to server version requests
62
+ "uptime"; -- Report how long server has been running
63
+ "time"; -- Let others know the time here on this server
64
+ "ping"; -- Replies to XMPP pings with pongs
65
+ "pep"; -- Enables users to publish their mood, activity, playing music and more
66
+ "register"; -- Allow users to register on this server using a client and change passwords
67
+
68
+ -- Admin interfaces
69
+ "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
70
+ --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
71
+
72
+ -- HTTP modules
73
+ --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
74
+ --"http_files"; -- Serve static files from a directory over HTTP
75
+
76
+ -- Other specific functionality
77
+ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
78
+ --"groups"; -- Shared roster support
79
+ --"announce"; -- Send announcement to all online users
80
+ --"welcome"; -- Welcome users who register accounts
81
+ --"watchregistrations"; -- Alert admins of registrations
82
+ --"motd"; -- Send a message to users when they log in
83
+ --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
84
+ {{ if .Env.GLOBAL_MODULES }}
85
+ "{{ join "\";\n\"" (splitList "," .Env.GLOBAL_MODULES) }}";
86
+ {{ end }}
87
+ };
88
+
89
+ component_ports = { }
90
+ https_ports = { }
91
+
92
+ -- These modules are auto-loaded, but should you want
93
+ -- to disable them then uncomment them here:
94
+ modules_disabled = {
95
+ -- "offline"; -- Store offline messages
96
+ -- "c2s"; -- Handle client connections
97
+ "s2s"; -- Handle server-to-server connections
98
+ };
99
+
100
+ -- Disable account creation by default, for security
101
+ -- For more information see http://prosody.im/doc/creating_accounts
102
+ allow_registration = false;
103
+
104
+ -- Enable rate limits for incoming client and server connections
105
+ limits = {
106
+ c2s = {
107
+ rate = "10kb/s";
108
+ };
109
+ s2sin = {
110
+ rate = "30kb/s";
111
+ };
112
+ }
113
+
114
+ --Prosody garbage collector settings
115
+ --For more information see https://prosody.im/doc/advanced_gc
116
+ {{ if eq $GC_TYPE "generational" }}
117
+ gc = {
118
+ mode = "generational";
119
+ minor_threshold = {{ $GC_GEN_MIN_TH }};
120
+ major_threshold = {{ $GC_GEN_MAX_TH }};
121
+ }
122
+ {{ else }}
123
+ gc = {
124
+ mode = "incremental";
125
+ threshold = {{ $GC_INC_TH }};
126
+ speed = {{ $GC_INC_SPEED }};
127
+ step_size = {{ $GC_INC_STEP_SIZE }};
128
+ }
129
+ {{ end }}
130
+
131
+ pidfile = "/config/data/prosody.pid";
132
+
133
+ -- Force clients to use encrypted connections? This option will
134
+ -- prevent clients from authenticating unless they are using encryption.
135
+
136
+ c2s_require_encryption = false
137
+
138
+ -- set c2s port
139
+ c2s_ports = { {{ $XMPP_PORT }} } -- Listen on specific c2s port
140
+ {{ if $ENABLE_IPV6 }}
141
+ c2s_interfaces = { "*", "::" }
142
+ {{ else }}
143
+ c2s_interfaces = { "*" }
144
+ {{ end }}
145
+
146
+ -- Force certificate authentication for server-to-server connections?
147
+ -- This provides ideal security, but requires servers you communicate
148
+ -- with to support encryption AND present valid, trusted certificates.
149
+ -- NOTE: Your version of LuaSec must support certificate verification!
150
+ -- For more information see http://prosody.im/doc/s2s#security
151
+
152
+ s2s_secure_auth = false
153
+
154
+ -- Many servers don't support encryption or have invalid or self-signed
155
+ -- certificates. You can list domains here that will not be required to
156
+ -- authenticate using certificates. They will be authenticated using DNS.
157
+
158
+ --s2s_insecure_domains = { "gmail.com" }
159
+
160
+ -- Even if you leave s2s_secure_auth disabled, you can still require valid
161
+ -- certificates for some domains by specifying a list here.
162
+
163
+ --s2s_secure_domains = { "jabber.org" }
164
+
165
+ -- Select the authentication backend to use. The 'internal' providers
166
+ -- use Prosody's configured data storage to store the authentication data.
167
+ -- To allow Prosody to offer secure authentication mechanisms to clients, the
168
+ -- default provider stores passwords in plaintext. If you do not trust your
169
+ -- server please see http://prosody.im/doc/modules/mod_auth_internal_hashed
170
+ -- for information about using the hashed backend.
171
+
172
+ authentication = "internal_hashed"
173
+
174
+ -- Select the storage backend to use. By default Prosody uses flat files
175
+ -- in its configured data directory, but it also supports more backends
176
+ -- through modules. An "sql" backend is included by default, but requires
177
+ -- additional dependencies. See http://prosody.im/doc/storage for more info.
178
+
179
+ --storage = "sql" -- Default is "internal" (Debian: "sql" requires one of the
180
+ -- lua-dbi-sqlite3, lua-dbi-mysql or lua-dbi-postgresql packages to work)
181
+
182
+ -- For the "sql" backend, you can uncomment *one* of the below to configure:
183
+ --sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
184
+ --sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
185
+ --sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
186
+
187
+ -- Logging configuration
188
+ -- For advanced logging see http://prosody.im/doc/logging
189
+ --
190
+ -- Debian:
191
+ -- Logs info and higher to /var/log
192
+ -- Logs errors to syslog also
193
+ log = {
194
+ { levels = {min = "{{ $LOG_LEVEL }}"}, timestamps = "%Y-%m-%d %X", to = "console"};
195
+ }
196
+
197
+ {{ if .Env.GLOBAL_CONFIG }}
198
+ {{ join "\n" (splitList "\\n" .Env.GLOBAL_CONFIG) }}
199
+ {{ end }}
200
+
201
+ -- Enable use of native prosody 0.11 support for epoll over select
202
+ network_backend = "epoll";
203
+ -- Set the TCP backlog to 511 since the kernel rounds it up to the next power of 2: 512.
204
+ network_settings = {
205
+ tcp_backlog = 511;
206
+ }
207
+ unbound = {
208
+ resolvconf = true
209
+ }
210
+
211
+ http_ports = { 5280 }
212
+ {{ if $ENABLE_IPV6 }}
213
+ http_interfaces = { "*", "::" }
214
+ {{ else }}
215
+ http_interfaces = { "*" }
216
+ {{ end }}
217
+
218
+ data_path = "/config/data"
219
+
220
+ smacks_max_unacked_stanzas = 5;
221
+ smacks_hibernation_time = 60;
222
+ smacks_max_hibernated_sessions = 1;
223
+ smacks_max_old_sessions = 1;
224
+
225
+ Include "conf.d/*.cfg.lua"
@@ -0,0 +1,30 @@
1
+ {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" -}}
2
+ {{ $PROSODY_AUTH_TYPE := .Env.PROSODY_AUTH_TYPE | default $AUTH_TYPE }}
3
+ {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
4
+
5
+ {{ if eq $PROSODY_AUTH_TYPE "ldap" }}
6
+ ldap_servers: {{ .Env.LDAP_URL }}
7
+ ldap_search_base: {{ .Env.LDAP_BASE }}
8
+ {{ if .Env.LDAP_BINDDN | default "" }}
9
+ ldap_bind_dn: {{ .Env.LDAP_BINDDN }}
10
+ ldap_bind_pw: {{ .Env.LDAP_BINDPW }}
11
+ {{ end }}
12
+ ldap_filter: {{ .Env.LDAP_FILTER | default "uid=%u" }}
13
+ ldap_version: {{ .Env.LDAP_VERSION | default "3" }}
14
+ ldap_auth_method: {{ .Env.LDAP_AUTH_METHOD | default "bind" }}
15
+ {{ if .Env.LDAP_USE_TLS | default "0" | toBool }}
16
+ ldap_tls_key: /config/certs/{{ $XMPP_DOMAIN }}.key
17
+ ldap_tls_cert: /config/certs/{{ $XMPP_DOMAIN }}.crt
18
+ {{ if .Env.LDAP_TLS_CHECK_PEER | default "0" | toBool }}
19
+ ldap_tls_check_peer: yes
20
+ ldap_tls_cacert_file: {{ .Env.LDAP_TLS_CACERT_FILE | default "/etc/ssl/certs/ca-certificates.crt" }}
21
+ ldap_tls_cacert_dir: {{ .Env.LDAP_TLS_CACERT_DIR | default "/etc/ssl/certs" }}
22
+ {{ end }}
23
+ {{ if .Env.LDAP_TLS_CIPHERS }}
24
+ ldap_tls_ciphers: {{ .Env.LDAP_TLS_CIPHERS }}
25
+ {{ end }}
26
+ {{ end }}
27
+ {{ end }}
28
+ {{ if .Env.LDAP_START_TLS | default "0" | toBool }}
29
+ ldap_start_tls: yes
30
+ {{ end }}
@@ -0,0 +1,203 @@
1
+ -- Prosody Example Configuration File
2
+ --
3
+ -- Information on configuring Prosody can be found on our
4
+ -- website at http://prosody.im/doc/configure
5
+ --
6
+ -- Tip: You can check that the syntax of this file is correct
7
+ -- when you have finished by running: luac -p prosody.cfg.lua
8
+ -- If there are any errors, it will let you know what and where
9
+ -- they are, otherwise it will keep quiet.
10
+ --
11
+ -- The only thing left to do is rename this file to remove the .dist ending, and fill in the
12
+ -- blanks. Good luck, and happy Jabbering!
13
+
14
+
15
+ ---------- Server-wide settings ----------
16
+ -- Settings in this section apply to the whole server and are the default settings
17
+ -- for any virtual hosts
18
+
19
+ -- This is a (by default, empty) list of accounts that are admins
20
+ -- for the server. Note that you must create the accounts separately
21
+ -- (see http://prosody.im/doc/creating_accounts for info)
22
+ -- Example: admins = { "user1@example.com", "user2@example.net" }
23
+ admins = { }
24
+
25
+ -- Enable use of libevent for better performance under high load
26
+ -- For more information see: http://prosody.im/doc/libevent
27
+ --use_libevent = true;
28
+
29
+ -- This is the list of modules Prosody will load on startup.
30
+ -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
31
+ -- Documentation on modules can be found at: http://prosody.im/doc/modules
32
+ modules_enabled = {
33
+
34
+ -- Generally required
35
+ "roster"; -- Allow users to have a roster. Recommended ;)
36
+ "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
37
+ "tls"; -- Add support for secure TLS on c2s/s2s connections
38
+ "dialback"; -- s2s dialback support
39
+ "disco"; -- Service discovery
40
+
41
+ -- Not essential, but recommended
42
+ "private"; -- Private XML storage (for room bookmarks, etc.)
43
+ "vcard"; -- Allow users to set vCards
44
+ "limits"; -- Enable bandwidth limiting for XMPP connections
45
+
46
+ -- These are commented by default as they have a performance impact
47
+ --"privacy"; -- Support privacy lists
48
+ --"compression"; -- Stream compression (Debian: requires lua-zlib module to work)
49
+
50
+ -- Nice to have
51
+ "version"; -- Replies to server version requests
52
+ "uptime"; -- Report how long server has been running
53
+ "time"; -- Let others know the time here on this server
54
+ "ping"; -- Replies to XMPP pings with pongs
55
+ "pep"; -- Enables users to publish their mood, activity, playing music and more
56
+ "register"; -- Allow users to register on this server using a client and change passwords
57
+
58
+ -- Admin interfaces
59
+ "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
60
+ --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
61
+
62
+ -- HTTP modules
63
+ --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
64
+ --"http_files"; -- Serve static files from a directory over HTTP
65
+
66
+ -- Other specific functionality
67
+ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
68
+ --"groups"; -- Shared roster support
69
+ --"announce"; -- Send announcement to all online users
70
+ --"welcome"; -- Welcome users who register accounts
71
+ --"watchregistrations"; -- Alert admins of registrations
72
+ --"motd"; -- Send a message to users when they log in
73
+ --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
74
+
75
+ };
76
+
77
+ component_ports = { }
78
+
79
+ -- These modules are auto-loaded, but should you want
80
+ -- to disable them then uncomment them here:
81
+ modules_disabled = {
82
+ -- "offline"; -- Store offline messages
83
+ -- "c2s"; -- Handle client connections
84
+ "s2s"; -- Handle server-to-server connections
85
+ };
86
+
87
+ -- Disable account creation by default, for security
88
+ -- For more information see http://prosody.im/doc/creating_accounts
89
+ allow_registration = false;
90
+
91
+ -- Enable rate limits for incoming client and server connections
92
+ limits = {
93
+ c2s = {
94
+ rate = "10kb/s";
95
+ };
96
+ s2sin = {
97
+ rate = "30kb/s";
98
+ };
99
+ }
100
+
101
+ --Prosody garbage collector settings
102
+ --For more information see https://prosody.im/doc/advanced_gc
103
+
104
+ gc = {
105
+ mode = "incremental";
106
+ threshold = 150;
107
+ speed = 250;
108
+ step_size = 13;
109
+ }
110
+
111
+
112
+ pidfile = "/var/run/prosody/prosody.pid";
113
+
114
+ -- Force clients to use encrypted connections? This option will
115
+ -- prevent clients from authenticating unless they are using encryption.
116
+
117
+ c2s_require_encryption = false
118
+
119
+ -- set c2s port
120
+ c2s_ports = { 5222 } -- Listen on specific c2s port
121
+
122
+ c2s_interfaces = { "*", "::" }
123
+
124
+
125
+ -- Force certificate authentication for server-to-server connections?
126
+ -- This provides ideal security, but requires servers you communicate
127
+ -- with to support encryption AND present valid, trusted certificates.
128
+ -- NOTE: Your version of LuaSec must support certificate verification!
129
+ -- For more information see http://prosody.im/doc/s2s#security
130
+
131
+ s2s_secure_auth = false
132
+
133
+ -- Many servers don't support encryption or have invalid or self-signed
134
+ -- certificates. You can list domains here that will not be required to
135
+ -- authenticate using certificates. They will be authenticated using DNS.
136
+
137
+ --s2s_insecure_domains = { "gmail.com" }
138
+
139
+ -- Even if you leave s2s_secure_auth disabled, you can still require valid
140
+ -- certificates for some domains by specifying a list here.
141
+
142
+ --s2s_secure_domains = { "jabber.org" }
143
+
144
+ -- Select the authentication backend to use. The 'internal' providers
145
+ -- use Prosody's configured data storage to store the authentication data.
146
+ -- To allow Prosody to offer secure authentication mechanisms to clients, the
147
+ -- default provider stores passwords in plaintext. If you do not trust your
148
+ -- server please see http://prosody.im/doc/modules/mod_auth_internal_hashed
149
+ -- for information about using the hashed backend.
150
+
151
+ authentication = "internal_hashed"
152
+
153
+ -- Select the storage backend to use. By default Prosody uses flat files
154
+ -- in its configured data directory, but it also supports more backends
155
+ -- through modules. An "sql" backend is included by default, but requires
156
+ -- additional dependencies. See http://prosody.im/doc/storage for more info.
157
+
158
+ --storage = "sql" -- Default is "internal" (Debian: "sql" requires one of the
159
+ -- lua-dbi-sqlite3, lua-dbi-mysql or lua-dbi-postgresql packages to work)
160
+
161
+ -- For the "sql" backend, you can uncomment *one* of the below to configure:
162
+ sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
163
+ --sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
164
+ --sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
165
+
166
+ -- Logging configuration
167
+ -- For advanced logging see http://prosody.im/doc/logging
168
+ --
169
+ -- Debian:
170
+ -- Logs info and higher to /var/log
171
+ -- Logs errors to syslog also
172
+ log = {
173
+ debug = "/var/log/prosody/prosody.log";
174
+ error = "/var/log/prosody/prosody.err";
175
+ -- { levels = {min = "info"}, timestamps = "%Y-%m-%d %X", to = "console"};
176
+ }
177
+
178
+ trusted_proxies = { "127.0.0.1", "::1", "172.17.0.2"}
179
+
180
+ -- Enable use of native prosody 0.11 support for epoll over select
181
+ network_backend = "epoll";
182
+ -- Set the TCP backlog to 511 since the kernel rounds it up to the next power of 2: 512.
183
+ network_settings = {
184
+ tcp_backlog = 511;
185
+ }
186
+ unbound = {
187
+ resolvconf = true
188
+ }
189
+
190
+ http_ports = { 5280 }
191
+ http_interfaces = { "127.0.0.1" }
192
+ https_ports = { 5281 }
193
+ https_interfaces = { "*", "::" }
194
+
195
+
196
+ data_path = "/etc/drumee/credential/prosody/data"
197
+
198
+ smacks_max_unacked_stanzas = 5;
199
+ smacks_hibernation_time = 60;
200
+ smacks_max_hibernated_sessions = 1;
201
+ smacks_max_old_sessions = 1;
202
+
203
+ Include "conf.d/*.cfg.lua"
@@ -0,0 +1,46 @@
1
+ # jitsi-meet coturn config. Do not modify this line
2
+ use-auth-secret
3
+ keep-address-family
4
+ static-auth-secret=<%= turn_sercret %>
5
+ realm=<%= jitsi_domain %>
6
+ cert=<%= acme_dir %>/certs/<%= jitsi_domain %>_ecc/<%= jitsi_domain %>.cer
7
+ pkey=<%= acme_dir %>/certs/<%= jitsi_domain %>_ecc/<%= jitsi_domain %>.key
8
+ external-ip=<%= public_ip4 %> / <%= public_ip6 %>
9
+ no-multicast-peers
10
+ no-cli
11
+ #no-loopback-peers
12
+ #no-tcp-relay
13
+ no-tcp
14
+ listening-port=3478
15
+ tls-listening-port=5349
16
+ no-tlsv1
17
+ no-tlsv1_1
18
+ # https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4
19
+ cipher-list=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
20
+ # without it there are errors when running on Ubuntu 20.04
21
+ dh2066
22
+ # jitsi-meet coturn relay disable config. Do not modify this line
23
+ denied-peer-ip=0.0.0.0-0.255.255.255
24
+ denied-peer-ip=10.0.0.0-10.255.255.255
25
+ denied-peer-ip=100.64.0.0-100.127.255.255
26
+ denied-peer-ip=127.0.0.0-127.255.255.255
27
+ denied-peer-ip=169.254.0.0-169.254.255.255
28
+ denied-peer-ip=127.0.0.0-127.255.255.255
29
+ denied-peer-ip=172.16.0.0-172.31.255.255
30
+ denied-peer-ip=192.0.0.0-192.0.0.255
31
+ denied-peer-ip=192.0.2.0-192.0.2.255
32
+ denied-peer-ip=192.88.99.0-192.88.99.255
33
+ denied-peer-ip=192.168.0.0-192.168.255.255
34
+ denied-peer-ip=198.18.0.0-198.19.255.255
35
+ denied-peer-ip=198.51.100.0-198.51.100.255
36
+ denied-peer-ip=203.0.113.0-203.0.113.255
37
+ denied-peer-ip=240.0.0.0-255.255.255.255
38
+ denied-peer-ip=::1
39
+ denied-peer-ip=64:ff9b::-64:ff9b::ffff:ffff
40
+ denied-peer-ip=::ffff:0.0.0.0-::ffff:255.255.255.255
41
+ denied-peer-ip=100::-100::ffff:ffff:ffff:ffff
42
+ denied-peer-ip=2001::-2001:1ff:ffff:ffff:ffff:ffff:ffff:ffff
43
+ denied-peer-ip=2002::-2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff
44
+ denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
45
+ denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
46
+ syslog
@@ -0,0 +1,102 @@
1
+ _ = require("lodash");
2
+ Shell = require("shelljs");
3
+ const { mkdirSync, existsSync, writeSync, openSync, close, readFileSync } = require("fs");
4
+ const { env } = process;
5
+ const { resolve, join, dirname } = require("path");
6
+ const ARGV = require('minimist')(process.argv.slice(2));
7
+
8
+ /**
9
+ *
10
+ * @param {*} p
11
+ * @returns
12
+ */
13
+ function chroot(p) {
14
+ let root = ARGV.chroot || env.dev_root;
15
+ if (root) {
16
+ if (p) return join(root, p);
17
+ return join(root);
18
+ }
19
+ if (p) return join("/", p);
20
+ return ('/');
21
+ }
22
+
23
+ /**
24
+ *
25
+ */
26
+ function makedir(dname) {
27
+ if (!existsSync(dname)) {
28
+ //console.log(`Should make dir ${dname}`);
29
+ mkdirSync(dname, { recursive: true });
30
+ }
31
+ };
32
+
33
+
34
+
35
+ /**
36
+ *
37
+ * @param {*} err
38
+ */
39
+ function __error(err) {
40
+ if (err) throw err;
41
+ };
42
+
43
+
44
+ /**
45
+ *
46
+ */
47
+ function render(data, name, parse) {
48
+ let tpl = resolve(__dirname, "templates", name + ".tpl");
49
+ if (/\/templates$/.test(__dirname))
50
+ tpl = resolve(__dirname, name + ".tpl");
51
+ if (!existsSync(tpl)) {
52
+ tpl = resolve(__dirname, name);
53
+ }
54
+ //console.log("RENDERING", __dirname, name, tpl);
55
+ let str = readFileSync(tpl);
56
+ try {
57
+ let res = _.template(String(str).toString())(data);
58
+ if (parse && typeof res === "string") {
59
+ return JSON.parse(res);
60
+ }
61
+ return res;
62
+ } catch (e) {
63
+ console.error(`Failed to render from template ${tpl}`);
64
+ console.error("------------\n", e);
65
+ }
66
+ };
67
+
68
+ /**
69
+ *
70
+ * @param {*} data
71
+ * @param {*} fn
72
+ * @param {*} tpl_name
73
+ * @param {*} chr
74
+ * @returns
75
+ */
76
+ function write(data, fn, tpl_name, chr) {
77
+ let filename = chroot(fn);
78
+ makedir(dirname(filename));
79
+ let d = new Date();
80
+ data.date = d.toISOString().split('T')[0];
81
+
82
+ console.log("Writing config into " + filename);
83
+ let fd = openSync(filename, "w+");
84
+ if (ARGV.readonly) {
85
+ console.log("Readonly", fn, tpl_name);
86
+ return
87
+ }
88
+
89
+ if (_.isEmpty(tpl_name)) {
90
+ writeSync(fd, data);
91
+ } else {
92
+ writeSync(fd, render(data, tpl_name));
93
+ }
94
+ close(fd, __error);
95
+ }
96
+
97
+
98
+ module.exports = {
99
+ write,
100
+ chroot,
101
+ render
102
+ };
@@ -0,0 +1,20 @@
1
+ -- -------------------------------------------------------------
2
+ -- ! DO NOT EDIT !
3
+ -- Config file automatically generated by <infra-setup>
4
+ -- Date : <%= date %>
5
+ -- -------------------------------------------------------------
6
+
7
+ DROP TABLE IF EXISTS `configs`;
8
+ CREATE TABLE `configs` (
9
+ `name` varchar(64) NOT NULL DEFAULT '',
10
+ `value` varchar(2048) DEFAULT NULL,
11
+ `type` varchar(64) NOT NULL DEFAULT '',
12
+ PRIMARY KEY (`name`)
13
+ ) ENGINE=MEMORY DEFAULT CHARSET=utf8;
14
+
15
+ insert into configs values('db_host', "localhost", 'varchar');
16
+ insert into configs values('fs_host', "localhost", 'varchar');
17
+ insert into configs values('icon', "<%= default_ico %>/", 'varchar');
18
+ insert into configs values('page_length', "20", 'integer');
19
+ insert into configs values('mfs_root', "<%= data_dir %>/mfs/", 'varchar');
20
+
@@ -0,0 +1,19 @@
1
+ -- -------------------------------------------------------------
2
+ -- ! DO NOT EDIT !
3
+ -- Config file automatically generated by <infra-setup>
4
+ -- Date : <%= date %>
5
+ -- -------------------------------------------------------------
6
+
7
+ CREATE TABLE IF NOT EXISTS `configs` (
8
+ `name` varchar(64) NOT NULL DEFAULT '',
9
+ `value` varchar(2048) DEFAULT NULL,
10
+ `type` varchar(64) NOT NULL DEFAULT '',
11
+ PRIMARY KEY (`name`)
12
+ ) ENGINE=MEMORY DEFAULT CHARSET=utf8;
13
+
14
+ replace into configs values('db_host', "localhost", 'varchar');
15
+ replace into configs values('fs_host', "localhost", 'varchar');
16
+ replace into configs values('icon', "<%= default_ico %>/", 'varchar');
17
+ replace into configs values('page_length', '15', 'integer');
18
+ replace into configs values('mfs_root', "<%= data_dir %>/mfs/", 'varchar');
19
+
@@ -0,0 +1,8 @@
1
+ /* -------------------------------------------------------------
2
+ # !!!!!!! DO NOT EDIT !!!!!!!!
3
+ # Config file automatically generated by <infra-setup>
4
+ # Purpose : Provide route (instance) to Nginx
5
+ # Date : <%= date %>
6
+ # ------------------------------------------------------------- */
7
+
8
+ module.exports = require("<%= ecosystem %>");