2020-09-04 23:59:00 +00:00
# Mediawiki
2023-03-28 15:32:38 +00:00
[![Build Status ](https://build.coopcloud.tech/api/badges/coop-cloud/mediawiki/status.svg )](https://build.coopcloud.tech/coop-cloud/mediawiki)
2020-09-04 23:59:00 +00:00
2021-03-02 16:38:38 +00:00
<!-- metadata -->
* **Category**: Apps
2021-11-23 10:19:05 +00:00
* **Status**: 1, alpha
* **Image**: [`mediawiki` ](https://hub.docker.com/_/mediawiki ), 4, upstream
2021-03-02 16:38:38 +00:00
* **Healthcheck**: No
* **Backups**: Yes
2021-11-23 10:19:05 +00:00
* **Email**: 3
* **Tests**: 2
* **SSO**: 2 (OAuth, SAML)
2021-03-02 16:38:38 +00:00
<!-- endmetadata -->
## Basic usage
2020-09-04 23:59:00 +00:00
2020-09-07 23:38:20 +00:00
1. Set up Docker Swarm and [`abra`][abra]
2020-10-24 13:46:39 +00:00
2. Deploy [`coop-cloud/traefik`][traefik]
2021-03-02 16:38:38 +00:00
3. `abra app new mediawiki --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass` )
2023-01-20 00:02:28 +00:00
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
2020-09-07 23:38:20 +00:00
your Docker swarm box
2023-01-20 00:02:28 +00:00
5. `abra app deploy YOURAPPDOMAIN`
2021-03-02 16:38:38 +00:00
6. Create an initial admin user:
2023-01-20 00:02:28 +00:00
`abra app run YOURAPPDOMAIN app php /var/www/html/maintenance/createAndPromote.php --sysop YourUsername YourPassword`
2020-09-16 20:19:23 +00:00
2020-10-24 17:01:49 +00:00
## Email
2023-06-29 16:23:56 +00:00
### Coop Cloud mailu or postfix
2023-01-20 00:02:28 +00:00
1. `abra app config YOURAPPDOMAIN` - edit `.envrc` and uncomment the `SMTP` lines. Set `SMTP_HOST` to
2020-10-24 17:01:49 +00:00
`postfix_relay` for `coop-cloud/postfix_relay` , or `mailu_front` for
`coop-cloud/mailu` (assuming default stack names)
2021-02-16 11:58:09 +00:00
2. For `postfix_relay` , add the domain to your email config – `EXTRA_SENDER_DOMAINS` in
2020-10-24 18:13:39 +00:00
`postfix_relay` . This doesn't seem to be required for Mailu.
2023-01-20 00:02:28 +00:00
3. `abra app deploy YOURAPPDOMAIN`
2020-10-24 17:01:49 +00:00
2023-06-29 16:23:56 +00:00
### Remote provider
1. `abra app config YOURAPPDOMAIN` - uncomment `SMTP` under the "remote email provider" section and set values for `SMTP_HOST` , `SMTP_PORT` and `SMTP_USER`
2. `abra app secret insert YOURAPPDOMAIN smtp_password v1 YOURSMTPPASSWORD`
3. `abra app deploy YOURAPPDOMAIN`
Note: Only STARTTLS is supported, TLS won't work.
2020-10-24 17:01:49 +00:00
## Single Sign On
### SimpleSAMLphp
2020-09-16 20:19:23 +00:00
2020-09-18 21:30:16 +00:00
This app includes optional SAML Single Sign On using
[SimpleSAMLphp][simplesamlphp] and Mediawiki's
[Extension:SimpleSAMLphp][mw-simplesamlphp], based on the
[`venatorfox/simplesamlphp`][venatorfox-simplesamlphp] image.
NOTE: currently, if you enable SAML then it'll disable Mediawiki's own user account
system. Patches to make this configurable are welcome!
2023-01-20 00:02:28 +00:00
1. `abra app config YOURAPPDOMAIN` - uncomment lines in the `SAML` section (including `COMPOSE_FILE` )
2020-12-27 13:55:45 +00:00
2. Generate secrets: (add `--pass` if you want to store secrets in `pass` )
2020-09-18 21:30:16 +00:00
```
2020-12-27 13:55:45 +00:00
abra app YOURAPPDOMAIN secret generate saml_admin_password v1
abra app YOURAPPDOMAIN secret generate saml_secret_salt v1 "pwgen -n 64 1"
2020-09-18 21:30:16 +00:00
```
2023-01-20 00:02:28 +00:00
3. `abra app deploy YOURAPPDOMAIN`
2021-02-16 11:58:09 +00:00
4. Copy your SimpleSAMLphp metadata and certificates to the container (assuming
2020-09-18 21:30:16 +00:00
you have local `metadata` and `cert` folders:
```
2020-12-27 13:55:45 +00:00
abra app YOURAPPDOMAIN cp metadata simplesaml:/var/simplesamlphp/
abra app YOURAPPDOMAIN cp cert simplesaml:/var/simplesamlphp/
2020-09-18 21:30:16 +00:00
```
2021-02-16 11:58:09 +00:00
5. You can log into SimpleSAMLphp using the password you generated at
2020-09-18 21:30:16 +00:00
https://$DOMAIN/simplesaml/ and test authentication
2021-02-16 11:58:09 +00:00
6. Edit SimpleSAMLphp's `config.php` and change `store.sql.dsn` :
2020-09-18 21:30:16 +00:00
```
2020-12-27 13:55:45 +00:00
abra app YOURAPPDOMAIN run simplesaml vi /var/simplesamlphp/config/config.php
2020-09-18 21:30:16 +00:00
# find 'store.sql.dsn' and edit to:
# 'sqlite:/var/simplesamlphp/data/simplesamlphp.sq3'
```
2020-09-04 23:59:00 +00:00
2020-10-24 17:01:49 +00:00
### OpenID Connect
2020-10-19 14:50:47 +00:00
2023-01-20 00:02:28 +00:00
1. `abra app config YOURAPPDOMAIN` - uncomment lines in the `OPENID` section (including `COMPOSE_FILE` )
2020-12-27 13:55:45 +00:00
2. Store your Keycloak-generated client secret in Docker:
2021-02-16 11:58:09 +00:00
2020-10-24 17:01:49 +00:00
```
2020-12-27 13:55:45 +00:00
abra app YOURAPPDOMAIN secret insert openid_client_secret v1 put-your-secret-here
2020-10-24 17:01:49 +00:00
```
2021-02-16 11:58:09 +00:00
2023-01-20 00:02:28 +00:00
3. `abra app deploy YOURAPPDOMAIN`
2020-10-19 14:50:47 +00:00
2020-09-04 23:59:00 +00:00
## License
MIT License
2020-09-07 23:38:20 +00:00
2020-10-24 13:46:39 +00:00
[mediawiki-1.35]: https://www.mediawiki.org/wiki/Release_notes/1.35
2020-09-07 23:38:20 +00:00
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
2020-10-24 13:46:39 +00:00
[traefik]: https://git.autonomic.zone/coop-cloud/traefik
2020-09-18 21:30:16 +00:00
[simplesamlphp]: https://simplesamlphp.org/
[mw-simplesamlphp]: https://www.mediawiki.org/wiki/Extension:SimpleSAMLphp
[venatorfox-simplesamlphp]: https://hub.docker.com/r/venatorfox/simplesamlphp