Skip to content

Commit

Permalink
fix_container_permissions: use 1.41
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 9, 2024
1 parent 21f694c commit 955174b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miraheze/swift/fix_container_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

wiki = sys.argv[1]

out = subprocess.run(['sudo', '-u', 'www-data', 'php', '/srv/mediawiki/1.40/maintenance/run.php', '/srv/mediawiki/1.40/extensions/CreateWiki/maintenance/setContainersAccess.php', '--wiki', wiki], capture_output=True, text=True)
out = subprocess.run(['sudo', '-u', 'www-data', 'php', '/srv/mediawiki/1.41/maintenance/run.php', '/srv/mediawiki/1.41/extensions/CreateWiki/maintenance/setContainersAccess.php', '--wiki', wiki], capture_output=True, text=True)

matches = re.findall(r"Making sure 'mwstore:\/\/miraheze-swift\/([^']+)' [^\n]+\.failed\.", out.stdout)
for match in matches:
os.system(f"swift post --read-acl 'mw:media' --write-acl 'mw:media' miraheze-{wiki}-{match}")

os.system(f"sudo -u www-data php /srv/mediawiki/1.40/maintenance/run.php /srv/mediawiki/1.40/extensions/CreateWiki/maintenance/setContainersAccess.php --wiki {wiki}")
os.system(f"sudo -u www-data php /srv/mediawiki/1.41/maintenance/run.php /srv/mediawiki/1.41/extensions/CreateWiki/maintenance/setContainersAccess.php --wiki {wiki}")

0 comments on commit 955174b

Please sign in to comment.