forked from coop-cloud/mediawiki
Compare commits
15 Commits
2.1.0+1.37
...
main
Author | SHA1 | Date | |
---|---|---|---|
f2afce4145 | |||
2ad502e4fa | |||
9ee106a2ed | |||
bce93ab727 | |||
8c503d5d28 | |||
d7d228ab7e | |||
ae116a9954 | |||
a71d9195e8 | |||
f18c9882df | |||
ffcf336329 | |||
7e8c307936 | |||
463d606257 | |||
bf2fcbd7b4 | |||
bde470d4f9 | |||
c377ae6620 |
20
.drone.yml
20
.drone.yml
@ -3,10 +3,12 @@ kind: pipeline
|
|||||||
name: deploy to swarm-test.autonomic.zone
|
name: deploy to swarm-test.autonomic.zone
|
||||||
steps:
|
steps:
|
||||||
- name: deployment
|
- name: deployment
|
||||||
image: decentral1se/stack-ssh-deploy:latest
|
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
|
||||||
settings:
|
settings:
|
||||||
host: swarm-test.autonomic.zone
|
host: swarm-test.autonomic.zone
|
||||||
stack: mediawiki
|
stack: mediawiki
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
purge: true
|
purge: true
|
||||||
generate_secrets: true
|
generate_secrets: true
|
||||||
deploy_key:
|
deploy_key:
|
||||||
@ -31,11 +33,17 @@ trigger:
|
|||||||
- main
|
- main
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: recipe release
|
name: generate recipe catalogue
|
||||||
steps:
|
steps:
|
||||||
- name: release a new version
|
- name: release a new version
|
||||||
image: thecoopcloud/drone-abra:latest
|
image: plugins/downstream
|
||||||
settings:
|
settings:
|
||||||
command: recipe mediawiki release
|
server: https://build.coopcloud.tech
|
||||||
deploy_key:
|
token:
|
||||||
from_secret: abra_bot_deploy_key
|
from_secret: drone_abra-bot_token
|
||||||
|
fork: true
|
||||||
|
repositories:
|
||||||
|
- coop-cloud/auto-recipes-catalogue-json
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event: tag
|
||||||
|
@ -13,6 +13,8 @@ MEDIAWIKI_LOGO_FILE='$wgResourceBasePath/resources/assets/wiki.png'
|
|||||||
|
|
||||||
MEDIAWIKI_IS_PRIVATE=1
|
MEDIAWIKI_IS_PRIVATE=1
|
||||||
|
|
||||||
|
MEDIAWIKI_DEBUG=0
|
||||||
|
|
||||||
## SMTP
|
## SMTP
|
||||||
#SMTP_HOST=postfix_relay_app
|
#SMTP_HOST=postfix_relay_app
|
||||||
#SMTP_HOST=mailu_front
|
#SMTP_HOST=mailu_front
|
||||||
|
@ -166,24 +166,38 @@ wfLoadExtension( 'PluggableAuth' );
|
|||||||
wfLoadExtension( 'SimpleSAMLphp' );
|
wfLoadExtension( 'SimpleSAMLphp' );
|
||||||
|
|
||||||
$wgSimpleSAMLphp_InstallDir = "/var/simplesamlphp/";
|
$wgSimpleSAMLphp_InstallDir = "/var/simplesamlphp/";
|
||||||
$wgSimpleSAMLphp_AuthSourceId = "{{ env "SAML_AUTH_SOURCE_ID" }}";
|
|
||||||
$wgSimpleSAMLphp_RealNameAttribute = "{{ env "SAML_REAL_NAME_ATTRIBUTE" }}";
|
$wgPluggableAuth_Config['Log in using my SAML'] = [
|
||||||
$wgSimpleSAMLphp_EmailAttribute = "{{ env "SAML_EMAIL_ATTRIBUTE" }}";
|
'plugin' => 'SimpleSAMLphp',
|
||||||
$wgSimpleSAMLphp_UsernameAttribute = "{{ env "SAML_USERNAME_ATTRIBUTE" }}";
|
'data' => [
|
||||||
|
'authSourceId' => '{{ env "SAML_AUTH_SOURCE_ID" }}',
|
||||||
|
'usernameAttribute' => '{{ env "SAML_USERNAME_ATTRIBUTE" }}',
|
||||||
|
'realNameAttribute' => '{{ env "SAML_REAL_NAME_ATTRIBUTE" }}',
|
||||||
|
'emailAttribute' => '{{ env "SAML_EMAIL_ATTRIBUTE" }}'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
||||||
$wgGroupPermissions['*']['createaccount'] = false;
|
$wgGroupPermissions['*']['createaccount'] = false;
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if eq (env "MEDIAWIKI_DEBUG") "1" }}
|
||||||
$wgDebugLogFile = "/var/log/debug-{$wgDBname}.log";
|
$wgDebugLogFile = "/var/log/debug-{$wgDBname}.log";
|
||||||
|
$wgShowExceptionDetails = true;
|
||||||
|
$wgDebugToolbar = true;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if eq (env "OPENID_ENABLED") "1" }}
|
{{ if eq (env "OPENID_ENABLED") "1" }}
|
||||||
wfLoadExtension( 'PluggableAuth' );
|
wfLoadExtension( 'PluggableAuth' );
|
||||||
wfLoadExtension( 'OpenIDConnect' );
|
wfLoadExtension( 'OpenIDConnect' );
|
||||||
|
|
||||||
$wgOpenIDConnect_Config['{{ env "OPENID_KEYCLOAK_URL" }}'] = [
|
$wgPluggableAuth_Config[] = [
|
||||||
'clientID' => '{{ env "OPENID_CLIENT_ID"}}',
|
'plugin' => 'OpenIDConnect',
|
||||||
'clientsecret' => '{{ secret "openid_client_secret" }}'
|
'data' => [
|
||||||
|
'providerURL' => '{{ env "OPENID_KEYCLOAK_URL" }}',
|
||||||
|
'clientID' => '{{ env "OPENID_CLIENT_ID"}}',
|
||||||
|
'clientsecret' => '{{ secret "openid_client_secret" }}'
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
||||||
|
22
README.md
22
README.md
@ -1,8 +1,6 @@
|
|||||||
# Mediawiki
|
# Mediawiki
|
||||||
|
|
||||||
[](https://drone.autonomic.zone/coop-cloud/mediawiki)
|
[](https://build.coopcloud.tech/coop-cloud/mediawiki)
|
||||||
|
|
||||||
Mediawiki [version 1.35][mediawiki-1.35]
|
|
||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
* **Category**: Apps
|
* **Category**: Apps
|
||||||
@ -21,20 +19,20 @@ Mediawiki [version 1.35][mediawiki-1.35]
|
|||||||
2. Deploy [`coop-cloud/traefik`][traefik]
|
2. Deploy [`coop-cloud/traefik`][traefik]
|
||||||
3. `abra app new mediawiki --secrets` (optionally with `--pass` if you'd like
|
3. `abra app new mediawiki --secrets` (optionally with `--pass` if you'd like
|
||||||
to save secrets in `pass`)
|
to save secrets in `pass`)
|
||||||
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
|
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
|
||||||
your Docker swarm box
|
your Docker swarm box
|
||||||
5. `abra app YOURAPPDOMAIN deploy`
|
5. `abra app deploy YOURAPPDOMAIN`
|
||||||
6. Create an initial admin user:
|
6. Create an initial admin user:
|
||||||
`abra app YOURAPPDOMAIN run app php /var/www/html/maintenance/createAndPromote.php --sysop YourUsername YourPassword`
|
`abra app run YOURAPPDOMAIN app php /var/www/html/maintenance/createAndPromote.php --sysop YourUsername YourPassword`
|
||||||
|
|
||||||
## Email
|
## Email
|
||||||
|
|
||||||
1. `abra app YOURAPPDOMAIN config` - edit `.envrc` and uncomment the `SMTP` lines. Set `SMTP_HOST` to
|
1. `abra app config YOURAPPDOMAIN` - edit `.envrc` and uncomment the `SMTP` lines. Set `SMTP_HOST` to
|
||||||
`postfix_relay` for `coop-cloud/postfix_relay`, or `mailu_front` for
|
`postfix_relay` for `coop-cloud/postfix_relay`, or `mailu_front` for
|
||||||
`coop-cloud/mailu` (assuming default stack names)
|
`coop-cloud/mailu` (assuming default stack names)
|
||||||
2. For `postfix_relay`, add the domain to your email config – `EXTRA_SENDER_DOMAINS` in
|
2. For `postfix_relay`, add the domain to your email config – `EXTRA_SENDER_DOMAINS` in
|
||||||
`postfix_relay`. This doesn't seem to be required for Mailu.
|
`postfix_relay`. This doesn't seem to be required for Mailu.
|
||||||
3. `abra app YOURAPPDOMAIN deploy`
|
3. `abra app deploy YOURAPPDOMAIN`
|
||||||
|
|
||||||
## Single Sign On
|
## Single Sign On
|
||||||
|
|
||||||
@ -48,13 +46,13 @@ This app includes optional SAML Single Sign On using
|
|||||||
NOTE: currently, if you enable SAML then it'll disable Mediawiki's own user account
|
NOTE: currently, if you enable SAML then it'll disable Mediawiki's own user account
|
||||||
system. Patches to make this configurable are welcome!
|
system. Patches to make this configurable are welcome!
|
||||||
|
|
||||||
1. `abra app YOURAPPDOMAIN config` - uncomment lines in the `SAML` section (including `COMPOSE_FILE`)
|
1. `abra app config YOURAPPDOMAIN` - uncomment lines in the `SAML` section (including `COMPOSE_FILE`)
|
||||||
2. Generate secrets: (add `--pass` if you want to store secrets in `pass`)
|
2. Generate secrets: (add `--pass` if you want to store secrets in `pass`)
|
||||||
```
|
```
|
||||||
abra app YOURAPPDOMAIN secret generate saml_admin_password v1
|
abra app YOURAPPDOMAIN secret generate saml_admin_password v1
|
||||||
abra app YOURAPPDOMAIN secret generate saml_secret_salt v1 "pwgen -n 64 1"
|
abra app YOURAPPDOMAIN secret generate saml_secret_salt v1 "pwgen -n 64 1"
|
||||||
```
|
```
|
||||||
3. `abra app YOURAPPDOMAIN deploy`
|
3. `abra app deploy YOURAPPDOMAIN`
|
||||||
4. Copy your SimpleSAMLphp metadata and certificates to the container (assuming
|
4. Copy your SimpleSAMLphp metadata and certificates to the container (assuming
|
||||||
you have local `metadata` and `cert` folders:
|
you have local `metadata` and `cert` folders:
|
||||||
```
|
```
|
||||||
@ -72,14 +70,14 @@ system. Patches to make this configurable are welcome!
|
|||||||
|
|
||||||
### OpenID Connect
|
### OpenID Connect
|
||||||
|
|
||||||
1. `abra app YOURAPPDOMAIN config` - uncomment lines in the `OPENID` section (including `COMPOSE_FILE`)
|
1. `abra app config YOURAPPDOMAIN` - uncomment lines in the `OPENID` section (including `COMPOSE_FILE`)
|
||||||
2. Store your Keycloak-generated client secret in Docker:
|
2. Store your Keycloak-generated client secret in Docker:
|
||||||
|
|
||||||
```
|
```
|
||||||
abra app YOURAPPDOMAIN secret insert openid_client_secret v1 put-your-secret-here
|
abra app YOURAPPDOMAIN secret insert openid_client_secret v1 put-your-secret-here
|
||||||
```
|
```
|
||||||
|
|
||||||
3. `abra app YOURAPPDOMAIN deploy`
|
3. `abra app deploy YOURAPPDOMAIN`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
6
abra.sh
6
abra.sh
@ -1,10 +1,10 @@
|
|||||||
export LOCAL_SETTINGS_CONF_VERSION=v2
|
export LOCAL_SETTINGS_CONF_VERSION=v6
|
||||||
export HTACCESS_CONF_VERSION=v1
|
export HTACCESS_CONF_VERSION=v1
|
||||||
export ENTRYPOINT_CONF_VERSION=v2
|
export ENTRYPOINT_CONF_VERSION=v3
|
||||||
export COMPOSER_LOCAL_CONF_VERSION=v1
|
export COMPOSER_LOCAL_CONF_VERSION=v1
|
||||||
export PHP_INI_VERSION=v1
|
export PHP_INI_VERSION=v1
|
||||||
|
|
||||||
export SAML_ENTRYPOINT_CONF_VERSION=v1
|
export SAML_ENTRYPOINT_CONF_VERSION=v3
|
||||||
|
|
||||||
abra_backup_app() {
|
abra_backup_app() {
|
||||||
_abra_backup_dir "app:/var/www/html/images"
|
_abra_backup_dir "app:/var/www/html/images"
|
||||||
|
@ -5,7 +5,12 @@ services:
|
|||||||
app:
|
app:
|
||||||
volumes:
|
volumes:
|
||||||
- "simplesaml:/var/simplesamlphp/"
|
- "simplesaml:/var/simplesamlphp/"
|
||||||
|
- "simplesaml_cert:/var/simplesamlphp/cert"
|
||||||
|
- "simplesaml_config:/var/simplesamlphp/config"
|
||||||
|
- "simplesaml_data:/var/simplesamlphp/data"
|
||||||
- "simplesaml_log:/var/simplesamlphp/log"
|
- "simplesaml_log:/var/simplesamlphp/log"
|
||||||
|
- "simplesaml_metadata:/var/simplesamlphp/metadata"
|
||||||
|
- "simplesaml_modules:/var/simplesamlphp/modules"
|
||||||
environment:
|
environment:
|
||||||
- SAML_AUTH_SOURCE_ID
|
- SAML_AUTH_SOURCE_ID
|
||||||
- SAML_EMAIL_ATTRIBUTE
|
- SAML_EMAIL_ATTRIBUTE
|
||||||
@ -14,7 +19,8 @@ services:
|
|||||||
- SAML_USERNAME_ATTRIBUTE
|
- SAML_USERNAME_ATTRIBUTE
|
||||||
|
|
||||||
simplesaml:
|
simplesaml:
|
||||||
image: venatorfox/simplesamlphp:1.18.3
|
# image: unicon/simplesamlphp:1.19.6
|
||||||
|
image: git.coopcloud.tech/coop-cloud-chaos-patchs/simplesamlphp:1.19.7
|
||||||
secrets:
|
secrets:
|
||||||
- saml_admin_password
|
- saml_admin_password
|
||||||
- saml_secret_salt
|
- saml_secret_salt
|
||||||
@ -47,7 +53,12 @@ services:
|
|||||||
mode: 0555
|
mode: 0555
|
||||||
volumes:
|
volumes:
|
||||||
- simplesaml:/var/simplesamlphp/
|
- simplesaml:/var/simplesamlphp/
|
||||||
- simplesaml_log:/var/simplesamlphp/log
|
- "simplesaml_cert:/var/simplesamlphp/cert"
|
||||||
|
- "simplesaml_config:/var/simplesamlphp/config"
|
||||||
|
- "simplesaml_data:/var/simplesamlphp/data"
|
||||||
|
- "simplesaml_log:/var/simplesamlphp/log"
|
||||||
|
- "simplesaml_metadata:/var/simplesamlphp/metadata"
|
||||||
|
- "simplesaml_modules:/var/simplesamlphp/modules"
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
entrypoint: /docker-entrypoint.simplesaml.sh
|
entrypoint: /docker-entrypoint.simplesaml.sh
|
||||||
@ -62,7 +73,12 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
simplesaml:
|
simplesaml:
|
||||||
|
simplesaml_cert:
|
||||||
|
simplesaml_config:
|
||||||
|
simplesaml_data:
|
||||||
simplesaml_log:
|
simplesaml_log:
|
||||||
|
simplesaml_metadata:
|
||||||
|
simplesaml_modules:
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
saml_admin_password:
|
saml_admin_password:
|
||||||
|
@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: mediawiki:1.37.1
|
image: mediawiki:1.39.3
|
||||||
environment:
|
environment:
|
||||||
- DOMAIN
|
- DOMAIN
|
||||||
- STACK_NAME
|
- STACK_NAME
|
||||||
@ -13,6 +13,7 @@ services:
|
|||||||
- MEDIAWIKI_SITENAMESPACE
|
- MEDIAWIKI_SITENAMESPACE
|
||||||
- MEDIAWIKI_LOGO_FILE
|
- MEDIAWIKI_LOGO_FILE
|
||||||
- MEDIAWIKI_IS_PRIVATE
|
- MEDIAWIKI_IS_PRIVATE
|
||||||
|
- MEDIAWIKI_DEBUG
|
||||||
- SAML_ENABLED
|
- SAML_ENABLED
|
||||||
- OPENID_ENABLED
|
- OPENID_ENABLED
|
||||||
- DB_HOST=db
|
- DB_HOST=db
|
||||||
@ -44,11 +45,11 @@ services:
|
|||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.1.0+1.37.1"
|
- "coop-cloud.${STACK_NAME}.version=2.2.2+1.39.1"
|
||||||
entrypoint: /docker-entrypoint2.sh
|
entrypoint: /docker-entrypoint2.sh
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.8
|
image: mariadb:10.10
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_USER=mediawiki
|
- MYSQL_USER=mediawiki
|
||||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
||||||
|
@ -8,7 +8,7 @@ init_composer() {
|
|||||||
if ! type composer > /dev/null 2>&1; then
|
if ! type composer > /dev/null 2>&1; then
|
||||||
apt update -yqq && apt install -yqq curl git unzip zip
|
apt update -yqq && apt install -yqq curl git unzip zip
|
||||||
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
|
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
|
||||||
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.15
|
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.5.4
|
||||||
composer -V
|
composer -V
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -51,14 +51,14 @@ init_db() {
|
|||||||
|
|
||||||
init_extensions() {
|
init_extensions() {
|
||||||
if [ ! -d /var/www/html/extensions/PluggableAuth ]; then
|
if [ ! -d /var/www/html/extensions/PluggableAuth ]; then
|
||||||
git clone --depth 1 -b REL1_32 \
|
git clone --depth 1 -b REL1_39 \
|
||||||
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \
|
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \
|
||||||
/var/www/html/extensions/PluggableAuth
|
/var/www/html/extensions/PluggableAuth
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${SAML_ENABLED-}" ]; then
|
if [ -n "${SAML_ENABLED-}" ]; then
|
||||||
if [ ! -d /var/www/html/extensions/SimpleSAMLphp ]; then
|
if [ ! -d /var/www/html/extensions/SimpleSAMLphp ]; then
|
||||||
git clone --depth 1 -b REL1_32 \
|
git clone --depth 1 -b REL1_39 \
|
||||||
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SimpleSAMLphp \
|
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SimpleSAMLphp \
|
||||||
/var/www/html/extensions/SimpleSAMLphp
|
/var/www/html/extensions/SimpleSAMLphp
|
||||||
fi
|
fi
|
||||||
@ -66,7 +66,7 @@ init_extensions() {
|
|||||||
|
|
||||||
if [ -n "${OPENID_ENABLED-}" ]; then
|
if [ -n "${OPENID_ENABLED-}" ]; then
|
||||||
if [ ! -d /var/www/html/extensions/OpenIDConnect ]; then
|
if [ ! -d /var/www/html/extensions/OpenIDConnect ]; then
|
||||||
git clone --depth 1 -b REL1_35 \
|
git clone --depth 1 -b REL1_39 \
|
||||||
https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenIDConnect \
|
https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenIDConnect \
|
||||||
/var/www/html/extensions/OpenIDConnect
|
/var/www/html/extensions/OpenIDConnect
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user