Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN apk add \
php$VERSION-opcache \
php$VERSION-pdo \
php$VERSION-pdo_mysql \
php$VERSION-pecl-redis \
php$VERSION-phar \
php$VERSION-posix \
php$VERSION-session \
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ docker build -t bluespice/wiki:latest .
| `AV_PORT` | `3310` | Port of a `clamav` compatible service | Yes |
| `BACKUP_HOUR` | `1` | Hour for daily backup. Set to `-1` to disable | Yes |
| `CACHE_HOST` | `cache` | Hostname of a `bluespice/cache` compatible service *)| Yes |
| `CACHE_PORT` | `11211` | Port of a `bluespice/cache` compatible service | Yes |
| `CACHE_PORT` | `11211`/`6379` | Port of a `bluespice/cache` compatible service. Default based on `CACHE_TYPE` | Yes |
| `CACHE_TYPE` | `memcached` | Type of cache to use (memcached or redis/valkey) | Yes |
| `CHAT_HOST` | `chat` | Hostname of a `bluespice/chat` compatible service **)| Yes |
| `CHAT_PORT` | `3000` | Port of a `bluespice/chat` compatible service | Yes |
| `CHAT_PROTOCOL` | `http` | Protocol of a `bluespice/chat` compatible service | Yes |
Expand All @@ -41,6 +42,8 @@ docker build -t bluespice/wiki:latest .
| `INTERNAL_CHAT_WIKI_ACCESS_TOKEN` | `null` | Access token `bluespice/chat` | No |
| `INTERNAL_WIKI_SECRETKEY` | `null` | Secret key for the wiki | No |
| `INTERNAL_WIKI_UPGRADEKEY` | `null` | Upgrade key for the wiki | No |
| `JOBQUEUE_HOST` | `jobqueue` | Hostname of a `bluespice/jobqueue` compatible service| Yes |
| `JOBQUEUE_PORT` | `6379` | Port of a `bluespice/jobqueue` compatible service | Yes |
| `PDF_HOST` | `pdf` | Hostname of a `bluespice/pdf` compatible service | Yes |
| `PDF_PORT` | `8080` | Port of a `bluespice/pdf` compatible service | Yes |
| `PDF_PROTOCOL` | `http` | Protocol of a `bluespice/pdf` compatible service | Yes |
Expand Down
37 changes: 33 additions & 4 deletions root-fs/app/conf/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,27 @@
$GLOBALS['wgMainCacheType'] = CACHE_ACCEL;
$GLOBALS['wgSessionCacheType'] = CACHE_DB;
if ( getenv( 'CACHE_HOST' ) !== '-' ) {
$cacheType = trim( getenv( 'CACHE_TYPE' ) ?: 'memcached' );
$cacheHost = trim( getenv( 'CACHE_HOST' ) ?: 'cache' );
$cachePort = trim( getenv( 'CACHE_PORT' ) ?: '11211' );
$GLOBALS['wgMemCachedServers'] = [ "$cacheHost:$cachePort" ];
if ( $cacheType === 'memcached' ) {
$cachePort = trim( getenv( 'CACHE_PORT' ) ?: '11211' );
$GLOBALS['wgMemCachedServers'] = [ "$cacheHost:$cachePort" ];
$GLOBALS['wgMainCacheType'] = CACHE_MEMCACHED;
$GLOBALS['wgSessionCacheType'] = CACHE_MEMCACHED;
}
# See https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/Redis
if ( $cacheType === 'redis' || $cacheType === 'valkey' ) {
$cachePort = trim( getenv( 'CACHE_PORT' ) ?: '6379' );
$GLOBALS['wgObjectCaches']['redis'] = [
'class' => 'RedisBagOStuff',
'servers'=> [ "$cacheHost:$cachePort" ],
];
$GLOBALS['wgMainCacheType'] = 'redis';
$GLOBALS['wgSessionCacheType'] = 'redis';
$GLOBALS['wgMainStash'] = 'redis';
}
unset( $cacheHost );
unset( $cachePort );
$GLOBALS['wgMainCacheType'] = CACHE_MEMCACHED;
$GLOBALS['wgSessionCacheType'] = CACHE_MEMCACHED;
}
$GLOBALS['wgMessageCacheType'] = CACHE_ACCEL;
$GLOBALS['wgLocalisationCacheConf']['store'] = 'array';
Expand Down Expand Up @@ -64,6 +78,21 @@
'username' => trim( getenv( 'SMTP_USER' ) ),
'password' => trim( getenv( 'SMTP_PASS' ) ),
];

if ( getenv( 'JOBQUEUE_HOST' ) && getenv( 'JOBQUEUE_HOST' ) !== '-' ) {
$jobQueueHost = trim( getenv( 'JOBQUEUE_HOST' ) ?: 'jobqueue' );
$jobQueuePort = trim( getenv( 'JOBQUEUE_PORT' ) ?: '6379' );
$GLOBALS['wgJobTypeConf']['default'] = [
'class' => 'JobQueueRedis',
'redisServer' => "$jobQueueHost:$jobQueuePort",
'redisConfig' => [],
'claimTTL' => 3600,
'daemonized' => true
];
unset( $jobQueueHost );
unset( $jobQueuePort );
}

if ( getenv( 'AV_HOST' ) ) {
$GLOBALS['wgAntivirusSetup'] = [
'clamav' => [
Expand Down