From e6e897fb79100cab3c5b9b26382a77b6de600ae8 Mon Sep 17 00:00:00 2001 From: RhinosF1 Date: Wed, 20 Nov 2024 21:58:57 +0000 Subject: [PATCH 1/4] mwdeploy: fix text check for beta --- modules/mediawiki/files/bin/mwdeploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mediawiki/files/bin/mwdeploy.py b/modules/mediawiki/files/bin/mwdeploy.py index c1830054b5..823ad00ec6 100644 --- a/modules/mediawiki/files/bin/mwdeploy.py +++ b/modules/mediawiki/files/bin/mwdeploy.py @@ -235,7 +235,7 @@ def make_request(proto, domain, headers) -> requests.Response: else: proto = 'http://' req = make_request(proto, domain, headers) - if req.status_code == 200 and 'miraheze' in req.text and (Debug is None or Debug in req.headers['X-Served-By']): + if req.status_code == 200 and 'mainpageisdomainroot' in req.text and (Debug is None or Debug in req.headers['X-Served-By']): up = True if not up: print(f'Status: {req.status_code}') From 4995ddbe9118794eb92d3646f63c053b31f6a69d Mon Sep 17 00:00:00 2001 From: RhinosF1 Date: Wed, 20 Nov 2024 22:03:30 +0000 Subject: [PATCH 2/4] Update test_mwscript.py --- modules/mediawiki/files/bin/test_mwscript.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mediawiki/files/bin/test_mwscript.py b/modules/mediawiki/files/bin/test_mwscript.py index 0b9c19670f..913ac7cba9 100644 --- a/modules/mediawiki/files/bin/test_mwscript.py +++ b/modules/mediawiki/files/bin/test_mwscript.py @@ -86,8 +86,8 @@ def test_get_command_extension_list_runner(mock_getlogin): args.version = '1.40' assert mwscript.syscheck(mwscript.get_commands(args)) == { 'confirm': False, - 'command': f'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/maintenance/test.php', - 'generate': f'php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', + 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/maintenance/test.php', + 'generate': 'php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', 'long': True, 'nolog': False, } From 495e61b4c82f64eba9ca963102ed205fcc116dfb Mon Sep 17 00:00:00 2001 From: RhinosF1 Date: Wed, 20 Nov 2024 22:09:15 +0000 Subject: [PATCH 3/4] Update test_mwscript.py --- modules/mediawiki/files/bin/test_mwscript.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mediawiki/files/bin/test_mwscript.py b/modules/mediawiki/files/bin/test_mwscript.py index 913ac7cba9..d593da956f 100644 --- a/modules/mediawiki/files/bin/test_mwscript.py +++ b/modules/mediawiki/files/bin/test_mwscript.py @@ -29,8 +29,8 @@ def test_get_command_extension_list(mock_getlogin): args.version = '1.39' assert mwscript.syscheck(mwscript.get_commands(args)) == { 'confirm': False, - 'command': f'sudo -u www-data /usr/local/bin/foreachwikiindblist /home/{os.environ["LOGNAME"]}/CheckUser.json /srv/mediawiki/1.39/maintenance/test.php', - 'generate': f'php /srv/mediawiki/1.39/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/home/{os.environ["LOGNAME"]}', + 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.json /srv/mediawiki/1.39/maintenance/test.php', + 'generate': 'php /srv/mediawiki/1.39/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', 'long': True, 'nolog': False, } @@ -86,7 +86,7 @@ def test_get_command_extension_list_runner(mock_getlogin): args.version = '1.40' assert mwscript.syscheck(mwscript.get_commands(args)) == { 'confirm': False, - 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/maintenance/test.php', + 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.json /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/maintenance/test.php', 'generate': 'php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', 'long': True, 'nolog': False, From 873018a797ea685e5af20ba4c452271134e4059f Mon Sep 17 00:00:00 2001 From: RhinosF1 Date: Wed, 20 Nov 2024 22:12:27 +0000 Subject: [PATCH 4/4] Update test_mwscript.py --- modules/mediawiki/files/bin/test_mwscript.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mediawiki/files/bin/test_mwscript.py b/modules/mediawiki/files/bin/test_mwscript.py index d593da956f..6fcbf73818 100644 --- a/modules/mediawiki/files/bin/test_mwscript.py +++ b/modules/mediawiki/files/bin/test_mwscript.py @@ -30,7 +30,7 @@ def test_get_command_extension_list(mock_getlogin): assert mwscript.syscheck(mwscript.get_commands(args)) == { 'confirm': False, 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.json /srv/mediawiki/1.39/maintenance/test.php', - 'generate': 'php /srv/mediawiki/1.39/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', + 'generate': 'sudo -u www-data php /srv/mediawiki/1.39/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', 'long': True, 'nolog': False, } @@ -87,7 +87,7 @@ def test_get_command_extension_list_runner(mock_getlogin): assert mwscript.syscheck(mwscript.get_commands(args)) == { 'confirm': False, 'command': 'sudo -u www-data /usr/local/bin/foreachwikiindblist /tmp/CheckUser.json /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/maintenance/test.php', - 'generate': 'php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', + 'generate': 'sudo -u www-data php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=CheckUser --directory=/tmp', 'long': True, 'nolog': False, }