From f31c30f38851a96a2ab8b2f19f4402d254e63c27 Mon Sep 17 00:00:00 2001 From: alexpolo1 Date: Sat, 20 Jun 2026 10:33:50 +0200 Subject: [PATCH] security: untrack cached d2jsp scrapes, parametrize cookie helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - git rm --cached data/d2jsp_pages (102 files, already gitignored) — saved authenticated HTML embedded the live d2jsp msec session token - apply_manual_cookies.py: read member_id/msec from env vars instead of hardcoding the real session token History purge of these blobs follows in the same cleanup. Co-Authored-By: Claude Sonnet 4.6 --- data/d2jsp_topic_urls.txt | 25 ------------------------- tools/apply_manual_cookies.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 data/d2jsp_topic_urls.txt diff --git a/data/d2jsp_topic_urls.txt b/data/d2jsp_topic_urls.txt deleted file mode 100644 index 6b4b622..0000000 --- a/data/d2jsp_topic_urls.txt +++ /dev/null @@ -1,25 +0,0 @@ -https://forums.d2jsp.org/topic.php?t=109393834&f=271 -https://forums.d2jsp.org/topic.php?t=109393841&f=271 -https://forums.d2jsp.org/topic.php?t=109393817&f=271 -https://forums.d2jsp.org/topic.php?t=109387092&f=271 -https://forums.d2jsp.org/topic.php?t=109393743&f=271 -https://forums.d2jsp.org/topic.php?t=109393813&f=271 -https://forums.d2jsp.org/topic.php?t=109393750&f=271 -https://forums.d2jsp.org/topic.php?t=109393839&f=271 -https://forums.d2jsp.org/topic.php?t=109393838&f=271 -https://forums.d2jsp.org/topic.php?t=109378166&f=271 -https://forums.d2jsp.org/topic.php?t=109393710&f=271 -https://forums.d2jsp.org/topic.php?t=109343762&f=271 -https://forums.d2jsp.org/topic.php?t=109393837&f=271 -https://forums.d2jsp.org/topic.php?t=109392830&f=271 -https://forums.d2jsp.org/topic.php?t=109325785&f=271 -https://forums.d2jsp.org/topic.php?t=109350751&f=271 -https://forums.d2jsp.org/topic.php?t=109357697&f=271 -https://forums.d2jsp.org/topic.php?t=109392368&f=271 -https://forums.d2jsp.org/topic.php?t=109391282&f=271 -https://forums.d2jsp.org/topic.php?t=109393833&f=271 -https://forums.d2jsp.org/topic.php?t=109393830&f=271 -https://forums.d2jsp.org/topic.php?t=109368065&f=271 -https://forums.d2jsp.org/topic.php?t=109390974&f=271 -https://forums.d2jsp.org/topic.php?t=109393789&f=271 -https://forums.d2jsp.org/topic.php?t=109393832&f=271 diff --git a/tools/apply_manual_cookies.py b/tools/apply_manual_cookies.py index c7b3fee..a08cfd6 100644 --- a/tools/apply_manual_cookies.py +++ b/tools/apply_manual_cookies.py @@ -1,9 +1,15 @@ +import os + + def main(): # Netscape format: domain \t TRUE/FALSE \t path \t TRUE/FALSE \t expiry \t name \t value # Expiry 2000000000 is roughly the year 2033. + # Provide your own d2jsp session cookies via env vars — never hardcode them. + member_id = os.environ.get("D2JSP_MEMBER_ID", "YOUR_MEMBER_ID") + msec = os.environ.get("D2JSP_MSEC", "YOUR_MSEC_TOKEN") cookies = [ - (".d2jsp.org\tTRUE\t/\tFALSE\t2000000000\tmember_id\tREDACTED_MEMBER_ID"), - (".d2jsp.org\tTRUE\t/\tFALSE\t2000000000\tmsec\tREDACTED_D2JSP_MSEC"), + (f".d2jsp.org\tTRUE\t/\tFALSE\t2000000000\tmember_id\t{member_id}"), + (f".d2jsp.org\tTRUE\t/\tFALSE\t2000000000\tmsec\t{msec}"), ] with open("cookies.txt", "w") as f: