Merged
Conversation
…nsubscribe (v7.4.1) - Avatar ACL: extract chat_id from avatar filenames to enforce per-chat scoping for restricted users (serve_media + serve_thumbnail) - /internal/push: add optional INTERNAL_PUSH_SECRET bearer token to prevent co-tenant containers from spoofing live events - Reaction recovery: retry ALL reactions after sequence reset, not just the one that triggered the duplicate-key error (rollback loses all) - Push unsubscribe: scope DELETE to requesting user's username to prevent cross-user endpoint removal
|
🐳 Dev images published!
The dev/test instance will pick up these changes automatically (Portainer GitOps). To test locally: docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses 4 findings from second security review pass.
serve_media()andserve_thumbnail()now extractchat_idfrom avatar filenames (avatars/{users|chats}/{chat_id}_*.jpg) and enforce per-chat scoping for restricted users. Previously, theavatars/prefix bypassed ACL entirely./internal/pushnow supports an optionalINTERNAL_PUSH_SECRETenv var. When set, the notifier sends it as a bearer token and the viewer validates it — preventing co-tenant containers from spoofing live events. IP-only auth remains as fallback for backward compatibility.insert_reactions()now retries ALL reactions in a fresh transaction instead of just the one that triggered the error. The previousreturnafter a single retry lost all remaining reactions.POST /api/push/unsubscribenow scopes the DELETE to the requesting user'susername, preventing cross-user endpoint removal.Test plan
pytest tests/ --ignore=tests/test_telegram_import.py)/media/avatars/chats/<other_chat_id>_*.jpgINTERNAL_PUSH_SECRETblocks requests without matching bearer token