Skip to content

Commit c3df6df

Browse files
committed
feat(prosody): Configure polls for visitors.
1 parent a5b307b commit c3df6df

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

prosody/rootfs/defaults/conf.d/visitors.cfg.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
12
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool -}}
23
{{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool) -}}
34
{{ $ENABLE_RATE_LIMITS := .Env.PROSODY_ENABLE_RATE_LIMITS | default "0" | toBool -}}
@@ -79,6 +80,9 @@ s2sout_override = {
7980
["{{ $vhost }}"] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
8081
{{ end -}}
8182
{{ end -}}
83+
{{ if not $DISABLE_POLLS -}}
84+
['polls.{{ $XMPP_DOMAIN }}'] = "tcp://{{ $XMPP_SERVER }}:{{ $XMPP_SERVER_S2S_PORT }}";
85+
{{ end -}}
8286

8387
}
8488

@@ -102,6 +106,7 @@ VirtualHost 'v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}'
102106
{{ if .Env.XMPP_MODULES }}
103107
"{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES | compact) }}";
104108
{{ end }}
109+
'features_identity';
105110
}
106111
main_muc = '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}';
107112
shard_name = "{{ $SHARD_NAME }}"
@@ -186,3 +191,7 @@ Component '{{ $VISITORS_MUC_PREFIX }}.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DO
186191
{{ if .Env.XMPP_MUC_CONFIGURATION -}}
187192
{{ join "\n" (splitList "," .Env.XMPP_MUC_CONFIGURATION | compact) }}
188193
{{ end -}}
194+
195+
{{ if not $DISABLE_POLLS -}}
196+
Component 'polls.v{{ $VISITOR_INDEX }}.{{ $VISITORS_XMPP_DOMAIN }}'' 'polls_component'
197+
{{ end -}}

prosody/rootfs/defaults/prosody.cfg.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $C2S_REQUIRE_ENCRYPTION := .Env.PROSODY_C2S_REQUIRE_ENCRYPTION | default "1" | toBool -}}
22
{{ $DISABLE_C2S_LIMIT := .Env.PROSODY_DISABLE_C2S_LIMIT | default "0" | toBool -}}
3+
{{ $DISABLE_POLLS := .Env.DISABLE_POLLS | default "false" | toBool -}}
34
{{ $DISABLE_S2S_LIMIT := .Env.PROSODY_DISABLE_S2S_LIMIT | default "0" | toBool -}}
45
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool -}}
56
{{ $ENABLE_GUEST_DOMAIN := and $ENABLE_AUTH (.Env.ENABLE_GUESTS | default "0" | toBool) -}}
@@ -242,6 +243,9 @@ s2s_whitelist = {
242243
'{{ $XMPP_MUC_DOMAIN }}'; -- needed for visitors to send messages to main room
243244
'visitors.{{ $XMPP_DOMAIN }}'; -- needed for sending promotion request to visitors.{{ $XMPP_DOMAIN }} component
244245
'{{ $XMPP_DOMAIN }}'; -- unavailable presences back to main room
246+
{{- if not $DISABLE_POLLS }}
247+
'polls.{{ $XMPP_DOMAIN }}';
248+
{{- end }}
245249
{{- end }}
246250

247251
{{- if $ENABLE_GUEST_DOMAIN }}
@@ -267,12 +271,14 @@ s2sout_override = {
267271
{{ $DEFAULT_PORT := add $VISITORS_XMPP_PORT $index }}
268272
["{{ $VISITORS_MUC_PREFIX }}.v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}"] = "tcp://{{ $SERVER._0 }}:{{ $SERVER._1 | default $DEFAULT_PORT }}";
269273
["v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}"] = "tcp://{{ $SERVER._0 }}:{{ $SERVER._1 | default $DEFAULT_PORT }}";
274+
["polls.v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}"] = "tcp://{{ $SERVER._0 }}:{{ $SERVER._1 | default $DEFAULT_PORT }}";
270275
{{ end -}}
271276
};
272277
{{ if ne $PROSODY_MODE "visitors" -}}
273278
s2s_whitelist = {
274279
{{ range $index, $element := $VISITORS_XMPP_SERVERS -}}
275280
"{{ $VISITORS_MUC_PREFIX }}.v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}";
281+
"polls.v{{ $index }}.{{ $VISITORS_XMPP_DOMAIN }}";
276282
{{ end -}}
277283
};
278284
{{ end -}}

0 commit comments

Comments
 (0)