38 Commits

Author SHA1 Message Date
Greg Karékinian
f5dd2c7de9 Fix the command importing the schema on db creation
It had an extra }, but this only fails when creating the databases
2020-04-20 14:52:11 +02:00
7fa11089b1 Merge branch 'bugfix/ejabberd_restart_config_vhost_change' of kosmos/chef into master 2020-03-04 13:45:10 +00:00
Greg Karékinian
a68ae78689 Update ejabberd to 20.02
It includes a fix to the reload_config command that prevented us from
running a version newer than 19.05

Closes #136
2020-03-04 13:28:13 +01:00
Greg Karékinian
6cd0fa039e Restart ejabberd service when changing a vhost config
I have ran into an issue, changes to the LDAP config for a host are
currently only loaded on startup, not on reload

https://github.com/processone/ejabberd/issues/3181

This should be fixed once
b39a1e2d74
is part of the next release
2020-03-04 13:23:54 +01:00
Greg Karékinian
6fa89b3c25 Switch the ejabberd LDAP setup to a new application account
Needs the new directory structure:

```
dn: cn=applications,dc=kosmos,dc=org
objectClass: top
objectClass: organizationalRole
cn: users

dn: ou=kosmos.org,cn=applications,dc=kosmos,dc=org
objectClass: top
objectClass: organizationalUnit
ou: kosmos.org

dn: ou=5apps.com,cn=applications,dc=kosmos,dc=org
objectClass: top
objectClass: organizationalUnit
description: 5apps
ou: 5apps.com

dn: uid=wiki,ou=kosmos.org,cn=applications,dc=kosmos,dc=org
objectClass: simpleSecurityObject
objectClass: account
uid: wiki
userPassword: [snip]

dn: uid=xmpp,ou=kosmos.org,cn=applications,dc=kosmos,dc=org
objectClass: simpleSecurityObject
objectClass: account
uid: xmpp
userPassword: [snip]

dn: uid=xmpp,ou=5apps.com,cn=applications,dc=kosmos,dc=org
objectClass: simpleSecurityObject
objectClass: account
uid: xmpp
userPassword: [snip]

```

And the new ACIs:

```
dn: ou=5apps.com,cn=users,dc=kosmos,dc=org
changetype: modify
replace: aci
aci: (target="ldap:///cn=*,ou=5apps.com,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || nsRole") (version 3.0; acl "xmpp-5apps-read-search"; allow (read,search) userdn="ldap:///cn=xmpp,ou=5apps.com,cn=users,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=5apps.com,cn=users,dc=kosmos,dc=org")(targetattr="userPassword") (version 3.0; acl "xmpp-5apps-change-password"; allow (write) userdn="ldap:///cn=xmpp,ou=5apps.com,cn=users,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=5apps.com,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || nsRole || objectClass") (version 3.0; acl "xmpp-5apps-read-search"; allow (read,search) userdn="ldap:///uid=xmpp,ou=5apps.com,cn=applications,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=5apps.com,cn=users,dc=kosmos,dc=org")(targetattr="userPassword") (version 3.0; acl "xmpp-5apps-change-password"; allow (write) userdn="ldap:///uid=xmpp,ou=5apps.com,cn=applications,dc=kosmos,dc=org";)

dn: ou=kosmos.org,cn=users,dc=kosmos,dc=org
changetype: modify
replace: aci
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || nsRole") (version 3.0; acl "xmpp-kosmos-read-search"; allow (read,search) userdn="ldap:///cn=xmpp,ou=kosmos.org,cn=users,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword") (version 3.0; acl "xmpp-kosmos-read-search"; allow (read,search) userdn="ldap:///cn=wiki,ou=kosmos.org,cn=users,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="userPassword") (version 3.0; acl "xmpp-kosmos-change-password"; allow (write) userdn="ldap:///cn=xmpp,ou=kosmos.org,cn=users,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || nsRole || objectClass") (version 3.0; acl "xmpp-kosmos-read-search"; allow (read,search) userdn="ldap:///uid=xmpp,ou=kosmos.org,cn=applications,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="cn || sn || uid || mail || userPassword || objectClass") (version 3.0; acl "xmpp-kosmos-read-search"; allow (read,search) userdn="ldap:///uid=wiki,ou=kosmos.org,cn=applications,dc=kosmos,dc=org";)
aci: (target="ldap:///cn=*,ou=kosmos.org,cn=users,dc=kosmos,dc=org")(targetattr="userPassword") (version 3.0; acl "xmpp-kosmos-change-password"; allow (write) userdn="ldap:///uid=xmpp,ou=kosmos.org,cn=applications,dc=kosmos,dc=org";)
```

