Skip to content

Commit

Permalink
Bump femiwiki docker image (#236)
Browse files Browse the repository at this point in the history
* Bump femiwiki docker image

* Update templates

* Disable BlockByEmail

---------

Co-authored-by: lens0021 <[email protected]>
  • Loading branch information
femiwiki-bot and lens0021 authored Jun 30, 2024
1 parent 31ab81c commit 1d97797
Showing 1 changed file with 23 additions and 54 deletions.
77 changes: 23 additions & 54 deletions jobs/fastcgi.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,19 @@ job "fastcgi" {
}

template {
data = var.run
destination = "local/run.php"
data = var.postrun
destination = "local/postrun"
change_mode = "noop"
}

template {
data = var.postrun
destination = "local/prerun"
change_mode = "noop"
}

config {
image = "ghcr.io/femiwiki/femiwiki:2024-06-30T00-53-34439279"
image = "ghcr.io/femiwiki/femiwiki:2024-06-30T02-27-15a818f3"

volumes = [
"local/opcache-recommended.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini",
Expand All @@ -92,7 +98,8 @@ job "fastcgi" {
"secrets/analytics-credentials-file.json:/a/analytics-credentials-file.json",
# Overwrite the default Hotfix.php provided by femiwiki/mediawiki
"local/Hotfix.php:/a/Hotfix.php",
"local/Hotfix.php:/usr/local/bin/run",
"local/postrun:/usr/local/bin/postrun",
"local/prerun:/usr/local/bin/prerun",
]

mounts = [
Expand Down Expand Up @@ -151,12 +158,8 @@ variable "hotfix" {
*/
$wgMWLoggerDefaultSpi = [ 'class' => 'MediaWiki\\Logger\\LegacySpi' ]; # default
$wgGroupPermissions['autopatrolled']['autopatrol'] = true;
$wgGroupPermissions['blocker']['block'] = true;
$wgGroupPermissions['blocker']['blockemail'] = true;
$wgGroupPermissions['blocker']['unblockself'] = true;
$wgGroupPermissions['user']['torunblocked'] = false;
$wgScribuntoEngineConf['luastandalone']['cpuLimit'] = 3;
# https://github.com/femiwiki/UnifiedExtensionForFemiwiki/issues/147
$wgUnifiedExtensionForFemiwikiBlockByEmail = falae;
// Maintenance
// 점검이 끝나면 아래 라인 주석처리한 뒤, 아래 문서 내용을 비우면 됨
Expand All @@ -168,55 +171,21 @@ $wgScribuntoEngineConf['luastandalone']['cpuLimit'] = 3;
EOF
}

variable "run" {
variable "postrun" {
type = string
default = <<EOF
#!/bin/bash
set -euo pipefail; IFS=$'\n\t'
EOF
}

variable "pretrun" {
type = string
default = <<EOF
#!/bin/bash
set -euo pipefail; IFS=$'\n\t'
echo 'Starting Femiwiki ...'
curl -L https://raw.githubusercontent.com/edwardspec/mediawiki-aws-s3/29db5b45e4c4931e00424b636d2bc4026c42b8ad/s3/AmazonS3FileBackend.php \
-o /srv/femiwiki.com/extensions/AWS/s3/AmazonS3FileBackend.php
# Run Install.php
if [ -z "$${MEDIAWIKI_SKIP_INSTALL:-}" ]; then
echo 'Start installing Mediawiki ...'
DB_HOSTNAME="$(php -r 'require "/a/secret.php"; echo $wgDBserver;')"
DB_USERNAME="$(php -r 'require "/a/secret.php"; echo $wgDBuser;')"
DB_PASSWORD="$(php -r 'require "/a/secret.php"; echo $wgDBpassword;')"
php /srv/femiwiki.com/maintenance/install.php \
--lang ko \
--scriptpath '/w' \
--dbtype mysql \
--dbname femiwiki \
--dbserver "$${DB_HOSTNAME}" \
--dbuser "$${DB_USERNAME}" \
--dbpass "$${DB_PASSWORD}" \
--installdbuser "$${DB_USERNAME}" \
--installdbpass "$${DB_PASSWORD}" \
--pass 'admin_password_please_change' \
'페미위키' Admin
fi
# Overwrite LocalSettings.php generated by install script
ln -sf /a/LocalSettings.php /srv/femiwiki.com/LocalSettings.php
# Run update script
if [ -z "$${MEDIAWIKI_SKIP_UPDATE:-}" ]; then
/srv/femiwiki.com/maintenance/update.php --quick
fi
# Add Femiwiki to the sites table
if [ -z "$${MEDIAWIKI_SKIP_IMPORT_SITES:-}" ]; then
php /srv/femiwiki.com/maintenance/importSites.php /a/site-list.xml
fi
# Start cron daemon
cron
# Run php-fpm
php-fpm
EOF
}

0 comments on commit 1d97797

Please sign in to comment.