]>
Commit | Line | Data |
---|---|---|
1 | { config, lib, pkgs, ... }: | |
2 | let | |
3 | cfg = config.myServices.websites.tools.im; | |
4 | in | |
5 | { | |
6 | options.myServices.websites.tools.im = { | |
7 | enable = lib.mkEnableOption "enable im website"; | |
8 | }; | |
9 | ||
10 | config = lib.mkIf cfg.enable { | |
11 | myServices.chatonsProperties.services.converse = { | |
12 | file.datetime = "2022-08-21T19:20:00"; | |
13 | service = { | |
14 | name = "Converse"; | |
15 | description = "A free and open-source XMPP chat client in your browser"; | |
16 | website = "https://im.immae.fr/converse"; | |
17 | logo = "https://conversejs.org/docs/html/_static/favicon.ico"; | |
18 | status.level = "OK"; | |
19 | status.description = "OK"; | |
20 | registration."" = ["NONE" "FREE"]; | |
21 | registration.load = "OPEN"; | |
22 | install.type = "PACKAGE"; | |
23 | }; | |
24 | software = { | |
25 | name = "Converse"; | |
26 | website = "https://conversejs.org/"; | |
27 | license.name = "Mozilla Public License 2.0"; | |
28 | license.url = "https://github.com/conversejs/converse.js/blob/master/LICENSE"; | |
29 | version = "9.1.1"; | |
30 | source.url = "https://github.com/conversejs/converse.js"; | |
31 | }; | |
32 | }; | |
33 | myServices.chatonsProperties.services.weechat-bridge = { | |
34 | file.datetime = "2022-08-21T19:20:00"; | |
35 | service = { | |
36 | name = "Weechat bridge"; | |
37 | description = "WeeChat web frontend"; | |
38 | website = "https://im.immae.fr/glowing-bear"; | |
39 | logo = "https://im.immae.fr/glowing-bear/assets/img/glowing_bear_128x128.png"; | |
40 | status.level = "OK"; | |
41 | status.description = "OK"; | |
42 | registration."" = ["NONE" "FREE"]; | |
43 | registration.load = "OPEN"; | |
44 | install.type = "PACKAGE"; | |
45 | }; | |
46 | software = { | |
47 | name = "Glowing bear"; | |
48 | website = "https://www.ejabberd.im/"; | |
49 | license.name = "GNU General Public License v3.0"; | |
50 | license.url = "https://github.com/processone/ejabberd"; | |
51 | version = pkgs.glowing-bear.version; | |
52 | source.url = "https://github.com/glowing-bear/glowing-bear"; | |
53 | }; | |
54 | }; | |
55 | myServices.chatonsProperties.services.xmpp = { | |
56 | file.datetime = "2022-08-21T19:20:00"; | |
57 | service = { | |
58 | name = "XMPP"; | |
59 | description = "Universal messaging standard"; | |
60 | website = "https://im.immae.fr/"; | |
61 | logo = "https://xmpp.org/favicon-32x32.png"; | |
62 | status.level = "OK"; | |
63 | status.description = "OK"; | |
64 | registration."" = ["MEMBER" "CLIENT"]; | |
65 | registration.load = "OPEN"; | |
66 | install.type = "PACKAGE"; | |
67 | }; | |
68 | software = { | |
69 | name = "ejabberd"; | |
70 | website = "https://www.ejabberd.im/"; | |
71 | license.url = "https://github.com/processone/ejabberd/blob/master/COPYING"; | |
72 | license.name = "GNU GENERAL PUBLIC LICENSE Version 2"; | |
73 | version = pkgs.ejabberd.version; | |
74 | source.url = "https://github.com/processone/ejabberd"; | |
75 | modules = "converse"; | |
76 | }; | |
77 | }; | |
78 | services.websites.env.tools.vhostConfs.im = { | |
79 | certName = "eldiron"; | |
80 | addToCerts = true; | |
81 | hosts = ["im.immae.fr"]; | |
82 | root = ./www; | |
83 | extraConfig = [ | |
84 | '' | |
85 | Alias /glowing-bear ${pkgs.glowing-bear} | |
86 | Alias /converse ${./www}/converse.html | |
87 | ProxyPreserveHost On | |
88 | <Location "/bosh"> | |
89 | ProxyPass http://localhost:5280/bosh | |
90 | ProxyPassReverse http://localhost:5280/bosh | |
91 | </Location> | |
92 | <Location "/ws"> | |
93 | ProxyPass ws://localhost:5280/ws | |
94 | </Location> | |
95 | ProxyPass /upload http://localhost:5280/upload | |
96 | ProxyPassReverse /upload http://localhost:5280/upload | |
97 | ProxyPass /admin http://localhost:5280/admin | |
98 | ProxyPassReverse /admin http://localhost:5280/admin | |
99 | ProxyPass /api http://localhost:5280/api | |
100 | ProxyPassReverse /api http://localhost:5280/api | |
101 | <Directory ${pkgs.glowing-bear}> | |
102 | AllowOverride none | |
103 | Require all granted | |
104 | </Directory> | |
105 | '' | |
106 | ]; | |
107 | }; | |
108 | }; | |
109 | } |