summaryrefslogtreecommitdiffstats
path: root/tv/3modules/ejabberd/config.nix
blob: 29c38fbe49d99e2b8d7c11c3f77d37447af6f8ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ config, ... }: with import <stockholm/lib>; let
  cfg = config.tv.ejabberd;

  # XXX this is a placeholder that happens to work the default strings.
  toErlang = builtins.toJSON;
in toFile "ejabberd.conf" ''
  {loglevel, 3}.
  {hosts, ${toErlang cfg.hosts}}.
  {listen,
   [
    {5222, ejabberd_c2s, [
        starttls,
        {certfile, ${toErlang cfg.certfile.path}},
        {access, c2s},
        {shaper, c2s_shaper},
        {max_stanza_size, 65536}
             ]},
    {5269, ejabberd_s2s_in, [
           {shaper, s2s_shaper},
           {max_stanza_size, 131072}
          ]},
    {5280, ejabberd_http, [
         captcha,
         http_bind,
         http_poll,
         web_admin
        ]}
   ]}.
  {s2s_use_starttls, required}.
  {s2s_certfile, ${toErlang cfg.s2s_certfile.path}}.
  {auth_method, internal}.
  {shaper, normal, {maxrate, 1000}}.
  {shaper, fast, {maxrate, 50000}}.
  {max_fsm_queue, 1000}.
  {acl, local, {user_regexp, ""}}.
  {access, max_user_sessions, [{10, all}]}.
  {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
  {access, local, [{allow, local}]}.
  {access, c2s, [{deny, blocked},
           {allow, all}]}.
  {access, c2s_shaper, [{none, admin},
            {normal, all}]}.
  {access, s2s_shaper, [{fast, all}]}.
  {access, announce, [{allow, admin}]}.
  {access, configure, [{allow, admin}]}.
  {access, muc_admin, [{allow, admin}]}.
  {access, muc_create, [{allow, local}]}.
  {access, muc, [{allow, all}]}.
  {access, pubsub_createnode, [{allow, local}]}.
  {access, register, [{allow, all}]}.
  {language, "en"}.
  {modules,
   [
    {mod_adhoc,    []},
    {mod_announce, [{access, announce}]},
    {mod_blocking,[]},
    {mod_caps,     []},
    {mod_configure,[]},
    {mod_disco,    []},
    {mod_irc,      []},
    {mod_http_bind, []},
    {mod_last,     []},
    {mod_muc,      [
        {access, muc},
        {access_create, muc_create},
        {access_persistent, muc_create},
        {access_admin, muc_admin}
       ]},
    {mod_offline,  [{access_max_user_messages, max_user_offline_messages}]},
    {mod_ping,     []},
    {mod_privacy,  []},
    {mod_private,  []},
    {mod_pubsub,   [
        {access_createnode, pubsub_createnode},
        {ignore_pep_from_offline, true},
        {last_item_cache, false},
        {plugins, ["flat", "hometree", "pep"]}
       ]},
    {mod_register, [
        {welcome_message, {"Welcome!",
               "Hi.\nWelcome to this XMPP server."}},
        {ip_access, [{allow, "127.0.0.0/8"},
               {deny, "0.0.0.0/0"}]},
        {access, register}
       ]},
    {mod_roster,   []},
    {mod_shared_roster,[]},
    {mod_stats,    []},
    {mod_time,     []},
    {mod_vcard,    []},
    {mod_version,  []}
   ]}.
''