-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage_github.py
More file actions
335 lines (307 loc) · 12.2 KB
/
Copy pathpackage_github.py
File metadata and controls
335 lines (307 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Dead Software Rescue -- GitHub Mirror Packager
Creates provenance READMEs and tar.gz archives for each GitHub bare mirror.
"""
import json, tarfile, sys, io
from pathlib import Path
from datetime import datetime, timezone
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
MIRRORS = Path("C:/Users/Tyrone/Documents/dead-software-rescue/mirrors")
PACKAGES = Path("C:/Users/Tyrone/Documents/dead-software-rescue/packages")
CAPTURE_DATE = "2026-04-24"
# All 17 GitHub bare mirrors with metadata
GITHUB_PROJECTS = [
# Tier 1 — Confirmed Dead
{
"dir": "Cryptocat.git",
"name": "Cryptocat",
"tier": "1",
"tier_label": "Confirmed Dead — officially discontinued",
"type": "Encrypted group chat (browser extension + desktop)",
"death": "Discontinued February 2019",
"reason": "Critical crypto vulnerability in 2013 destroyed trust. Never recovered despite a full rewrite.",
"source": "https://github.com/cryptocat/cryptocat",
},
{
"dir": "TorChat.git",
"name": "TorChat",
"tier": "1",
"tier_label": "Confirmed Dead — officially discontinued",
"type": "Tor-based P2P instant messaging",
"death": "All development stopped after 2014",
"reason": "Single developer vanished. Relied on deprecated Tor hidden service protocol.",
"source": "https://github.com/prof7bit/TorChat",
},
{
"dir": "Surespot.git",
"name": "Surespot",
"tier": "1",
"tier_label": "Confirmed Dead — officially discontinued",
"type": "E2E encrypted messenger for Android/iOS",
"death": "Shut down July 31, 2022",
"reason": "Solo developer, unsustainable maintenance burden.",
"source": "https://github.com/DevlinBlankert/surespot-encrypted-messenger",
},
{
"dir": "Ricochet Original.git",
"name": "Ricochet (Original)",
"tier": "1",
"tier_label": "Confirmed Dead — officially discontinued",
"type": "Tor-based anonymous IM",
"death": "Development ended November 2016",
"reason": "Relies on deprecated Tor v2 onion services. Ricochet Refresh is the community fork still alive.",
"source": "https://github.com/ricochet-im/ricochet",
},
# Tier 2 — Effectively Dead
{
"dir": "PyBitmessage.git",
"name": "PyBitmessage",
"tier": "2",
"tier_label": "Effectively Dead — zombie state",
"type": "Decentralised serverless encrypted messaging protocol (Python)",
"death": "Sporadic commits; effectively stalled",
"reason": "Python 2 dependency (EOL 2020). No completed port to Python 3. Tiny dev team.",
"source": "https://github.com/Bitmessage/PyBitmessage",
},
{
"dir": "qTox.git",
"name": "qTox",
"tier": "2",
"tier_label": "Effectively Dead — zombie state",
"type": "P2P encrypted messenger, voice and video (Qt/C++)",
"death": "Development of almost all Tox clients abandoned",
"reason": "Developer drama, mass exodus. Protocol complexity. No sustainable funding.",
"source": "https://github.com/qTox/qTox",
},
{
"dir": "QKSMS.git",
"name": "QKSMS",
"tier": "2",
"tier_label": "Effectively Dead — zombie state",
"type": "Open-source SMS app for Android",
"death": "Last commit June 2023",
"reason": "Solo developer moved on. Android SMS API changes made maintenance painful.",
"source": "https://github.com/moezbhatti/qksms",
},
{
"dir": "Kontalk.git",
"name": "Kontalk",
"tier": "2",
"tier_label": "Effectively Dead — zombie state",
"type": "XMPP-based encrypted messenger (Android)",
"death": "Minimal development, tiny user base",
"reason": "Cannot compete with Signal. No funding. Volunteer burnout.",
"source": "https://github.com/kontalk/androidclient",
},
{
"dir": "LetsChat.git",
"name": "Let's Chat",
"tier": "2",
"tier_label": "Effectively Dead — zombie state",
"type": "Self-hosted team chat (Node.js + MongoDB)",
"death": "No meaningful updates in years",
"reason": "Superseded by Rocket.Chat, Mattermost, and Zulip.",
"source": "https://github.com/sdelements/lets-chat",
},
# Tier 3 — Abandoned IRC/XMPP clients
{
"dir": "Subway.git",
"name": "Subway (IRC)",
"tier": "3",
"tier_label": "Abandoned IRC/XMPP client",
"type": "Web-based IRC client",
"death": "Not currently functional and not under active development",
"reason": "Developer recommends The Lounge instead.",
"source": "https://github.com/thedjpetersen/subway",
},
{
"dir": "CloudBot.git",
"name": "CloudBot (IRC)",
"tier": "3",
"tier_label": "Abandoned IRC/XMPP client",
"type": "Python IRC bot framework",
"death": "Unmaintained for over a decade",
"reason": "No active maintainers.",
"source": "https://github.com/CloudBotIRC/CloudBot",
},
{
"dir": "Blackened.git",
"name": "Blackened (IRC)",
"tier": "3",
"tier_label": "Abandoned IRC/XMPP client",
"type": "IRC client",
"death": "Abandoned by developer",
"reason": "Developer graduated, got a job, walked away.",
"source": "https://github.com/tjensen/blackened",
},
{
"dir": "irc-client-Haskell.git",
"name": "irc-client (Haskell)",
"tier": "3",
"tier_label": "Abandoned IRC/XMPP client",
"type": "Haskell IRC client library",
"death": "Explicitly labelled abandonware by maintainer",
"reason": "Maintainer self-declared it abandonware.",
"source": "https://github.com/barrucadu/irc-client",
},
{
"dir": "most-IRC.git",
"name": "most (IRC)",
"tier": "3",
"tier_label": "Abandoned IRC/XMPP client",
"type": "Python IRC client",
"death": "Repo name literally includes 'abandoned'",
"reason": "Moved to iivvoo-abandoned GitHub org by author.",
"source": "https://github.com/iivvoo-abandoned/most",
},
# Tier 5 — Zombie P2P / Decentralised
{
"dir": "Friends-Chat.git",
"name": "Friends Chat",
"tier": "5",
"tier_label": "Zombie P2P / Decentralised",
"type": "P2P offline-friendly open-source chat (like Slack but P2P)",
"death": "No recent development",
"reason": "Niche use case, no sustained community.",
"source": "https://github.com/moose-team/friends",
},
{
"dir": "Cabal.git",
"name": "Cabal",
"tier": "5",
"tier_label": "Zombie P2P / Decentralised",
"type": "P2P community offline-first chat platform",
"death": "Development sporadic",
"reason": "Extremely niche, no funding path.",
"source": "https://github.com/cabal-club/cabal",
},
{
"dir": "DeChat.git",
"name": "DeChat",
"tier": "5",
"tier_label": "Zombie P2P / Decentralised",
"type": "Decentralised browser-extension chat",
"death": "Proof of concept, never gained users",
"reason": "No real development beyond initial demo.",
"source": "https://github.com/agilgur5/DeChat",
},
]
def dir_size_kb(path: Path) -> float:
return round(sum(f.stat().st_size for f in path.rglob("*") if f.is_file()) / 1024, 1)
def count_objects(git_dir: Path) -> str:
"""Count loose objects in a bare git repo as a rough commit proxy."""
try:
objects = git_dir / "objects"
count = sum(1 for f in objects.rglob("*") if f.is_file() and f.parent.name not in ("info", "pack"))
packs = list((objects / "pack").glob("*.pack")) if (objects / "pack").exists() else []
parts = []
if count:
parts.append(f"{count} loose objects")
if packs:
parts.append(f"{len(packs)} pack file(s)")
return ", ".join(parts) if parts else "bare repo"
except Exception:
return "bare repo"
def make_readme(proj: dict, git_dir: Path) -> str:
size_kb = dir_size_kb(git_dir)
obj_info = count_objects(git_dir)
lines = [
"=" * 72,
"DEAD SOFTWARE RESCUE — Preservation Package",
"=" * 72,
"",
f"Project: {proj['name']}",
f"Tier: {proj['tier']} — {proj['tier_label']}",
f"Type: {proj['type']}",
f"Death/Status: {proj['death']}",
f"Death reason: {proj['reason']}",
f"Source: {proj['source']}",
"",
"--- Preservation ---",
f"Captured: {CAPTURE_DATE} by Dead Software Rescue project",
f"Packaged: {datetime.now(timezone.utc).strftime('%Y-%m-%d')}",
f"Method: git clone --mirror (bare repository, full history preserved)",
f"Archive size: {size_kb} KB",
f"Repo contents: {obj_info}",
"",
"--- Contents of this archive ---",
f" {git_dir.name}/ (bare git mirror — all branches, tags, full history)",
"",
"To use this mirror:",
" git clone <this_dir>/<project>.git my-local-copy",
" (or: git clone --mirror to re-mirror elsewhere)",
"",
f"Original source: {proj['source']}",
"",
"This package was created for archival and research purposes.",
"All software belongs to its respective authors and is subject to its original license.",
"=" * 72,
]
return "\n".join(lines) + "\n"
def pack_project(proj: dict) -> dict | None:
git_dir = MIRRORS / proj["dir"]
if not git_dir.exists():
print(f" SKIP — {git_dir} not found")
return None
out_name = f"{proj['dir'].replace('.git','').replace(' ', '_')}_rescue_{CAPTURE_DATE}.tar.gz"
out_path = PACKAGES / out_name
if out_path.exists():
print(f" EXISTS — {out_name}, skipping")
return {"package": out_name, "skipped": True}
readme_text = make_readme(proj, git_dir)
readme_tmp = PACKAGES / f"_README_{proj['name']}.txt"
readme_tmp.write_text(readme_text, encoding="utf-8")
print(f" Packing {out_name} ...")
archive_root = proj["dir"].replace(".git", "").replace(" ", "_")
with tarfile.open(out_path, "w:gz") as tar:
tar.add(readme_tmp, arcname=f"{archive_root}/README.txt")
tar.add(git_dir, arcname=f"{archive_root}/{proj['dir']}")
readme_tmp.unlink()
size_mb = round(out_path.stat().st_size / (1024 * 1024), 2)
print(f" -> {out_name} ({size_mb} MB)")
return {"package": out_name, "size_mb": size_mb}
def main():
PACKAGES.mkdir(parents=True, exist_ok=True)
print("\n" + "=" * 60)
print(" Dead Software Rescue — GitHub Mirror Packager")
print(f" Projects: {len(GITHUB_PROJECTS)}")
print(f" Output: {PACKAGES}")
print("=" * 60)
results = []
for proj in GITHUB_PROJECTS:
print(f"\n[{proj['name']}]")
r = pack_project(proj)
if r:
results.append({**r, "name": proj["name"], "tier": proj["tier"]})
packed = [r for r in results if not r.get("skipped")]
skipped = [r for r in results if r.get("skipped")]
total_mb = sum(r.get("size_mb", 0) for r in packed)
print(f"\n{'='*60}")
print(f" Done.")
print(f" Newly packed: {len(packed)}")
print(f" Skipped (already existed): {len(skipped)}")
print(f" Total new size: {total_mb:.1f} MB")
print(f"{'='*60}")
# Append to existing package_log.json
log_path = PACKAGES / "package_log.json"
if log_path.exists():
with open(log_path, encoding="utf-8") as f:
log = json.load(f)
else:
log = {"packages": []}
for r in packed:
log["packages"].append({
"name": r["name"],
"tier": r["tier"],
"source": "github",
"package": r["package"],
"size_mb": r.get("size_mb"),
"packaged_at": datetime.now(timezone.utc).isoformat(),
})
with open(log_path, "w", encoding="utf-8") as f:
json.dump(log, f, indent=2, ensure_ascii=False)
print(f" Log updated -> {log_path}")
if __name__ == "__main__":
main()