From 5c9ac91b64625bd1d75de42fa84f744d716d9941 Mon Sep 17 00:00:00 2001 From: anti Date: Tue, 19 May 2026 10:08:06 -0400 Subject: [PATCH] deleted poopoo --- .claude/hooks/protect_secrets.py | 18 +++++++++++ .claude/settings.json | 18 +++++++++++ .gitignore | 6 +++- logs/monitor.log | 54 -------------------------------- 4 files changed, 41 insertions(+), 55 deletions(-) create mode 100644 .claude/hooks/protect_secrets.py create mode 100644 .claude/settings.json delete mode 100644 logs/monitor.log diff --git a/.claude/hooks/protect_secrets.py b/.claude/hooks/protect_secrets.py new file mode 100644 index 0000000..322df70 --- /dev/null +++ b/.claude/hooks/protect_secrets.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# .claude/hooks/protect_secrets.py +import json, sys + +BLOCKED = [".env", ".session", ".session-journal", "config.py"] + +data = json.load(sys.stdin) +tool = data.get("tool_name", "") +inp = data.get("tool_input", {}) + +# Get the file path depending on which tool fired +path = inp.get("file_path") or inp.get("path") or "" + +if any(path.endswith(b) for b in BLOCKED): + print(f"Blocked: {tool} on {path}", file=sys.stderr) + sys.exit(2) + +sys.exit(0) diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..43e3750 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,18 @@ +{ + "permissions": { + "deny": ["Read(.env)"] + }, + "hooks": { + "PreToolUse": [ + { + "matcher": "Read|Edit|Write", + "hooks": [ + { + "type": "command", + "command": "python3 .claude/hooks/protect_secrets.py" + } + ] + } + ] + } +} diff --git a/.gitignore b/.gitignore index 7f3ec6a..7e29a12 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,11 @@ *.session-journal bot_session* -# Data — keep the folder, ignore contents +# logs: keep the folder, ignore contents +logs/* + +# Data: keep the folder, ignore contents +data/* data/hits.db data/hits.txt data/hits.csv diff --git a/logs/monitor.log b/logs/monitor.log deleted file mode 100644 index 0580406..0000000 --- a/logs/monitor.log +++ /dev/null @@ -1,54 +0,0 @@ -2026-04-02 00:45:48,909 [INFO] utils.database: Database ready: data/hits.db -2026-04-02 00:45:49,119 [INFO] telethon.crypto.aes: libssl detected, it will be used for encryption -2026-04-02 00:45:49,156 [INFO] utils.database: Database ready: data/hits.db -2026-04-02 00:45:49,159 [INFO] tui.app: [bot] Connecting bot_client... -2026-04-02 00:45:49,159 [INFO] telethon.network.mtprotosender: Connecting to 149.154.175.59:443/TcpFull... -2026-04-02 00:45:49,203 [INFO] tui.app: [bus] EvStatus: Starting — 12 channel(s), 2 pattern(s) -2026-04-02 00:45:49,281 [INFO] telethon.network.mtprotosender: Connection to 149.154.175.59:443/TcpFull complete! -2026-04-02 00:45:49,900 [INFO] tui.app: [bot] bot_client connected, authorizing... -2026-04-02 00:45:49,901 [INFO] tui.app: [bot] bot_client ready -2026-04-02 00:45:49,901 [INFO] tui.app: [bot] Connecting user_client... -2026-04-02 00:45:49,901 [INFO] telethon.network.mtprotosender: Connecting to 149.154.175.59:443/TcpFull... -2026-04-02 00:45:49,908 [INFO] __main__: Cleaning up tmp/... -2026-04-02 00:54:16,429 [INFO] utils.database: Database ready: data/hits.db -2026-04-02 00:54:16,638 [INFO] telethon.crypto.aes: libssl detected, it will be used for encryption -2026-04-02 00:54:16,666 [ERROR] tui.app: [bot-thread] Unhandled exception: cannot import name 'HITS_CSV' from 'config' (/home/anti/Tools/sj/telegrammer/config.py) -Traceback (most recent call last): - File "/home/anti/Tools/sj/telegrammer/tui/app.py", line 848, in _run_bot_thread - loop.run_until_complete(self._bot_main()) - ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ - File "/usr/lib64/python3.14/asyncio/base_events.py", line 719, in run_until_complete - return future.result() - ~~~~~~~~~~~~~^^ - File "/home/anti/Tools/sj/telegrammer/tui/app.py", line 865, in _bot_main - from core.notifier import send_status - File "/home/anti/Tools/sj/telegrammer/core/notifier.py", line 22, in - from config import HITS_FILE, HITS_CSV, NOTIFY_CHAT_ID -ImportError: cannot import name 'HITS_CSV' from 'config' (/home/anti/Tools/sj/telegrammer/config.py) -2026-04-02 00:54:16,716 [INFO] tui.app: [bus] EvStatus: Bot thread crashed: cannot import name 'HITS_CSV' from 'config' (/home/anti/Tools/sj/telegrammer/config.py) -2026-04-02 00:54:22,624 [INFO] __main__: Cleaning up tmp/... -2026-04-02 00:54:34,773 [INFO] utils.database: Database ready: data/hits.db -2026-04-02 00:54:34,983 [INFO] telethon.crypto.aes: libssl detected, it will be used for encryption -2026-04-02 00:54:35,015 [INFO] utils.database: Database ready: data/hits.db -2026-04-02 00:54:35,015 [INFO] tui.app: [bot] Connecting bot_client... -2026-04-02 00:54:35,015 [INFO] telethon.network.mtprotosender: Connecting to 149.154.175.59:443/TcpFull... -2026-04-02 00:54:35,063 [INFO] tui.app: [bus] EvStatus: Starting — 12 channel(s), 2 pattern(s) -2026-04-02 00:54:35,120 [INFO] telethon.network.mtprotosender: Connection to 149.154.175.59:443/TcpFull complete! -2026-04-02 00:54:35,698 [INFO] tui.app: [bot] bot_client connected, authorizing... -2026-04-02 00:54:35,698 [INFO] tui.app: [bot] bot_client ready -2026-04-02 00:54:35,698 [INFO] tui.app: [bot] Connecting user_client... -2026-04-02 00:54:35,698 [INFO] telethon.network.mtprotosender: Connecting to 149.154.175.59:443/TcpFull... -2026-04-02 00:54:35,810 [INFO] telethon.network.mtprotosender: Connection to 149.154.175.59:443/TcpFull complete! -2026-04-02 00:54:36,420 [INFO] tui.app: [bot] user_client connected, checking auth... -2026-04-02 00:54:36,420 [INFO] tui.app: [bot] user_client ready -2026-04-02 00:54:36,563 [INFO] tui.app: [bus] EvStatus: Connected as 4n (@clp_c) -2026-04-02 00:54:36,653 [INFO] core.scraper: Warming entity cache (fetching dialogs)... -2026-04-02 00:54:38,437 [INFO] core.scraper: Entity cache ready. -2026-04-02 00:54:38,437 [INFO] tui.app: [bot] Handler registered for 12 channel(s) -2026-04-02 00:54:38,437 [INFO] core.scraper: [Backfill] Starting for 12 channel(s)... -2026-04-02 00:54:38,437 [INFO] core.scraper: [Backfill] Scanning history: cloudxlog (last 500 messages) -2026-04-02 00:54:38,463 [INFO] tui.app: [bus] EvStatus: Watching 12 channel(s) -2026-04-02 00:54:38,463 [INFO] tui.app: [bus] EvStatus: Live listener active -2026-04-02 00:54:38,585 [INFO] core.scraper: [Batch] 4 file(s): @cloud t13.txt, @cloud t12.txt, @cloud t11.txt, @cloud t10.txt -2026-04-02 00:54:38,585 [INFO] core.tdl_downloader: [tdl] Batch (4 files): @cloud t13.txt, @cloud t12.txt, @cloud t11.txt, @cloud t10.txt -2026-04-02 00:54:40,248 [INFO] __main__: Cleaning up tmp/...