Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch OIDC library so that it automatically adjusts domain of IdP #130

Merged
merged 2 commits into from
Apr 9, 2024
Merged
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
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ [email protected]
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\"]}}"}'
4 changes: 4 additions & 0 deletions aqua/extraAquaSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
9 changes: 3 additions & 6 deletions aqua/install_pkc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading