Skip to content

Commit 5f46c05

Browse files
committed
Define and use macros in the configuration file
1 parent 403f228 commit 5f46c05

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

ecs/conf/ejabberd.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@
1414
### Refer to http://en.wikipedia.org/wiki/YAML for the brief description.
1515
###
1616

17+
define_macro:
18+
HOST: localhost
19+
ADMIN: "admin@localhost"
20+
PORT_C2S: 5222
21+
PORT_C2S_TLS: 5223
22+
PORT_S2S: 5269
23+
PORT_HTTP_TLS: 5443
24+
PORT_HTTP: 5280
25+
PORT_STUN: 5478
26+
PORT_MQTT: 1883
27+
PORT_PROXY65: 7777
28+
1729
hosts:
18-
- localhost
30+
- HOST
1931

2032
loglevel: info
2133

@@ -33,29 +45,29 @@ ca_file: "/home/ejabberd/conf/cacert.pem"
3345

3446
listen:
3547
-
36-
port: 5222
48+
port: PORT_C2S
3749
ip: "::"
3850
module: ejabberd_c2s
3951
max_stanza_size: 262144
4052
shaper: c2s_shaper
4153
access: c2s
4254
starttls_required: true
4355
-
44-
port: 5223
56+
port: PORT_C2S_TLS
4557
ip: "::"
4658
module: ejabberd_c2s
4759
max_stanza_size: 262144
4860
shaper: c2s_shaper
4961
access: c2s
5062
tls: true
5163
-
52-
port: 5269
64+
port: PORT_S2S
5365
ip: "::"
5466
module: ejabberd_s2s_in
5567
max_stanza_size: 524288
5668
shaper: s2s_shaper
5769
-
58-
port: 5443
70+
port: PORT_HTTP_TLS
5971
ip: "::"
6072
module: ejabberd_http
6173
tls: true
@@ -68,13 +80,13 @@ listen:
6880
/ws: ejabberd_http_ws
6981
/oauth: ejabberd_oauth
7082
-
71-
port: 5280
83+
port: PORT_HTTP
7284
ip: "::"
7385
module: ejabberd_http
7486
request_handlers:
7587
/admin: ejabberd_web_admin
7688
-
77-
port: 1883
89+
port: PORT_MQTT
7890
ip: "::"
7991
module: mod_mqtt
8092
backlog: 1000
@@ -139,7 +151,7 @@ acl:
139151
- ::1/128
140152
admin:
141153
user:
142-
- "admin@localhost"
154+
- ADMIN
143155

144156
access_rules:
145157
local:
@@ -262,6 +274,7 @@ modules:
262274
mod_proxy65:
263275
access: local
264276
max_connections: 5
277+
port: PORT_PROXY65
265278
mod_pubsub:
266279
access_createnode: pubsub_createnode
267280
plugins:

0 commit comments

Comments
 (0)