Skip to content

Commit 291e175

Browse files
deer-wmdetarrow
authored andcommitted
fix domainSaysLocal and allow minikube CIDR
1 parent 64a8388 commit 291e175

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
require_once __DIR__ . '/Localization.php';
2525

2626
// Define some conditions to switch behaviour on
27-
$wwDomainSaysLocal = preg_match("/(\w\.localhost)/", $_SERVER['SERVER_NAME']) === 1;
27+
$wwDomainSaysLocal = preg_match("/(\w\.wbaas\.dev)/", $_SERVER['SERVER_NAME']) === 1;
2828
$wwDomainIsMaintenance = $wikiInfo->requestDomain === 'maintenance';
2929
$wwIsPhpUnit = isset( $maintClass ) && $maintClass === 'PHPUnitMaintClass';
3030
$wwIsLocalisationRebuild = basename( $_SERVER['SCRIPT_NAME'] ) === 'rebuildLocalisationCache.php';
@@ -501,6 +501,16 @@ function onSkinTemplateNavigationUniversal( SkinTemplate $skin, array &$links )
501501
'dnsbl.dronebl.org.',
502502
];
503503

504+
if ($wwDomainSaysLocal) {
505+
$wgProxyWhitelist = [];
506+
507+
for ($a=0; $a<255; $a++) {
508+
for ($b=0; $b<255; $b++) {
509+
$wgProxyWhitelist[] = "10.244.$a.$b";
510+
}
511+
}
512+
}
513+
504514
# ConfirmEdit
505515

506516
# QuestyCaptcha

dist/wbstack/src/Settings/LocalSettings.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
require_once __DIR__ . '/Localization.php';
2525

2626
// Define some conditions to switch behaviour on
27-
$wwDomainSaysLocal = preg_match("/(\w\.localhost)/", $_SERVER['SERVER_NAME']) === 1;
27+
$wwDomainSaysLocal = preg_match("/(\w\.wbaas\.dev)/", $_SERVER['SERVER_NAME']) === 1;
2828
$wwDomainIsMaintenance = $wikiInfo->requestDomain === 'maintenance';
2929
$wwIsPhpUnit = isset( $maintClass ) && $maintClass === 'PHPUnitMaintClass';
3030
$wwIsLocalisationRebuild = basename( $_SERVER['SCRIPT_NAME'] ) === 'rebuildLocalisationCache.php';
@@ -501,6 +501,16 @@ function onSkinTemplateNavigationUniversal( SkinTemplate $skin, array &$links )
501501
'dnsbl.dronebl.org.',
502502
];
503503

504+
if ($wwDomainSaysLocal) {
505+
$wgProxyWhitelist = [];
506+
507+
for ($a=0; $a<255; $a++) {
508+
for ($b=0; $b<255; $b++) {
509+
$wgProxyWhitelist[] = "10.244.$a.$b";
510+
}
511+
}
512+
}
513+
504514
# ConfirmEdit
505515

506516
# QuestyCaptcha

0 commit comments

Comments
 (0)