454 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
Greg Karékinian
d7363d662b Switch the Mediawiki extensions to GitHub zips
This fixes the annoying issue of Mediawiki only keeping one revision of
each branch
2020-03-04 16:03:12 +01: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
c4fdf1779f Remove the CleanTalk Antispam extension
It is not needed anymore now that registration is closed and only LDAP
accounts can edit or create pages

Closes #130
2020-02-20 14:31:39 +01:00
Greg Karékinian
6f7474b4d1 Update the Mediawiki extensions 2020-02-20 14:30:25 +01:00
Greg Karékinian
90a0e6be9f Enable LDAP on the kosmos.org vhost 2020-02-19 12:30:55 +01:00
Greg Karékinian
276daf0ed7 Switch the Mediawiki config to the new LDAP dir structure
* Use a new read-only account instead of the admin LDAP account
* Disable the LDAPAuthorization plugin. The LDAPAuthentication2 plugin
is still used to authenticate users, but every kosmos.org user has
access to the wiki. See
https://www.mediawiki.org/wiki/Extension:PluggableAuth for the
distinction between authentication and authorization

Refs #127
2020-02-19 12:29:14 +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
463664448c Merge branch 'master' into feature/123-ejabberd_5apps 2020-02-17 12:21:16 +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
e56faab5b1 Set the ACIs on the base DN
Allow users to change their own password, but nothing else (no search,
no read, no write)

This will only run when setting up the 389-dirsrv instance for the first
time, this has been applied on barnard by editing the dn (see
#128 (comment))

Closes #128
2020-02-12 16:13:45 +01:00
Greg Karékinian
2a66ff6146 Enable the Cite extension in the MediaWiki config
This is used to create references as footnotes.
See https://www.mediawiki.org/wiki/Extension:Cite

Closes #124
2020-01-29 14:30:39 +01:00
Greg Karékinian
a06ea47e58 Update the LDAPProvider extension 2020-01-28 13:54:57 +01:00
Greg Karékinian
a69192a863 Enable LDAP support on mediawiki
Users can log in using their LDAP account (in the
ou=users,dc=kosmos,dc=org group and with the wiki attribute set to
enabled)

Add an attribute for the ldap master server, so it can be overridden in
the development environment

Refs #107
2020-01-24 13:45:17 +01:00
gregkare
7fd558215d Merge branch 'feature/107-ldap_server' of kosmos/chef into master 2019-12-23 17:50:19 +00:00
Greg Karékinian
9828b867ba Disable anonymous binds
See https://access.redhat.com/documentation/en-US/Red_Hat_Directory_Server/8.2/html/Administration_Guide/configuring-special-binds.html#disabling-anonymous-binds
2019-12-20 16:46:03 +01:00
11c7019bfa
Fix thumbnails not working for larger SVGs
See linked docs in code comments
2019-12-13 13:46:57 +01:00
2358ed00db
Fix wiki permissions 2019-12-13 13:41:48 +01:00
cbfb760787
Increase wiki file upload size limit 2019-12-13 13:41:48 +01:00
2158e1d4bf
Allow SVG file uploads 2019-12-13 13:41:48 +01:00
Greg Karékinian
1240ed9da8 Move the dirsrv cert generation to a certbot deploy hook 2019-12-05 15:47:10 +01:00
Greg Karékinian
0d192f536f Add the empty nginx vhost template 2019-12-05 15:05:37 +01:00
Greg Karékinian
0dbf350540 Restart the server after importing the TLS cert 2019-12-04 17:40:27 +01:00
Greg Karékinian
4e7d453942 Move the firewall and backup recipes outside of the custom resource
See the comment for more details
2019-12-04 17:33:41 +01:00
Greg Karékinian
e24cd01287 Add an empty template because the nginx_certbot_site resource needs one 2019-12-04 17:33:13 +01:00
Greg Karékinian
632cb38aab Pass an empty passphrase on the command line for the p12 cert 2019-12-04 17:32:40 +01:00
Greg Karékinian
9d9493af0d Add a missing dependency on the kosmos-nginx cookbook 2019-12-04 17:32:03 +01:00
Greg Karékinian
9e4f12b1b1 Merge branch 'master' into feature/107-ldap_server 2019-12-04 15:52:08 +01:00
gregkare
aecdaabbcc Merge branch 'chore/enable_wiki_editor_toolbar' of kosmos/chef into master 2019-11-29 16:38:08 +00:00
Greg Karékinian
dc91128eca Use a custom resource to create a 389 Directory Server instance
This replaces the default recipe and will make it much easier to create
other types of instances, for example for replication
2019-11-29 14:34:52 +01:00
678286d758
Enable wiki editor toolbar
Enables the formatting toolbar for the wiki editor.
2019-11-26 22:04:49 +01:00
gregkare
056a3eb0d6 Merge branch 'bugfix/letsencrypt_regenerate_template' of kosmos/chef into master 2019-11-22 16:19:52 +00:00
Greg Karékinian
db4e2777d4 Fix a bug preventing nginx from being reloaded after generating a cert
Change the notifies property to :immediately in nginx_certbot_site. This
way the vhost template is recreated and then triggers a reload of the
nginx service. The previous code resulted in nginx not being reloaded,
as the action had already been queued earlier.
2019-11-22 14:37:29 +01:00
Greg Karékinian
9e4685a743 Initial version of the kosmos-dirsrv cookbook
It sets up 389 Directory Server, including a TLS cert acquired using
Let's Encrypt in production (that requires ldap.kosmos.org pointing to
the server's IP)
2019-11-15 15:41:30 +01:00
bd3ef8b635 Remove tweet reading from XMPP Hubot
Because of the wormhole feature between XMPP and IRC, any links to
tweets will be read by the hal8000 bots on both platforms.

This change removes the Tweet reading extension from the XMPP version of
the bot.
2019-11-15 14:43:56 +01:00
90aebe54de Revert "Remove tweet reading from IRC Hubot"
This reverts commit d5fc7ad105f45ea2b8eb2033564e4474abfc77a9.
2019-11-15 14:37:19 +01:00
d5fc7ad105 Remove tweet reading from IRC Hubot
Because of the wormhole feature between XMPP and IRC, any links to
tweets will be read by the hal8000 bots on both platforms.

This change removes the Tweet reading extension from the IRC version of
the bot.
2019-11-14 19:00:04 +01:00
Greg Karékinian
0b579b1fea Remove the redirection from HTTP to HTTPS from the mastodon vhost
This is already done in the certbot vhost
(https://gitea.kosmos.org/kosmos/chef/src/branch/master/site-cookbooks/kosmos-nginx/templates/default/nginx_conf_certbot.erb)
and it redirects every request to HTTPS, breaking Let's Encrypt
validation

Fixes #110
2019-10-28 11:18:31 +01:00
Greg Karékinian
2c20fa4a2f Fix the nginx vhost for akkounts-api
Listening on port 80 when there is no TLS cert prevented Let's Encrypt
to generate a cert
2019-10-18 13:26:04 +02:00
f8af66a532
Add/fix akkounts credentials 2019-10-18 13:10:43 +02:00
Greg Karékinian
2104e81250 Add the kosmos-akkounts::nginx recipe to kosmos-akkounts::default 2019-10-18 12:30:26 +02:00