159 Commits

Author SHA1 Message Date
3wc
0db71c1730 Add MEDIAWIKI_PROXY_SERVERS setting 2023-09-03 16:51:14 +02:00
3wc
3e3482b89e chore: publish 2.5.0+1.39.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-23 15:52:31 +01:00
3wc
3018af9382 Add backup/restore labels
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-23 15:52:03 +01:00
40831b5d91 chore: publish 2.4.0+1.39.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-30 14:46:57 +02:00
d63e412256 Merge pull request 'Fix new deployments?' (#34) from fix-new-deploy into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #34
2023-06-30 11:04:23 +00:00
3c4332f794 Merge pull request 'Allow open registration' (#37) from iexos/mediawiki:registration into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #37
2023-06-30 10:33:25 +00:00
08d7201772 enable registration
Some checks failed
continuous-integration/drone/pr Build is failing
2023-06-30 11:17:54 +02:00
0fb7f2bd7f Merge pull request 'Add remote SMTP' (#36) from iexos/mediawiki:remote-smtp into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #36
2023-06-30 08:55:33 +00:00
639cadaa17 add remote smtp
Some checks failed
continuous-integration/drone/pr Build is failing
2023-06-30 10:39:25 +02:00
5096046a86 Merge pull request 'Make language configurable' (#35) from iexos/mediawiki:add-lang-conf into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #35
2023-06-29 16:30:40 +00:00
de60261fce point to list of language options
Some checks failed
continuous-integration/drone/pr Build is failing
2023-06-29 18:29:40 +02:00
7d1810cf93 add MEDIAWIKI_LANGUAGE to compose.yml with default
Some checks failed
continuous-integration/drone/pr Build is failing
2023-06-29 15:46:31 +02:00
5159ed1b36 enable choice of language
Some checks failed
continuous-integration/drone/pr Build is failing
2023-06-28 18:10:57 +02:00
3wc
e6f77b37e6 Fix new deployments?
Some checks failed
continuous-integration/drone/pr Build is failing
Re: #33
2023-06-25 21:17:02 +01:00
3wc
260dd4d7f3 chore: publish 2.3.0+1.39.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-22 11:03:36 +01:00
57cf8db271 Merge pull request 'Add support for SemanticMediaWiki, MobileFrontend, MsUpload, PageForms, PageSchemas, WikiMarkdown, Tweeki' (#31) from flancian/wiki.social.coop:main into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #31
2023-05-30 23:00:40 +00:00
0c50c3398f Use tabs ;)
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-30 23:50:22 +02:00
e2ca6b6df4 Add MobileFrontend support and fix issues spotted during PR review :D
Some checks failed
continuous-integration/drone/pr Build is failing
#31
2023-05-30 23:46:40 +02:00
b78c20fe41 Disable Tweeki skin by default as it's a bit opinionated/non-standard.
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-28 15:21:12 +02:00
112bd3300f Disable parsoid, it's no longer needed.
Some checks failed
continuous-integration/drone/pr Build is failing
This applies changes from #32 independently; I believe the result should be a clean merge.
2023-05-28 15:19:13 +02:00
cc3682ef89 Merge branch 'main' into main
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-15 17:44:27 +00:00
b1d3e2a0f9 Add Tweeki to sample.
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-15 01:11:37 +02:00
7ca11b8bc9 Add Tweeki skin as option. 2023-05-15 01:10:00 +02:00
3wc
e8fc7e6532 chore: publish 2.2.3+1.39.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-12 22:47:47 +01:00
381a3ee2d6 Merge pull request 'Chore: Bump mediawiki to version 1.39.3.' (#30) from samwightt/mediawiki:main into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #30
2023-05-12 21:46:57 +00:00
f2afce4145 Chore: Bump mediawiki to version 1.39.3.
Some checks failed
continuous-integration/drone/pr Build is failing
2023-05-12 10:24:28 -05:00
a931c54b31 Make MEDIAWIKI_DEBUG also control level of PHP warnings shown. 2023-05-08 22:32:54 +02:00
3101cff3e8 SemanticMediaWiki now works -- after installing with composer :) 2023-05-08 22:25:52 +02:00
2dd1c7aeee Fix example OpenID URL; keycloak doesn't expect /auth/ here it seems. 2023-04-01 22:39:09 +02:00
f509f7b830 Bump LocalSettings and Entrypoint versions. 2023-04-01 22:32:30 +02:00
ff2d004bcf Add LocalSettings changes for the extensions in the previous commit. 2023-04-01 21:53:04 +02:00
917eb68ae7 First stab at adding extensions:
- MsUpload
- PageForms
- PageSchemas
- SemanticMediaWiki
- WikiMarkdown
2023-04-01 21:09:11 +02:00
3wc
2ad502e4fa Fix build status URL, drop redundant version
[ci skip]
2023-03-28 11:32:38 -04:00
3wc
9ee106a2ed chore: publish 2.2.2+1.39.1 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-28 11:08:31 -04:00
bce93ab727 Merge pull request 'Update LocalSettings.php.tmpl to match new configuration syntax.' (#29) from flancian/wiki.social.coop:main into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #29
2023-03-28 14:36:47 +00:00
8c503d5d28 Update LocalSettings.php.tmpl to match new configuration syntax.
Some checks failed
continuous-integration/drone/pr Build is failing
This syntax follows that at
https://www.mediawiki.org/wiki/Extension:OpenID_Connect.
2023-03-28 12:13:12 +02:00
3wc
d7d228ab7e chore: publish 2.2.1+1.39.1 release
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-03-11 20:38:01 -05:00
3wc
ae116a9954 Bump PHP composer version to 2.5.4 2023-03-11 20:14:00 -05:00
3wc
a71d9195e8 Update to new SimpleSAML
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-24 19:54:23 -08:00
3wc
f18c9882df Add debugging option 2023-01-24 19:54:00 -08:00
3wc
ffcf336329 Switch to self-hosted stack-ssh-deploy image [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-21 11:49:56 -08:00
3wc
7e8c307936 Fix CI by adding networks: [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-20 11:58:41 -08:00
3wc
463d606257 Automatically generate catalogue on release [mass update]
Some checks failed
continuous-integration/drone/push Build is failing
Re: coop-cloud/recipes-catalogue-json#4
2023-01-20 10:27:11 -08:00
3wc
bf2fcbd7b4 Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:28 -08:00
bde470d4f9 Fix composer and extension versions
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-17 19:26:05 -08:00
c377ae6620 chore: publish 2.2.0+1.39.1 release
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-17 10:50:28 -08:00
3wc
de6e1d415e chore: publish 2.1.0+1.37.1 release
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-02 14:02:39 +02:00
3wc
f33004bb86 Goodbye, emojis! 😢
[ci skip]
2021-11-23 12:19:05 +02:00
1ae1e2f399 chore: release with pinned simplesamlphp
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-12 13:00:03 +02:00
9c7206341a chore: first release
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-12 12:56:01 +02:00
f4f519eda3 Revert internal network change (see https://git.autonomic.zone/coop-cloud/organising/issues/62)
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2021-07-15 16:08:09 +02:00
ae017b27cf Version 1.36.1; sync labels
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-10 13:19:52 +00:00
5f9ca3bbf5 Scope internal network internally
Some checks failed
continuous-integration/drone/push Build is failing
2021-07-10 15:19:37 +02:00
b7817b1e13 Version 1.36.1; sync labels
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-29 07:02:52 +00:00
ac39c45ddd Update mediawiki Docker tag to v1.36.1
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
2021-06-29 07:02:31 +00:00
b5b97d0456 Version 1.36.0; sync labels
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-21 10:31:43 +00:00
544c5bc46e Use new image namespace
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-21 12:31:32 +02:00
3wc
868bf7d089 Fix private wiki setting
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-13 23:16:46 +02:00
3wc
86c4834a1a Version 1.36.0; sync labels
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-13 21:08:28 +00:00
3wc
af0be5e0f7 Version 1.36.0; sync labels
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-13 23:08:08 +02:00
7e52d0c4ac Remove trigger, we make the tags [ci skip] 2021-06-04 00:14:58 +02:00
bf06d0f74a Fix bad name in batch update script [ci skip] 2021-06-03 23:06:49 +02:00
ecdc065abc Add release logic to CI [ci skip] 2021-06-03 23:00:58 +02:00
87cda2a339 Merge pull request 'Update mediawiki Docker tag to v1.36.0 (main)' (#24) from renovate/main-docker-mediawiki-1.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.autonomic.zone/coop-cloud/mediawiki/pulls/24
2021-06-02 09:58:41 +02:00
18519c85d8 Update mediawiki Docker tag to v1.36.0
Some checks failed
continuous-integration/drone/pr Build is failing
2021-06-02 07:03:02 +00:00
f6a31fc61a Version 1.35.2_1; sync labels
Some checks failed
continuous-integration/drone/push Build is failing
2021-05-03 09:32:18 +02:00
2ce032c3f3 Merge pull request 'Update mariadb Docker tag to v10.6 (main)' (#23) from renovate/main-docker-mariadb-10.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.autonomic.zone/coop-cloud/mediawiki/pulls/23
2021-05-03 09:31:56 +02:00
863dc85219 Update mariadb Docker tag to v10.6
Some checks failed
continuous-integration/drone/pr Build is failing
2021-04-30 07:02:00 +00:00
deeb01b37b Version 1.35.2; sync labels
Some checks failed
continuous-integration/drone/push Build is failing
2021-04-16 09:25:36 +02:00
460280b3ec Merge pull request 'Update mediawiki Docker tag to v1.35.2 (main)' (#22) from renovate/main-docker-mediawiki-1.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.autonomic.zone/coop-cloud/mediawiki/pulls/22
2021-04-16 09:25:12 +02:00
9666dc7fd9 Update mediawiki Docker tag to v1.35.2
Some checks failed
continuous-integration/drone/pr Build is failing
2021-04-12 07:01:54 +00:00
3wc
ca59d303e0 Auto-add service labels
All checks were successful
continuous-integration/drone/push Build is passing
2021-04-04 13:39:38 +02:00
3wc
07125f9886 Bump LOCAL_SETTINGS_CONF_VERSION 2021-04-04 13:39:14 +02:00
88479710e7 Remove old version handling
Some checks failed
continuous-integration/drone/push Build is failing
2021-04-02 21:17:53 +02:00
00ec06fa1c Drop whitespace
All checks were successful
continuous-integration/drone/push Build is passing
2021-03-16 09:27:51 +01:00
ec4dbb56b4 Add versions for mediawiki 2021-03-16 09:27:32 +01:00
3wc
5a8523e5eb Follow new exciting README standard
All checks were successful
continuous-integration/drone/push Build is passing
See coop-cloud/organising#31
2021-03-02 18:38:38 +02:00
3wc
49b14595d4 Add backup/restore functionality
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-24 16:55:36 +02:00
3wc
4812fc9829 Tweak DB initialisation
All checks were successful
continuous-integration/drone/push Build is passing
Fixes #21
2021-02-17 18:21:51 +02:00
5433215642 Skip 5 second wait on update work
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-17 09:40:28 +01:00
4784ab5ccc Remove extra proxy spec
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 17:17:43 +01:00
3839409ad0 Also quiten that update and install too
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 17:13:58 +01:00
d33526426c Quiten update also 2021-02-16 17:10:31 +01:00
aafd4720b8 Quiten down apt install
Some checks failed
continuous-integration/drone/push Build is failing
2021-02-16 17:09:47 +01:00
985cf60aff Rename function and shuffle to top again
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 17:09:17 +01:00
78b22bea7a Install extensions at the end
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 17:01:47 +01:00
5b81580384 Drop default header
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 17:00:43 +01:00
50ce5f5292 Use defaults here
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 15:33:37 +01:00
8e7234eae7 Don't need to quote that 2021-02-16 15:33:26 +01:00
29a72bdc56 Drop non-swarm recognised stanza 2021-02-16 15:33:13 +01:00
7fd0d10a1d Run uppdate for extension once DB is up
All checks were successful
continuous-integration/drone/push Build is passing
See https://git.autonomic.zone/coop-cloud/mediawiki/issues/21.
2021-02-16 15:22:51 +01:00
d3268093cc Revert "Install extensions after DB is up"
This reverts commit 2dbd27028f.

Not the right fix!

See  https://git.autonomic.zone/coop-cloud/mediawiki/issues/21.
2021-02-16 15:20:16 +01:00
2dbd27028f Install extensions after DB is up
All checks were successful
continuous-integration/drone/push Build is passing
Closes https://git.autonomic.zone/coop-cloud/mediawiki/issues/21.
2021-02-16 15:17:19 +01:00
17e898e3a9 Allow to configure privateness
All checks were successful
continuous-integration/drone/push Build is passing
Closes https://git.autonomic.zone/coop-cloud/mediawiki/issues/18.
2021-02-16 13:36:33 +01:00
ee831dabc0 Run formatter
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 12:58:09 +01:00
e7f31c881e Use TYPE naming
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-16 12:51:49 +01:00
3wc
91fdace2fb Move config to abra.sh
Some checks failed
continuous-integration/drone/push Build is failing
Ref coop-cloud/abra#43
2021-02-08 15:29:33 +02:00
3wc
f9d24121c7 APP → TYPE
All checks were successful
continuous-integration/drone/push Build is passing
Ref coop-cloud/abra#47
2020-12-31 22:55:31 +02:00
3wc
e35ed6c673 Switch from envrc → env format
All checks were successful
continuous-integration/drone/push Build is passing
Ref coop-cloud/abra#40
2020-12-30 13:23:03 +02:00
3wc
543264e26c Update Drone for new variable names
All checks were successful
continuous-integration/drone/push Build is passing
2020-12-27 21:42:24 +02:00
3wc
96a96c22e6 Update README
Some checks failed
continuous-integration/drone/push Build is failing
2020-12-27 15:55:45 +02:00
3wc
b2034900bf Ad SECRET_ to secret names so abra can find them 2020-12-27 15:55:26 +02:00
0467f8b7c0 Merge pull request 'Update mediawiki Docker tag to v1.35.1' (#20) from renovate/docker-mediawiki-1.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.autonomic.zone/coop-cloud/mediawiki/pulls/20
2020-12-22 12:04:56 +01:00
0d4b62528e Update mediawiki Docker tag to v1.35.1
Some checks failed
continuous-integration/drone/pr Build is failing
2020-12-22 08:01:09 +00:00
3wc
13b9306858 Remove needless compose.mailrelay.yml
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-06 19:29:13 +02:00
3wc
c581eeeae5 Tell drone about PHP_INI_VERSION
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-30 18:37:42 +02:00
ceca47f3b4 Add template file ending
Some checks failed
continuous-integration/drone/push Build is failing
2020-10-30 14:26:58 +01:00
8add2bd87f Switch over to php.ini file
Some checks failed
continuous-integration/drone/push Build is failing
2020-10-30 14:26:05 +01:00
593f76df19 Allow to configure upload limits
Some checks failed
continuous-integration/drone/push Build is failing
2020-10-30 14:03:38 +01:00
c897d91b3e Add 10mb upload limit
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-30 13:56:47 +01:00
3faff06899 Extend upload options
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-30 13:50:10 +01:00
3wc
439fb807af Remove STACK_NAME
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-29 19:52:32 +02:00
3wc
9ef3d8aa74 Gardening 🌱 2020-10-29 19:48:37 +02:00
5a128a95c3 Merge pull request 'Update thenets/parsoid Docker tag to v0.11.0' (#16) from renovate/docker-thenets-parsoid-0.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.autonomic.zone/coop-cloud/mediawiki/pulls/16
2020-10-28 09:48:10 +01:00
98e99f81e7 Update thenets/parsoid Docker tag to v0.11.0
Some checks failed
continuous-integration/drone/pr Build is failing
2020-10-28 08:01:37 +00:00
3wc
c7e7a5cdab Fix Mailu instructions
[ci skip]
2020-10-24 20:13:39 +02:00
3wc
8490d0151a Better SMTP settings
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-24 19:04:24 +02:00
3wc
a8b31310ba Further post-image-switch tidying
Ref #8
2020-10-24 19:04:24 +02:00
0e196b33d2 Update README to match new changes
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-24 15:46:39 +02:00
3wc
f4ca10b3d9 Add missing compose.mailrelay.yml
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-24 04:07:18 +02:00
3wc
f05d45ee52 Switch to official Mediawiki image + update to 1.35
All checks were successful
continuous-integration/drone/push Build is passing
Closes #4, #8
2020-10-24 03:58:58 +02:00
3wc
db6595c52c Load interwiki tables, + tidying 2020-10-24 03:58:37 +02:00
8bcccca575 Add missing logo file threading
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 18:11:34 +02:00
ddc59b7cc0 Also follow SAML on user account stuff
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:54:12 +02:00
7da9a97788 Update then install
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:33:22 +02:00
b2d86119b1 Remove unknown package
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:30:15 +02:00
6fa1a5fd12 Add missing zip dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:25:14 +02:00
9e950e7318 Fix typo
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:22:57 +02:00
0c914c0bbf Also run the update script for openid plugin
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 17:04:10 +02:00
48bc08e063 Fix name of secret 2020-10-19 17:00:05 +02:00
64cbefc18e Add missing config for openid config
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 16:56:50 +02:00
3c60a73dc9 Rename composer local file
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-19 16:53:12 +02:00
3ffc239373 First attempt at OpenID login
All checks were successful
continuous-integration/drone/push Build is passing
See https://git.autonomic.zone/compose-stacks/mediawiki/issues/14.
2020-10-19 16:50:57 +02:00
d75e15310c Fix URL
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-15 18:26:40 +02:00
2a94408ddf Appease formatter
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-15 18:24:16 +02:00
d5eb7a47d1 Drop unzip, not needed 2020-10-15 18:24:09 +02:00
353d6eb4b5 Install optional OpenIDConnect extension 2020-10-15 18:23:45 +02:00
b0c5673cc0 Push composer stuff out of other function
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-15 18:11:54 +02:00
9820952cbc Clean up php composer installation
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-15 18:03:02 +02:00
33e70d62a4 Hack composer into the entrypoint
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-15 16:26:32 +02:00
3wc
08b5c1f53e Add optional SMTP relaying ..
All checks were successful
continuous-integration/drone/push Build is passing
..+ small README update
2020-10-06 17:43:34 +02:00
3wc
475490f3ed Rejig .envrc.sample
[ci skip]
2020-10-06 01:52:00 +02:00
3wc
b2aeefdcc0 Add Drone CI
[ci skip]
2020-10-06 01:35:14 +02:00
3wc
d11b7ec77c Add Drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-06 01:34:40 +02:00
3wc
6e10ec2d24 Rename services, add EXTRA_DOMAINS
See compose-stacks/organising#15 & compose-stacks/organising#19
2020-10-06 01:32:46 +02:00
3wc
ecf91f0154 Tidy, update for latest abra 2020-09-22 20:12:24 +02:00
3wc
c6c836d4fd Tweak README 2020-09-19 12:09:49 +02:00
3wc
15fbe13953 Merge branch 'simplesaml' into main 2020-09-18 23:35:29 +02:00
3wc
bae33cacd9 Make SimpleSAML optional using separate compose 2020-09-18 23:35:20 +02:00
3wc
2aac2eb0c5 Merge branch 'main' into simplesaml 2020-09-18 20:42:07 +02:00
3wc
ec4c8afcea Customisable logo path 2020-09-18 20:41:10 +02:00
3wc
b326e20c4c Enable Interwiki, Cite, ParserFunctions 2020-09-18 00:28:35 +02:00
3wc
7e83649250 Remove memcached for now 2020-09-17 09:20:54 +02:00
3wc
6cfd4ed902 Working SimpleSAML config
Ref #3
2020-09-16 22:19:23 +02:00
7c3abb0e20 Merge pull request 'Configure Renovate' (#9) from renovate/configure into main
Reviewed-on: https://git.autonomic.zone/compose-stacks/mediawiki/pulls/9
2020-09-15 08:53:29 +02:00
14ba873824 Add renovate.json 2020-09-14 20:02:21 +00:00
3wc
40007e53b3 Working SimpleSAML 2020-09-13 14:57:12 +02:00
3wc
36feb5062d First stab at SimpleSAMLPHP
Main issue is how to customise the virtual host configuration of the
Mediawiki container to pass /simplesamlphp/ through to the right
directory (or reverse proxy to the `simplesamlphp` container)
2020-09-11 19:31:12 +02:00
3wc
3cc586873a Store Mediawiki secret key in Docker etc.
Closes #7
2020-09-08 13:56:17 +02:00
17 changed files with 819 additions and 176 deletions

49
.drone.yml Normal file
View File

@ -0,0 +1,49 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: mediawiki
networks:
- proxy
purge: true
generate_secrets: true
deploy_key:
from_secret: drone_ssh_swarm_test
environment:
DOMAIN: mediawiki.swarm-test.autonomic.zone
STACK_NAME: mediawiki
LETS_ENCRYPT_ENV: production
MEDIAWIKI_SITENAME: "Example Wiki"
MEDIAWIKI_SITENAMESPACE: "Example_Wiki"
MEDIAWIKI_EMAIL_CONTACT: "info@wiki.example.com"
MEDIAWIKI_EMAIL_FROM: "wiki@wiki.example.com"
MEDIAWIKI_LOGO_FILE: '$wgResourceBasePath/resources/assets/wiki.png'
SECRET_DB_ROOT_PASSWORD_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
SECRET_MEDIAWIKI_SECRET_KEY_VERSION: v1
LOCAL_SETTINGS_CONF_VERSION: v1
ENTRYPOINT_CONF_VERSION: v1
PHP_INI_VERSION: v1
trigger:
branch:
- main
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag

87
.env.sample Normal file
View File

@ -0,0 +1,87 @@
TYPE=mediawiki
DOMAIN=mediawiki.example.com
COMPOSE_FILE="compose.yml"
#EXTRA_DOMAINS=', `www.wiki.example.com`'
LETS_ENCRYPT_ENV=production
MEDIAWIKI_SITENAME="Example Wiki"
MEDIAWIKI_SITENAMESPACE="Example_Wiki"
MEDIAWIKI_EMAIL_CONTACT="info@wiki.example.com"
MEDIAWIKI_EMAIL_FROM="wiki@wiki.example.com"
MEDIAWIKI_LOGO_FILE='$wgResourceBasePath/resources/assets/wiki.png'
# list of language options (without ".json"):
# https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/languages/i18n
MEDIAWIKI_LANGUAGE="en"
MEDIAWIKI_IS_PRIVATE=1
MEDIAWIKI_ALLOW_REGISTRATION=0
MEDIAWIKI_DEBUG=0
SECRET_DB_ROOT_PASSWORD_VERSION=v1
SECRET_DB_PASSWORD_VERSION=v1
SECRET_MEDIAWIKI_SECRET_KEY_VERSION=v1 # length=64
# SMTP
## via local postfix/mailu
#SMTP_HOST=postfix_relay_app
#SMTP_HOST=mailu_front
## via remote email provider
#COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml"
#SMTP_HOST="mail.example.com"
#SMTP_PORT=587
#SMTP_USER="${MEDIAWIKI_EMAIL_FROM}"
#SECRET_SMTP_PASSWORD_VERSION=v1
# SAML
#COMPOSE_FILE="$COMPOSE_FILE:compose.simplesaml.yml"
#SAML_ENABLED=1
#SAML_CONTACT_NAME="Sam Ell"
#SAML_CONTACT_EMAIL="saml@example.com"
#SAML_EMAIL_ATTRIBUTE=mail
#SAML_REAL_NAME_ATTRIBUTE=realname
#SAML_AUTH_SOURCE_ID=default-sp
#SAML_USERNAME_ATTRIBUTE=user
#SECRET_SAML_ADMIN_PASSWORD_VERSION=v1
#SECRET_SAML_SECRET_SALT_VERSION=v1 # length=64
## OpenID Connect
# OPENID_ENABLED=1
# COMPOSE_FILE="$COMPOSE_FILE:compose.openid.yml"
# OPENID_KEYCLOAK_URL="https://keycloak.local:8080/realms/acme/"
# OPENID_CLIENT_ID="mediawiki"
# SECRET_OPENID_CLIENT_SECRET_VERSION=v1
## WikiMarkdown
#MARKDOWN_ENABLED=1
## MobileFrontend
#MOBILEFRONTEND_ENABLED=1
## MsUpload
#MSU_ENABLED=1
## PageForms
#PAGEFORMS_ENABLED=1
## PageSchemas
#PAGESCHEMAS_ENABLED=1
## SemanticMediaWiki
#SEMANTICMW_ENABLED=1
## WikiMarkdown
#MARKDOWN_ENABLED=1
## Tweeki skin
#TWEEKI_ENABLED=0

View File

@ -1,15 +0,0 @@
export DOMAIN=wiki.example.com
export STACK_NAME=example_wiki
export LETS_ENCRYPT_ENV=production
export MEDIAWIKI_SITENAME="Example Wiki"
export MEDIAWIKI_SITENAMESPACE="Example_Wiki"
export MEDIAWIKI_EMAIL_CONTACT="info@wiki.example.com"
export MEDIAWIKI_EMAIL_FROM="wiki@wiki.example.com"
export DB_ROOT_PASSWORD_VERSION=v1
export DB_PASSWORD_VERSION=v1
export LOCAL_SETTINGS_CONF_VERSION=v1
export HTACCESS_CONF_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v1

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Revian Labs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,21 +1,10 @@
<?php
# This file was automatically generated by the MediaWiki 1.32.1
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
@ -39,7 +28,7 @@ $wgResourceBasePath = $wgScriptPath;
## The URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
$wgLogo = "{{ env "MEDIAWIKI_LOGO_FILE" }}";
## UPO means: this is also a user preference option
@ -55,9 +44,9 @@ $wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "mariadb";
$wgDBname = "mediawiki";
$wgDBuser = "mediawiki";
$wgDBserver = "{{ env "DB_HOST" }}";
$wgDBname = "{{ env "DB_NAME" }}";
$wgDBuser = "{{ env "DB_USER" }}";
$wgDBpassword = rtrim(file_get_contents('/run/secrets/db_password'));
# MySQL specific settings
@ -95,9 +84,9 @@ $wgShellLocale = "C.UTF-8";
#$wgCacheDirectory = "$IP/cache";
# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";
$wgLanguageCode = "{{ env "MEDIAWIKI_LANGUAGE" }}";
$wgSecretKey = "8a83180cd66683c2a379882211187d6f79a1d40749b962598148f67893ff10cf";
$wgSecretKey = rtrim(file_get_contents('/run/secrets/mediawiki_secret_key'));
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
@ -117,21 +106,48 @@ $wgRightsIcon = "";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# The following permissions were set based on your choice in the installer
{{ if eq (env "MEDIAWIKI_ALLOW_REGISTRATION") "1" }}
$wgGroupPermissions['*']['createaccount'] = true;
$wgEmailConfirmToEdit = true;
{{ else }}
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = false;
{{ end }}
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
$wgGroupPermissions['*']['edit'] = false;
{{ if eq (env "MEDIAWIKI_IS_PRIVATE") "1" }}
$wgGroupPermissions['*']['read'] = false;
{{ else }}
$wgGroupPermissions['*']['read'] = true;
{{ end }}
{{ if ne (env "MEDIAWIKI_PROXY_SERVERS") "" }}
// In LocalSettings.php
$wgUseCdn = true;
$wgCdnServersNoPurge = [];
$wgCdnServersNoPurge[] = "{{ env "MEDIAWIKI_PROXY_SERVERS" }}";
{{ end }}
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
wfLoadSkin( 'MinervaNeue' );
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
{{ if eq (env "TWEEKI_ENABLED") "1" }}
wfLoadSkin( 'Tweeki' );
$wgDefaultSkin = "tweeki";
{{ else }}
$wgDefaultSkin = "vector";
{{ end }}
{{ if eq (env "MOBILEFRONTEND_ENABLED") "1" }}
wfLoadExtension( 'MobileFrontend' );
$wgDefaultMobileSkin = 'minerva';
{{ end }}
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
@ -139,6 +155,10 @@ wfLoadSkin( 'Vector' );
# The following extensions were automatically enabled:
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'ParserFunctions' );
# End of automatically generated settings.
# Add more configuration options below.
@ -146,19 +166,92 @@ $wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVisualEditorAllowLossySwitching = false;
$wgVirtualRestConfig['modules']['parsoid'] = [
// URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
'url' => 'http://localhost:8000/',
// Parsoid "domain" (string, optional) - MediaWiki >= 1.26
'domain' => 'localhost',
// Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
'prefix' => 'localhost',
// Forward cookies in the case of private wikis (string or false, optional)
'forwardCookies' => true,
// request timeout in seconds (integer or null, optional)
'timeout' => null,
// Parsoid HTTP proxy (string or null, optional)
'HTTPProxy' => null,
// whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
'restbaseCompat' => null,
{{ if eq (env "SAML_ENABLED") "1" }}
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'SimpleSAMLphp' );
$wgSimpleSAMLphp_InstallDir = "/var/simplesamlphp/";
$wgPluggableAuth_Config['Log in using my SAML'] = [
'plugin' => 'SimpleSAMLphp',
'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['*']['createaccount'] = false;
{{ end }}
{{ if eq (env "MEDIAWIKI_DEBUG") "1" }}
$wgDebugLogFile = "/var/log/debug-{$wgDBname}.log";
$wgShowExceptionDetails = true;
$wgDebugToolbar = true;
{{ end }}
{{ if eq (env "OPENID_ENABLED") "1" }}
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'OpenIDConnect' );
$wgPluggableAuth_Config[] = [
'plugin' => 'OpenIDConnect',
'data' => [
'providerURL' => '{{ env "OPENID_KEYCLOAK_URL" }}',
'clientID' => '{{ env "OPENID_CLIENT_ID"}}',
'clientsecret' => '{{ secret "openid_client_secret" }}'
]
];
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgGroupPermissions['*']['createaccount'] = false;
{{ end }}
{{ if env "SMTP_HOST" }}
$wgSMTP = [
'host' => '{{ env "SMTP_HOST" }}', // could also be an IP address. Where the SMTP server is located
'port' => {{ env "SMTP_PORT" }}, // Port to use when connecting to the SMTP server
{{ if env "SMTP_USER" }}
'auth' => true, // Should we use SMTP authentication (true or false)
'username' => '{{ env "SMTP_USER" }}', // Username to use for SMTP authentication (if being used)
'password' => '{{ secret "smtp_password" }}' // Password to use for SMTP authentication (if being used)
{{ else }}
'auth' => false
{{ end }}
];
{{ end }}
{{ if eq (env "MSU_ENABLED") "1" }}
wfLoadExtension( 'MsUpload' );
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
{{ end }}
{{ if eq (env "PAGEFORMS_ENABLED") "1" }}
wfLoadExtension( 'PageForms' );
{{ end }}
{{ if eq (env "PAGESCHEMAS_ENABLED") "1" }}
wfLoadExtension( 'PageSchemas' );
{{ end }}
{{ if eq (env "SEMANTICMW_ENABLED") "1" }}
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( '{{ env "DOMAIN" }}' );
{{ end }}
{{ if eq (env "MARKDOWN_ENABLED") "1" }}
wfLoadExtension( 'WikiMarkdown' );
$wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra
$wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended
{{ end }}
$wgFileExtensions = array(
'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff',
'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg'
);
$wgUploadSizeWarning = 1000000000;
$wgMaxUploadSize = 1000000000;

102
README.md
View File

@ -1,27 +1,101 @@
# Mediawiki
Mediawiki [version 1.32.1][mediawiki-1.32]
[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/mediawiki/status.svg)](https://build.coopcloud.tech/coop-cloud/mediawiki)
Requires Docker version 1.11.2 or above to run.
<!-- metadata -->
* **Category**: Apps
* **Status**: 1, alpha
* **Image**: [`mediawiki`](https://hub.docker.com/_/mediawiki), 4, upstream
* **Healthcheck**: No
* **Backups**: Yes
* **Email**: 3
* **Tests**: 2
* **SSO**: 2 (OAuth, SAML)
<!-- endmetadata -->
Based on [`mediawiki-ve-bundle`][mediawiki-ve].
## Basic usage
1. Set up Docker Swarm and [`abra`][abra]
2. Deploy [`compose-stacks/traefik`][compose-traefik]
2. `cp .envrc.sample .envrc`
3. Edit `.envrc` - be sure to change `$DOMAIN` to something that resolves to
2. Deploy [`coop-cloud/traefik`][traefik]
3. `abra app new mediawiki --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass`)
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
4. `direnv allow` (or `. .envrc`)
5. `abra secret_generate db_password v1 && abra secret_generate db_root_password v2`
6. `abra deploy`
7. `abra service_run mediawiki /bin/bash` to open a shell
8. `php /var/www/html/maintenance/createAndPromote.php YourUsername YourPassword`
5. `abra app deploy YOURAPPDOMAIN`
6. Create an initial admin user:
`abra app run YOURAPPDOMAIN app php /var/www/html/maintenance/createAndPromote.php --sysop YourUsername YourPassword`
## Email
### Coop Cloud mailu or postfix
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
`coop-cloud/mailu` (assuming default stack names)
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.
3. `abra app deploy YOURAPPDOMAIN`
### 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.
## Single Sign On
### SimpleSAMLphp
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!
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`)
```
abra app YOURAPPDOMAIN secret generate saml_admin_password v1
abra app YOURAPPDOMAIN secret generate saml_secret_salt v1 "pwgen -n 64 1"
```
3. `abra app deploy YOURAPPDOMAIN`
4. Copy your SimpleSAMLphp metadata and certificates to the container (assuming
you have local `metadata` and `cert` folders:
```
abra app YOURAPPDOMAIN cp metadata simplesaml:/var/simplesamlphp/
abra app YOURAPPDOMAIN cp cert simplesaml:/var/simplesamlphp/
```
5. You can log into SimpleSAMLphp using the password you generated at
https://$DOMAIN/simplesaml/ and test authentication
6. Edit SimpleSAMLphp's `config.php` and change `store.sql.dsn`:
```
abra app YOURAPPDOMAIN run simplesaml vi /var/simplesamlphp/config/config.php
# find 'store.sql.dsn' and edit to:
# 'sqlite:/var/simplesamlphp/data/simplesamlphp.sq3'
```
### OpenID Connect
1. `abra app config YOURAPPDOMAIN` - uncomment lines in the `OPENID` section (including `COMPOSE_FILE`)
2. Store your Keycloak-generated client secret in Docker:
```
abra app YOURAPPDOMAIN secret insert openid_client_secret v1 put-your-secret-here
```
3. `abra app deploy YOURAPPDOMAIN`
## License
MIT License
[mediawiki-1.32]: https://www.mediawiki.org/wiki/Release_notes/1.32.1
[mediawiki-1.35]: https://www.mediawiki.org/wiki/Release_notes/1.35
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
[compose-traefik]: https://git.autonomic.zone/compose-stacks/traefik
[mediawiki-ve]: https://hub.docker.com/r/revianlabs/mediawiki-ve-bundle
[traefik]: https://git.autonomic.zone/coop-cloud/traefik
[simplesamlphp]: https://simplesamlphp.org/
[mw-simplesamlphp]: https://www.mediawiki.org/wiki/Extension:SimpleSAMLphp
[venatorfox-simplesamlphp]: https://hub.docker.com/r/venatorfox/simplesamlphp

45
abra.sh Normal file
View File

@ -0,0 +1,45 @@
export LOCAL_SETTINGS_CONF_VERSION=v23
export HTACCESS_CONF_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v20
export COMPOSER_LOCAL_CONF_VERSION=v5
export PHP_INI_VERSION=v4
export SAML_ENTRYPOINT_CONF_VERSION=v3
abra_backup_app() {
_abra_backup_dir "app:/var/www/html/images"
}
abra_backup_db() {
_abra_backup_mysql "db" "mediawiki"
}
abra_backup() {
abra_backup_app && abra_backup_db
}
abra_restore_app() {
# shellcheck disable=SC2034
{
abra__src_="-"
abra__dst_="app:/var/www/html/"
}
zcat "$@" | sub_app_cp
success "Restored 'app'"
}
abra_restore_db() {
# 3wc: unlike abra_backup_db, we can assume abra__service_ will be 'db' if we
# got this far..
# shellcheck disable=SC2034
abra___no_tty="true"
DB_ROOT_PASSWORD="$(sub_app_run cat /run/secrets/db_root_password)"
zcat "$@" | sub_app_run mysql -u root -p"$DB_ROOT_PASSWORD" wordpress
success "Restored 'db'"
}

24
compose.openid.yml Normal file
View File

@ -0,0 +1,24 @@
---
version: "3.8"
services:
app:
environment:
- OPENID_KEYCLOAK_URL
- OPENID_CLIENT_ID
secrets:
- openid_client_secret
configs:
- source: composer_local_conf
target: /var/www/html/composer.local.json
secrets:
openid_client_secret:
name: ${STACK_NAME}_openid_client_secret_${SECRET_OPENID_CLIENT_SECRET_VERSION}
external: true
configs:
composer_local_conf:
name: ${STACK_NAME}_composer_local_${COMPOSER_LOCAL_CONF_VERSION}
file: composer.local.json.tmpl
template_driver: golang

95
compose.simplesaml.yml Normal file
View File

@ -0,0 +1,95 @@
---
version: "3.8"
services:
app:
volumes:
- "simplesaml:/var/simplesamlphp/"
- "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"
environment:
- SAML_AUTH_SOURCE_ID
- SAML_EMAIL_ATTRIBUTE
- SAML_REAL_NAME_ATTRIBUTE
- SAML_SERVICE_PROVIDER
- SAML_USERNAME_ATTRIBUTE
simplesaml:
# image: unicon/simplesamlphp:1.19.6
image: git.coopcloud.tech/coop-cloud-chaos-patchs/simplesamlphp:1.19.7
secrets:
- saml_admin_password
- saml_secret_salt
environment:
- DOMAIN
- CONFIG_BASEURLPATH=https://${DOMAIN}/simplesaml/
- CONFIG_AUTHADMINPASSWORD_FILE=/run/secrets/saml_admin_password
- CONFIG_SECRETSALT_FILE=/run/secrets/saml_secret_salt
- CONFIG_TECHNICALCONTACT_NAME
- CONFIG_TECHNICALCONTACT_EMAIL
- CONFIG_SHOWERRORS=true
- CONFIG_ERRORREPORTING=true
- CONFIG_ADMINPROTECTINDEXPAGE=true
- CONFIG_LOGGINGLEVEL=INFO
- CONFIG_ENABLESAML20IDP=true
- CONFIG_STORETYPE=sql
#- CONFIG_MEMCACHESTOREPREFIX=simplesamlphp
#- CONFIG_MEMCACHESTORESERVERS= 'memcache_store.servers' => [\n [\n ['hostname' => 'memcached']\n ],
- OPENLDAP_TLS_REQCERT=allow
- MTA_NULLCLIENT=true
- POSTFIX_MYHOSTNAME=${DOMAIN}
- POSTFIX_MYORIGIN=$$mydomain
- POSTFIX_INETINTERFACES=loopback-only
- DOCKER_REDIRECTLOGS=false
# Required if DOCKER_REDIRECTLOGS=true
# tty: true
configs:
- source: entrypoint_saml_conf
target: /docker-entrypoint.simplesaml.sh
mode: 0555
volumes:
- simplesaml:/var/simplesamlphp/
- "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:
- proxy
entrypoint: /docker-entrypoint.simplesaml.sh
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.services.${STACK_NAME}_simplesaml.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}_simplesaml.rule=(Host(`${DOMAIN}`) && PathPrefix(`/simplesaml`))"
- "traefik.http.routers.${STACK_NAME}_simplesaml.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}_simplesaml.tls.certresolver=${LETS_ENCRYPT_ENV}"
volumes:
simplesaml:
simplesaml_cert:
simplesaml_config:
simplesaml_data:
simplesaml_log:
simplesaml_metadata:
simplesaml_modules:
secrets:
saml_admin_password:
name: ${STACK_NAME}_saml_admin_password_${SECRET_SAML_ADMIN_PASSWORD_VERSION}
external: true
saml_secret_salt:
name: ${STACK_NAME}_saml_secret_salt_${SECRET_SAML_SECRET_SALT_VERSION}
external: true
configs:
entrypoint_saml_conf:
name: ${STACK_NAME}_entrypoint_saml_${SAML_ENTRYPOINT_CONF_VERSION}
file: entrypoint.simplesaml.sh.tmpl
template_driver: golang

14
compose.smtp.yml Normal file
View File

@ -0,0 +1,14 @@
---
version: "3.8"
services:
app:
environment:
- SMTP_USER
secrets:
- smtp_password
secrets:
smtp_password:
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
external: true

View File

@ -1,76 +1,83 @@
---
version: '3.8'
version: "3.8"
services:
mariadb:
image: 'mariadb:10.5'
app:
image: mediawiki:1.39.3
environment:
- DOMAIN
- STACK_NAME
- MEDIAWIKI_EMAIL_CONTACT
- MEDIAWIKI_EMAIL_FROM
- MEDIAWIKI_SITENAME
- MEDIAWIKI_SITENAMESPACE
- MEDIAWIKI_LOGO_FILE
- MEDIAWIKI_IS_PRIVATE
- MEDIAWIKI_DEBUG
- MEDIAWIKI_LANGUAGE=${MEDIAWIKI_LANGUAGE:-en}
- SAML_ENABLED
- OPENID_ENABLED
- DB_HOST=db
- DB_USER=mediawiki
- DB_NAME=mediawiki
- SMTP_HOST
- SMTP_PORT=${SMTP_PORT:-25}
volumes:
- "mediawiki_images:/var/www/html/images"
configs:
- source: LocalSettings_conf
target: /var/www/html/LocalSettings.php
- source: php_ini
target: /usr/local/etc/php/conf.d/mediawiki.ini
- source: entrypoint2_conf
target: /docker-entrypoint2.sh
mode: 0555
secrets:
- db_password
- mediawiki_secret_key
networks:
- proxy
- internal
deploy:
update_config:
failure_action: rollback
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "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}.entrypoints=web-secure"
- "coop-cloud.${STACK_NAME}.version=2.5.0+1.39.3"
- "backupbot.backup=true"
- "backupbot.backup.path=/var/www/html/images"
entrypoint: /docker-entrypoint2.sh
db:
image: mariadb:10.10
environment:
- MYSQL_USER=mediawiki
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_DATABASE=mediawiki
volumes:
- 'mariadb:/var/lib/mysql'
- "mariadb:/var/lib/mysql"
secrets:
- db_root_password
- db_password
networks:
- internal
deploy:
restart_policy:
condition: on-failure
delay: "60s"
max_attempts: 3
window: 120s
mediawiki:
image: 'revianlabs/mediawiki-ve-bundle'
environment:
- DOMAIN=${DOMAIN}
- STACK_NAME=${STACK_NAME}
- MEDIAWIKI_EMAIL_CONTACT=${MEDIAWIKI_EMAIL_CONTACT}
- MEDIAWIKI_EMAIL_FROM=${MEDIAWIKI_EMAIL_FROM}
- MEDIAWIKI_SITENAME=${MEDIAWIKI_SITENAME}
- MEDIAWIKI_SITENAMESPACE=${MEDIAWIKI_SITENAMESPACE}
volumes:
- 'mediawiki_images:/var/www/html/images'
- 'parsoid:/usr/lib/parsoid'
configs:
- source: LocalSettings_conf
target: /var/www/html/LocalSettings.php
- source: htaccess_conf
target: /var/www/html/.htaccess
- source: entrypoint2_conf
target: /docker-entrypoint2.sh
mode: 0555
depends_on:
- mariadb
secrets:
- db_password
networks:
- proxy
- internal
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
entrypoint: /docker-entrypoint2.sh
backupbot.backup: "true"
backupbot.backup.path: "/tmp/dump.sql.gz"
backupbot.backup.pre-hook: "sh -c 'mysqldump --single-transaction -u root -p\"$$(cat /run/secrets/db_root_password)\" mediawiki | gzip > /tmp/dump.sql.gz'"
backupbot.backup.post-hook: "rm -f /tmp/dump.sql.gz"
backupbot.restore: "true"
backupbot.restore.post-hook: "sh -c 'mysql -u root -p\"$$(cat /run/secrets/db_root_password)\" mediawiki < /tmp/dbdump.sql && rm -f /tmp/dbdump.sql'"
volumes:
mariadb:
mediawiki_images:
parsoid:
networks:
proxy:
@ -79,10 +86,13 @@ networks:
secrets:
db_root_password:
name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION}
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true
db_password:
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
mediawiki_secret_key:
name: ${STACK_NAME}_mediawiki_secret_key_${SECRET_MEDIAWIKI_SECRET_KEY_VERSION}
external: true
configs:
@ -90,11 +100,11 @@ configs:
name: ${STACK_NAME}_local_settings_${LOCAL_SETTINGS_CONF_VERSION}
file: LocalSettings.php.tmpl
template_driver: golang
htaccess_conf:
name: ${STACK_NAME}_htaccess_${HTACCESS_CONF_VERSION}
file: htaccess.tmpl
template_driver: golang
entrypoint2_conf:
name: ${STACK_NAME}_entrypoint2_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
php_ini:
name: ${STACK_NAME}_php_ini_${PHP_INI_VERSION}
file: php.ini.tmpl
template_driver: golang

14
composer.local.json.tmpl Normal file
View File

@ -0,0 +1,14 @@
{
{{ if eq (env "SEMANTICMW_ENABLED") "1" }}
"require": {
"mediawiki/semantic-media-wiki": "^4.1.0"
},
{{ end }}
"extra": {
"merge-plugin": {
"include": [
"extensions/OpenIDConnect/composer.json"
]
}
}
}

View File

@ -2,29 +2,138 @@
set -eu -o pipefail
init_db() {
set -eu
init_composer() {
set -eu
apt update && apt install -y mariadb-client
PASSWORD=`cat /run/secrets/db_password`
TABLE_COUNT=$(mysql -u mediawiki --password="$PASSWORD" -h mariadb mediawiki -e "SELECT count(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mediawiki';" -N -B)
if [[ "${TABLE_COUNT}" == "0" ]]; then
mysql -u mediawiki --password="$PASSWORD" -h mariadb mediawiki < /var/www/html/maintenance/tables.sql
else
php /var/www/html/maintenance/update.php
fi
if ! type composer > /dev/null 2>&1; then
apt update -yqq && apt install -yqq curl git unzip zip
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.5.4
composer -V
fi
}
composer_install() {
set -eu
cd /var/www/html/ && composer update && composer install
}
init_db() {
set -eu
if ! type mysql > /dev/null 2>&1; then
apt update -qq && apt install -yqq mariadb-client
fi
PASSWORD=$(cat /run/secrets/db_password)
# FIXME 3wc: replace with sql.php, not sure how to parse output:
# stdClass Object
#(
# [TOTAL] => 58
#)
TABLE_COUNT=$(mysql -u "${DB_USER}" --password="$PASSWORD" -h "${DB_HOST}" "${DB_NAME}" -e "SELECT count(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mediawiki';" -N -B)
if [[ "${TABLE_COUNT}" == "0" ]]; then
php /var/www/html/maintenance/generateSchemaSql.php
php /var/www/html/maintenance/sql.php /var/www/html/maintenance/tables-generated.sql
php /var/www/html/maintenance/sql.php /var/www/html/maintenance/tables.sql
php /var/www/html/maintenance/sql.php /var/www/html/maintenance/interwiki.sql
# FIXME run createAndPromote.php with $ADMIN_USERNAME
fi
php /var/www/html/maintenance/update.php --quick
}
init_extensions() {
if [ ! -d /var/www/html/extensions/PluggableAuth ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \
/var/www/html/extensions/PluggableAuth
fi
if [ -n "${SAML_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/SimpleSAMLphp ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SimpleSAMLphp \
/var/www/html/extensions/SimpleSAMLphp
fi
fi
if [ -n "${OPENID_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/OpenIDConnect ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenIDConnect \
/var/www/html/extensions/OpenIDConnect
fi
fi
if [ -n "${MOBILEFRONTEND_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/MobileFrontend ]; then
git clone --depth 1 -b REL1_39 \
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend.git \
/var/www/html/extensions/MobileFrontend
fi
fi
if [ -n "${MSU_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/MsUpload ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/MsUpload \
/var/www/html/extensions/MsUpload
fi
fi
if [ -n "${PAGEFORMS_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/PageForms ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms \
/var/www/html/extensions/PageForms
fi
fi
if [ -n "${PAGESCHEMAS_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/PageSchemas ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageSchemas \
/var/www/html/extensions/PageSchemas
fi
fi
if [ -n "${MARKDOWN_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/WikiMarkdown ]; then
git clone --depth 1 \
https://github.com/kuenzign/WikiMarkdown \
/var/www/html/extensions/WikiMarkdown
fi
fi
}
init_skins() {
if [ -n "${TWEEKI_ENABLED-}" ]; then
if [ ! -d /var/www/html/skins/Tweeki ]; then
git clone --depth 1 \
https://github.com/thaider/Tweeki \
/var/www/html/skins/Tweeki
fi
fi
}
main() {
set -eu
set -eu
a2enmod rewrite
init_db
init_extensions
init_skins
init_composer
composer_install
init_db
}
main
/docker-entrypoint.sh apache2-foreground "$@"
apache2-foreground

View File

@ -0,0 +1,61 @@
#!/usr/bin/env bash
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
load_vars() {
file_env "CONFIG_AUTHADMINPASSWORD"
file_env "CONFIG_SECRETSALT"
}
generate_certs() {
CERT_DIR=/var/simplesamlphp/cert
if [ -f "$CERT_DIR/saml.crt" ] && [ -f "$CERT_DIR/saml.pem" ]; then
return
fi
if ! type openssl > /dev/null 2>&1; then
yum install -q -y openssl
fi
openssl req -newkey rsa:4096 -new -x509 \
-days 3652 -nodes \
-out "$CERT_DIR/saml.crt" \
-keyout "$CERT_DIR/saml.pem" \
-subj "/C=XX/ST=/L=/O=/OU=SimpleSAML/CN=${DOMAIN}"
}
enable_plugins() {
touch /var/simplesamlphp/modules/cas/enable
}
main() {
set -eu
load_vars
enable_plugins
generate_certs
}
main
/init "$@"

View File

@ -1,12 +0,0 @@
# Generated using https://shorturls.redwerks.org
RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

10
php.ini.tmpl Normal file
View File

@ -0,0 +1,10 @@
upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 7200
max_file_uploads = 1000
{{ if eq (env "MEDIAWIKI_DEBUG") "0" }}
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
{{ else }}
error_reporting = E_ALL
{{ end }}

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}