Refs #140
2020-02-21 18:03:58 +01:00
Greg Karékinian
90a0e6be9f Enable LDAP on the kosmos.org vhost 2020-02-19 12:30:55 +01:00
Greg Karékinian
56adfa37fb Fix a warning in the config
Migrate the web admin to a request handler
2020-02-17 17:26:55 +01:00
Greg Karékinian
0f9b2777a3 Update ejabberd to 19.05
Versions from 19.08 to 20.01 contains a blocking bug in the
reload_config command
(https://github.com/processone/ejabberd/issues/3170)

Closes #134
2020-02-17 17:26:45 +01:00
Greg Karékinian
c2b2b6f08b Fix the vhost template
hosts must be defined in the main config file
2020-02-17 15:04:08 +01:00
Greg Karékinian
72cc6342f1 Remove the unused LDAP variables from the main config file 2020-02-17 13:27:14 +01:00
Greg Karékinian
38f39af2a4 Move each vhost to its own config file 2020-02-17 13:20:54 +01:00
Greg Karékinian
55eb95ae73 Verify the TLS server's certificate
Do not proceed if a certificate is invalid
2020-02-14 13:56:52 +01:00
Greg Karékinian
dc1226073c Move the admin users to the ejabberd encrypted data bag 2020-02-14 13:56:17 +01:00
Greg Karékinian
49d01991fd Enable LDAP on the XMPP 5apps.com vhost
Refactor the ejabberd config file to remove hardcoded values about the
vhosts

Refs #123
2020-02-12 17:40:38 +01:00
Greg Karékinian
544f4b78f4 Change the MUC domain for the kosmos.org XMPP server to kosmos.chat 2019-09-19 15:57:54 +02:00
Greg Karékinian
4685b16573 Add kosmos.chat to the list of Kosmos XMPP domains with a TLS cert 2019-09-19 15:56:49 +02:00
Greg Karékinian
2ecc128abd Move the hidden service attributes to the attributes file
When it is set in the recipe the hidden service dir doesn't get set
correctly (nil), resulting in a broken torrc file
2019-09-11 13:47:42 +02:00
40eb94f091
Move Tor attributes to recipe files 2019-09-09 13:36:49 +02:00
03b3b2de91
Add hidden service for ejabberd 2019-09-03 19:47:52 +02:00
Greg Karékinian
0fa9e6cbb7 Set the uploads dir inside of /opt/ejabberd instead of /var/www
/var/www is intended for nginx/apache

I have copied over the old directories manually on Andromeda before
running this code

Fixes #80
2019-07-19 12:47:42 +02:00
Greg Karékinian
b01985ec4f Fix the permissions for the ejabberd upload folders 2019-06-14 16:38:49 +02:00
Greg Karékinian
5106ba20fd Add the version to the dpkg package to allow updates 2019-05-14 17:10:15 +02:00
Greg Karékinian
d398c167ca Allow to pass extra attributes to backup PostgreSQL databases 2019-05-14 16:39:21 +02:00
Greg Karékinian
f81b7c82de Backup the 5apps ejabberd database and uploads dir 2019-05-14 15:16:28 +02:00
Greg Karékinian
bd9491675f Add the missing sql schema 2019-05-14 15:10:07 +02:00
Greg Karékinian
902a013dca Restart the service when the systemd unit changes 2019-05-14 12:18:22 +02:00
Greg Karékinian
0be63e5935 Fix the config file when no TLS certs exist 2019-05-14 11:31:42 +02:00
Greg Karékinian
bd720b0189 Use the regular SQL schema (not the new one for all vhosts into one db) 2019-05-14 11:24:08 +02:00
Greg Karékinian
d9390a4b92 Don't use a concatenated cert for kosmos.org anymore 2019-05-13 18:53:45 +02:00
Greg Karékinian
5d1aeb7b68 Create a cert for 5apps.com and improve the renewal script 2019-05-13 18:52:39 +02:00
Greg Karékinian
88204ea91b Update the config to the current one running on andromeda 2019-05-13 17:59:04 +02:00
Greg Karékinian
ad23530653 Add the firewall rules for ejabberd
Includes the missing 5223 port in the andromeda_firewall recipe too
2019-05-13 17:08:21 +02:00
Greg Karékinian
b44a226753 Fix the postgresql setup for the ejabberd cookbook
Create a ejabberd user with a password from an encrypted data bag
2019-05-10 11:43:52 +02:00
Greg Karékinian
b45430f63a Set permissions for the upload folder 2019-04-17 11:22:12 +02:00
Greg Karékinian
0e379644c5 MIT license for the kosmos-ejabberd cookbook 2019-04-17 10:30:29 +02:00
Greg Karékinian
1b770c0e95 Set up Let's Encrypt for the kosmos.org ejabberd server 2019-04-17 10:14:50 +02:00
Greg Karékinian
80449ccbeb Add a recipe that sets up backups for ejabberd 2019-04-17 10:14:50 +02:00
Greg Karékinian
9346188ca7 Initial kosmos-ejabberd cookbook 2019-04-17 10:11:52 +02:00