MediaWikiServerTools 0.2.3__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/PKG-INFO +2 -1
- mediawikiservertools-0.2.6/mwstools_backend/__init__.py +1 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/remote.py +22 -2
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/tsite.py +14 -4
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/version.py +1 -1
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/pyproject.toml +3 -0
- mediawikiservertools-0.2.3/mwstools_backend/__init__.py +0 -1
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.github/workflows/build.yml +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.github/workflows/upload-to-pypi.yml +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.gitignore +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.project +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.pydevproject +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/AGENTS.md +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/LICENSE +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/README.md +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/cron_backup.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/html_table.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/server.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/site.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/sql_backup.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/webscrape.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/mwstools_backend/wikibackup.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/scripts/blackisort +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/scripts/doc +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/scripts/install +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/scripts/release +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/scripts/test +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/__init__.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/smw_access.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/test_remote.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/test_server.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/test_site.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/test_sqlbackup.py +0 -0
- {mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/tests/test_wikibackup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MediaWikiServerTools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: MediaWikiServerTools: MediaWiki Server Management System
|
|
5
5
|
Project-URL: Home, https://github.com/BITPlan/MediaWikiServerTools
|
|
6
6
|
Project-URL: Source, https://github.com/BITPlan/MediaWikiServerTools
|
|
@@ -22,6 +22,7 @@ Requires-Dist: beautifulsoup4>=4.9.3
|
|
|
22
22
|
Requires-Dist: lxml
|
|
23
23
|
Requires-Dist: py-3rdparty-mediawiki>=0.19.4
|
|
24
24
|
Requires-Dist: pybasemkit>=0.2.4
|
|
25
|
+
Requires-Dist: pyexpirebackups>=0.1.3
|
|
25
26
|
Requires-Dist: pymogwai>=0.1.1
|
|
26
27
|
Requires-Dist: pymysql>=1.1.1
|
|
27
28
|
Provides-Extra: test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.6"
|
|
@@ -547,11 +547,24 @@ class Remote:
|
|
|
547
547
|
self.log.log("✅", "sync", f"{marker_path} already exists")
|
|
548
548
|
return subprocess.CompletedProcess([], 0, "", "")
|
|
549
549
|
proc = self.prepare_target_directory(target_path, run_config)
|
|
550
|
+
if proc.returncode == 0 and run_config.should_set_permissions:
|
|
551
|
+
# make the existing target tree group-writable BEFORE rsync so the
|
|
552
|
+
# rsync receiver (running as a www-data group member) can create its
|
|
553
|
+
# temp files in pre-existing images/* subdirs (closes #9).
|
|
554
|
+
# g+rwX adds execute only on directories, leaving files non-executable.
|
|
555
|
+
target_on_host = self.get_path_on_target(target_path)
|
|
556
|
+
if self.get_file_stats(target_on_host) is not None:
|
|
557
|
+
pre_perm_cmds = {
|
|
558
|
+
"chown_tree": f"sudo chown -R {run_config.uid}:{run_config.gid} {target_path}",
|
|
559
|
+
"chmod_tree": f"sudo chmod -R g+rwX {target_path}",
|
|
560
|
+
}
|
|
561
|
+
proc = self.run_cmds_as_single_cmd(pre_perm_cmds)
|
|
550
562
|
if proc.returncode == 0:
|
|
551
563
|
timeout = run_config.timeout if run_config else 30
|
|
552
564
|
rsync_cmd = (
|
|
553
565
|
f"rsync -avz --no-perms --omit-dir-times --timeout={timeout} {source_path}/* {target_path}"
|
|
554
566
|
)
|
|
567
|
+
print(f"⚙️ {rsync_cmd}")
|
|
555
568
|
proc = self.run(rsync_cmd, run_config=run_config)
|
|
556
569
|
|
|
557
570
|
if run_config.should_set_permissions and proc.returncode == 0:
|
|
@@ -564,8 +577,15 @@ class Remote:
|
|
|
564
577
|
if proc.returncode == 0:
|
|
565
578
|
self.run(f"touch {marker_path}")
|
|
566
579
|
|
|
567
|
-
|
|
568
|
-
|
|
580
|
+
success = proc.returncode == 0
|
|
581
|
+
status = "✅" if success else "❌"
|
|
582
|
+
message = f"synching {message}"
|
|
583
|
+
if not success:
|
|
584
|
+
# surface the real rsync error instead of swallowing it (closes #8)
|
|
585
|
+
message += (
|
|
586
|
+
f" failed (rc={proc.returncode})\n{proc.stdout}\n{proc.stderr}"
|
|
587
|
+
)
|
|
588
|
+
self.log.log(status, "sync", message)
|
|
569
589
|
|
|
570
590
|
return proc
|
|
571
591
|
|
|
@@ -5,6 +5,8 @@ Tools to transfer a mediawiki site from one server to another
|
|
|
5
5
|
to e.g. migrate the LAMP stack elements or move from a farm based
|
|
6
6
|
to a dockerized environment
|
|
7
7
|
|
|
8
|
+
see also https://www.semantic-mediawiki.org/wiki/SMWCon_Fall_2020/Mediawiki_1.35_Migration
|
|
9
|
+
|
|
8
10
|
@author: wf
|
|
9
11
|
"""
|
|
10
12
|
|
|
@@ -198,6 +200,7 @@ class TransferTask:
|
|
|
198
200
|
uid=33, # www-data
|
|
199
201
|
gid=33, # www-data
|
|
200
202
|
)
|
|
203
|
+
rsync_prof = Profiler("rsync sync", profile=self.args.profile)
|
|
201
204
|
proc = self.target.remote.rsync(
|
|
202
205
|
source_path=source_path,
|
|
203
206
|
target_path=site_path,
|
|
@@ -205,13 +208,20 @@ class TransferTask:
|
|
|
205
208
|
message=f"{self.wiki_site.hostname}",
|
|
206
209
|
run_config=run_config,
|
|
207
210
|
)
|
|
208
|
-
if proc.returncode
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
if proc.returncode != 0:
|
|
212
|
+
# abort on rsync failure - do not proceed to git (closes #8)
|
|
213
|
+
print(
|
|
214
|
+
f"❌ rsync sync {self.wiki_site.hostname} failed"
|
|
215
|
+
f" (rc={proc.returncode})\n{proc.stdout}\n{proc.stderr}"
|
|
216
|
+
)
|
|
217
|
+
return False
|
|
218
|
+
rsync_prof.time(f" {self.wiki_site.hostname}")
|
|
219
|
+
result = True
|
|
211
220
|
if self.use_git:
|
|
221
|
+
git_prof = Profiler("git commit", profile=self.args.profile)
|
|
212
222
|
proc = self.git_target(target_path=site_path)
|
|
213
223
|
if proc.returncode == 0:
|
|
214
|
-
|
|
224
|
+
git_prof.time(f" {self.wiki_site.hostname}")
|
|
215
225
|
else:
|
|
216
226
|
result = False
|
|
217
227
|
return result
|
|
@@ -18,7 +18,7 @@ class Version(object):
|
|
|
18
18
|
description = "MediaWiki Server Management System - Apache Site management, SQL backups, cron-based backups "
|
|
19
19
|
version = mwstools_backend.__version__
|
|
20
20
|
date = "2022-11-16"
|
|
21
|
-
updated = "2026-06-
|
|
21
|
+
updated = "2026-06-10"
|
|
22
22
|
authors = "Wolfgang Fahl"
|
|
23
23
|
doc_url = "https://wiki.bitplan.com/index.php/MediaWikiServerTools"
|
|
24
24
|
chat_url = "https://github.com/WolfgangFahl/MediaWikiServerTools/discussions"
|
|
@@ -30,6 +30,9 @@ dependencies = [
|
|
|
30
30
|
'PyMySQL>=1.1.1',
|
|
31
31
|
# https://pypi.org/project/pyMogwai/
|
|
32
32
|
"pyMogwai>=0.1.1",
|
|
33
|
+
# https://pypi.org/project/pyExpireBackups/
|
|
34
|
+
# provides the `expirebackups` module imported by mwstools_backend.cron_backup (issue #10)
|
|
35
|
+
"pyExpireBackups>=0.1.3",
|
|
33
36
|
]
|
|
34
37
|
|
|
35
38
|
requires-python = ">=3.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.3"
|
|
File without changes
|
{mediawikiservertools-0.2.3 → mediawikiservertools-0.2.6}/.github/workflows/upload-to-pypi.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|