diff --git a/.env.template b/.env.template index 5efef1d..226e95e 100644 --- a/.env.template +++ b/.env.template @@ -5,6 +5,6 @@ LETSENCRYPT_EMAIL=you@youremaildomain.com MEDIAWIKI_PORT=9352 SIWEOIDC_PORT=9353 -SIWEOIDC_HOST=siwe.yourdomain.com +SIWEOIDC_HOST=localhost SIWEOIDC_BASE_URL="SIWEOIDC_SERVER" SIWEOIDC_DEFAULT_CLIENTS='{siwe="{\"secret\":\"siweaqua\", \"metadata\": {\"redirect_uris\": [\"PKC_SERVER/index.php/Special:PluggableAuthLogin\"]}}"}' diff --git a/aqua/extraAquaSettings.php b/aqua/extraAquaSettings.php index 56acc5d..dd956fb 100644 --- a/aqua/extraAquaSettings.php +++ b/aqua/extraAquaSettings.php @@ -59,6 +59,10 @@ // Allow OIDC to create users $GLOBALS['wgGroupPermissions']['*']['autocreateaccount'] = true; +// Helper vars to replace SIWE URL for in-container calls +$wgSIWEhost = getenv( 'SIWEOIDC_HOST', true ) ?: getenv( 'SIWEOIDC_HOST' ) ?: 'localhost'; +$wgSIWEport = getenv( 'SIWEOIDC_PORT', true ) ?: getenv( 'SIWEOIDC_PORT' ) ?: 'localhost'; + $wgWhitelistRead = ['Aqua Demo', 'Main Page', 'Special:OAuth2Client', 'Special:OAuth2Client/redirect', 'Spezial:OAuth2Client', 'Spezial:OAuth2Client/redirect', 'Special:PluggableAuthLogin', 'Spezial:PluggableAuthLogin']; # We need a trailing newline below so that the resulting LocalSettings.php looks nice. Don't delete! diff --git a/aqua/install_pkc.sh b/aqua/install_pkc.sh index 5f6b03e..3e79ff2 100755 --- a/aqua/install_pkc.sh +++ b/aqua/install_pkc.sh @@ -72,18 +72,15 @@ install_media_wiki(){ "$WALLET_ADDRESS" } -# https://www.mediawiki.org/wiki/Special:ExtensionDistributor/OpenIDConnect -(cd extensions && curl https://extdist.wmflabs.org/dist/extensions/OpenIDConnect-REL1_39-194d805.tar.gz > aaa.tar.gz && tar xf aaa.tar.gz && rm aaa.tar.gz) -# https://www.mediawiki.org/wiki/Special:ExtensionDistributor/PluggableAuth -(cd extensions && curl https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_39-1884a12.tar.gz > aaa.tar.gz && tar xf aaa.tar.gz && rm aaa.tar.gz) - echo "Running composer update" composer update --no-dev +echo "Applying patches" +./apply-patches.sh retry_counter=0 while ! install_media_wiki; do if [ $retry_counter -gt 4 ]; then - echo "MediaWiki intallation retries exceeded" + echo "MediaWiki installation retries exceeded" break fi retry_counter=$((retry_counter+1)) diff --git a/docker-compose.yml b/docker-compose.yml index 12fd87b..b558584 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,6 +41,7 @@ services: - LETSENCRYPT_HOST=${MEDIAWIKI_HOST} - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} - SIWEOIDC_PORT=${SIWEOIDC_PORT} + - SIWEOIDC_HOST=${SIWEOIDC_HOST} volumes: - ./mountPoint/images:/var/www/html/images - ./mountPoint/extensions/DataAccounting:/var/www/html/extensions/DataAccounting diff --git a/pkc b/pkc index c2912b9..bfc4389 100755 --- a/pkc +++ b/pkc @@ -293,7 +293,7 @@ run_setup() { PKC_SERVER=http://localhost:9352 fi if [ -z "$SIWEOIDC_SERVER" ]; then - SIWEOIDC_SERVER=http://siwe-oidc:9353 + SIWEOIDC_SERVER=http://localhost:9353 fi echo "Server name: $PKC_SERVER" echo "SIWE server: $SIWEOIDC_SERVER"