Skip to content

Commit

Permalink
Cleanup, less strict env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
GAsplund committed Aug 12, 2024
1 parent 5c44afc commit f629fcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ The following environment variables can be set to configure the wiki:
| `CLIENT_ID` | The client ID of the provider | (Required) | `123456` |
| `CLIENT_SECRET` | The client secret of the provider | (Required) | `abcdef` |
| `WIKI_NAME` | The name of the wiki | (Required) | `My Wiki` |
| `WIKI_PATH` | The root path of the wiki | (Required) | `/wiki` |
| `WIKI_PATH` | The root path of the wiki | `""` | `/wiki` |
| `ROOT_URL` | The root URL of the wiki | (Required) | `https://wiki.chalmers.it` |
| `DB_SERVER` | URL to the database | (Required) | `db` |
| `DB_NAME` | The database name to use | (Required) | `wiki` |
| `DB_USER` | Username to access database | (Required) | `wiki` |
| `DB_PASSWORD` | Password to access database | (Required) | `password` |
| `DB_PREFIX` | Prefix to be used when addressing database. | (Required) | `mw_` |
| `DB_PREFIX` | Prefix to be used when addressing database. | `mw_` | `wiki_` |
| `SECRET_KEY` | The secret key for the wiki | (Required) | `secret` |
| `UPGRADE_KEY` | The upgrade key for the wiki. Used for installs. | (Required) | `123456` |
| `ENABLE_LOCAL_LOGIN` | Enable local login for the wiki. | `false` | `false` |
Expand Down
13 changes: 6 additions & 7 deletions mediawiki/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = $_ENV["WIKI_PATH"];
$wgScriptPath = $_ENV["WIKI_PATH"] ?? "";

## The protocol and server name to use in fully-qualified URLs
$wgServer = $_ENV["ROOT_URL"];

## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
# The base URL that is used to construct all internal links
# Normally points to the main index.php script. Can be relative or absolute
$wgArticlePath = "$wgScriptPath/$1";

$wgArticlePath = $wgScriptPath . "/$1";

## The URL paths to the logo. Make sure you change this from the default,
## The URL paths to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [
'icon' => "$wgScriptPath/images/logo.png",
Expand Down Expand Up @@ -72,7 +71,7 @@
$wgDBpassword = $_ENV["DB_PASSWORD"];

# MySQL specific settings
$wgDBprefix = $_ENV["DB_PREFIX"];
$wgDBprefix = $_ENV["DB_PREFIX"] ?? "mw_";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
Expand Down

0 comments on commit f629fcc

Please sign in to comment.