Skip to content

Commit

Permalink
mediawiki: fix specifying logo for wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
eugulixes committed Jul 13, 2024
1 parent b19e6f5 commit f37b607
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ baseimages/stretch_chroot
baseimages/alpine_chroot
hubot-rocketchat/packages/*
hubot-rocketchat/redis-dump
mediawiki/config/logos.php
mediawiki/config/namespaces.php
mediawiki/kblogo.png
mediawiki/_db
mediawiki/_deleted
mediawiki/_images
Expand Down
4 changes: 2 additions & 2 deletions mediawiki/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUN echo http://mirror.yandex.ru/mirrors/alpine/v3.20/community >> /etc/apk/repo
git \
&& rm -rf /var/cache/apk/*

COPY ./config/LocalSettings.php ./config/namespaces.ph[p] /var/www/w/
COPY ./config/LocalSettings.php ./config/logos.ph[p] ./config/namespaces.ph[p] /var/www/w/

COPY ./config/default /etc/nginx/http.d/default.conf

Expand All @@ -75,7 +75,7 @@ COPY ./rollout_fixes.sh /usr/bin/rollout_fixes.sh

COPY ./docker-entrypoint.sh /usr/bin/docker-entrypoint.sh

COPY ./logo.svg ./kblogo.pn[g] /var/www/w/resources/assets/
COPY ./logos/ /var/www/w/resources/assets/

RUN /usr/bin/rollout_fixes.sh

Expand Down
17 changes: 15 additions & 2 deletions mediawiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,22 @@ Then, rebuild the Docker image and re-run the container. After this you will get

In order to modify a [php.ini](https://php.net/manual/en/configuration.file.php) parameter, use the environment variable the name of which consists of `PHP_INI_` and the name of the parameter. For example, to change the [post_max_size](https://php.net/manual/en/ini.core.php#ini.post-max-size) parameter, pass the `PHP_INI_post_max_size` environment variable to the container.

## How to change logo
## How to change logos

Provide a square logo named `kblogo.png` which is 135x135px or 150x150px.
Place all the logos in the `logos` directory, they can be accessed using the path `$wgResourceBasePath/resources/assets`. For example, you have placed `cusdeb.svg` and `cusdeb-wordmark.svg` in this directory. Next, create a file `config/logos.php` with the following content:

```php
$wgLogos = [
'icon' => "$wgResourceBasePath/resources/assets/cusdeb.svg",
'tagline' => [
'src' => "$wgResourceBasePath/resources/assets/cusdeb-wordmark.svg",
'width' => 135,
'height' => 15,
],
];
```

and rebuild the image. See [$wgLogos](https://mediawiki.org/wiki/Manual:$wgLogos) for details.

## How to upgrade from MariaDB 10.5 to MariaDB 10.6

Expand Down
4 changes: 0 additions & 4 deletions mediawiki/config/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
## The URL path to static resources (images, scripts, etc.)
$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";

## UPO means: this is also a user preference option

$wgEnableEmail = false;
Expand Down
4 changes: 4 additions & 0 deletions mediawiki/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ substitute() {
sed -i -e "s#${var_name}#${!var_name}#" /var/www/w/LocalSettings.php
}

if [[ -f /var/www/w/logos.php ]]; then
cat /var/www/w/logos.php >> /var/www/w/LocalSettings.php
fi

if [[ -f /var/www/w/namespaces.php ]]; then
cat /var/www/w/namespaces.php >> /var/www/w/LocalSettings.php
fi
Expand Down
1 change: 1 addition & 0 deletions mediawiki/logos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The directory contains logos for this wiki.

0 comments on commit f37b607

Please sign in to comment.