From 685a72ab89c6c23eeaf1e7ee36c3dae01749630d Mon Sep 17 00:00:00 2001 From: Artemis Date: Tue, 14 Jul 2026 22:08:22 +0000 Subject: [PATCH] Unauffaelliger Default-Dateiname mit Zeitstempel statt harmlos.png Web-App vergibt beim Senden einen Screenshot-artigen Namen (Screenshot_YYYYMMDD_HHMMSS.png) statt des verraeterischen harmlos.png. Screenshot-Stil passt zum PNG-Format (echte Kamerafotos sind JPG). Umstellbar ueber CARRIER_PREFIX. README-Beispiele nachgezogen. Co-Authored-By: Claude Opus 4.8 --- README.md | 4 ++-- web/index.html | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e86f063..5a05524 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ python3 schattenpost.py hide \ -t "Treffpunkt morgen 18 Uhr." \ -k kontakt_bob_meine_seite/send.key \ -c urlaubsfoto.jpg \ - -o harmlos.png + -o Screenshot_20260714_220801.png ``` Der Sende-Offset im `send.key` wird dabei automatisch fortgeschrieben. @@ -84,7 +84,7 @@ Alternativ `-i datei` statt `-t`, oder Text über stdin. ### 3. Empfangen ```bash -python3 schattenpost.py reveal -s harmlos.png -k kontakt_bob_meine_seite/recv.key +python3 schattenpost.py reveal -s Screenshot_20260714_220801.png -k kontakt_bob_meine_seite/recv.key ``` Mit `-o klartext.txt` in eine Datei statt auf stdout. diff --git a/web/index.html b/web/index.html index a4091aa..6b6a457 100644 --- a/web/index.html +++ b/web/index.html @@ -237,6 +237,15 @@ if (typeof document !== 'undefined') (function () { const show = (el, kind, text) => { el.className = 'msg show ' + kind; el.textContent = text; }; const blobUrl = (bytes, mime) => URL.createObjectURL(new Blob([bytes], { type: mime || 'application/octet-stream' })); + // Unauffälliger Dateiname mit aktuellem Zeitstempel (Screenshot-Stil passt zu PNG). + // Für Kamera-Look: PREFIX auf 'IMG' setzen. Format: _YYYYMMDD_HHMMSS.png + const CARRIER_PREFIX = 'Screenshot'; + function carrierName() { + const d = new Date(), p = (n) => String(n).padStart(2, '0'); + return `${CARRIER_PREFIX}_${d.getFullYear()}${p(d.getMonth()+1)}${p(d.getDate())}` + + `_${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}.png`; + } + document.querySelectorAll('.tabs button').forEach((btn) => { btn.onclick = () => { document.querySelectorAll('.tabs button').forEach((b) => b.classList.remove('active')); @@ -291,7 +300,7 @@ if (typeof document !== 'undefined') (function () { cv.toBlob((blob) => { const url = URL.createObjectURL(blob); $('s-preview').src = url; $('s-preview').style.display = 'block'; - const dl = $('s-dlimg'); dl.href = url; dl.style.display = 'block'; + const dl = $('s-dlimg'); dl.href = url; dl.download = carrierName(); dl.style.display = 'block'; // Aktualisierter Sendeschlüssel (Offset fortgeschrieben) const nextOff = key.sendOffset + plain.length; const newKey = SP.buildKey(SP.ROLE_SEND, key.streamId, nextOff, key.material);