Skip to content

Commit 9a4fbef

Browse files
committed
Add OAuth public and private key in setting
1 parent 14d39c7 commit 9a4fbef

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

dist-persist/wbstack/src/Settings/LocalSettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
$wwIsPhpUnit = isset( $maintClass ) && $maintClass === 'PHPUnitMaintClass';
3030
$wwIsLocalisationRebuild = basename( $_SERVER['SCRIPT_NAME'] ) === 'rebuildLocalisationCache.php';
3131
$wwLocalization = new Localization( $wgExtensionMessagesFiles, $wgMessagesDirs, $wgBaseDirectory, $wwIsLocalisationRebuild );
32-
$wwDockerCompose = getenv('WBSTACK_DOCKER_COMPOSE') === 'yes';
3332

3433
$wwUseMailgunExtension = true; // default for wbstack
3534
if (getenv('MW_MAILGUN_DISABLED') === 'yes') {
@@ -94,7 +93,7 @@
9493
];
9594
}
9695

97-
if ( $wwDockerCompose ) {
96+
if ( $wwDomainSaysLocal ) {
9897
$wgServer = "http://" . $wikiInfo->domain;
9998
} else {
10099
$wgServer = "https://" . $wikiInfo->domain;
@@ -325,6 +324,8 @@ function onBeforePageDisplay( &$out, &$skin ) {
325324
$wgGroupPermissions['platform']['mwoauthmanageconsumer'] = true;
326325
$wgGroupPermissions['platform']['mwoauthviewprivate'] = true;
327326
$wgGroupPermissions['platform']['mwoauthupdateownconsumer'] = true;
327+
$wgOAuth2PrivateKey = '/mediawiki/jwtRS256.key';
328+
$wgOAuth2PublicKey = '/mediawiki/jwtRS256.key.pub';
328329

329330
#######################################
330331
## --- Skins --- ##

dist/wbstack/src/Settings/LocalSettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
$wwIsPhpUnit = isset( $maintClass ) && $maintClass === 'PHPUnitMaintClass';
3030
$wwIsLocalisationRebuild = basename( $_SERVER['SCRIPT_NAME'] ) === 'rebuildLocalisationCache.php';
3131
$wwLocalization = new Localization( $wgExtensionMessagesFiles, $wgMessagesDirs, $wgBaseDirectory, $wwIsLocalisationRebuild );
32-
$wwDockerCompose = getenv('WBSTACK_DOCKER_COMPOSE') === 'yes';
3332

3433
$wwUseMailgunExtension = true; // default for wbstack
3534
if (getenv('MW_MAILGUN_DISABLED') === 'yes') {
@@ -94,7 +93,7 @@
9493
];
9594
}
9695

97-
if ( $wwDockerCompose ) {
96+
if ( $wwDomainSaysLocal ) {
9897
$wgServer = "http://" . $wikiInfo->domain;
9998
} else {
10099
$wgServer = "https://" . $wikiInfo->domain;
@@ -325,6 +324,8 @@ function onBeforePageDisplay( &$out, &$skin ) {
325324
$wgGroupPermissions['platform']['mwoauthmanageconsumer'] = true;
326325
$wgGroupPermissions['platform']['mwoauthviewprivate'] = true;
327326
$wgGroupPermissions['platform']['mwoauthupdateownconsumer'] = true;
327+
$wgOAuth2PrivateKey = '/mediawiki/jwtRS256.key';
328+
$wgOAuth2PublicKey = '/mediawiki/jwtRS256.key.pub';
328329

329330
#######################################
330331
## --- Skins --- ##

jwtRS256.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
4+
# Don't add passphrase
5+
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
6+
cat jwtRS256.key
7+
cat jwtRS256.key.pub

0 commit comments

Comments
 (0)