Skip to content

Commit e96d6e2

Browse files
authored
fix(web): enforce media ACL on request path, not resolved symlink (#173)
* fix(web): enforce media ACL on request path, not resolved symlink When media files are sharded symlinks (pointing to _shared/XX/), resolve() follows the symlink and the ACL tried to parse "_shared" as a chat ID — always failing with 403 for restricted users. Admin was unaffected because unrestricted users skip ACL entirely. Fix: enforce ACL on the original request path which contains the actual chat folder, not the resolved filesystem target. * fix(web): fix bright blue safe-area on mobile Safari Body had a blue gradient that showed through safe-area padding on iOS. Moved gradient to login page only; app body uses slate-900 matching theme-color meta tag.
1 parent 20e2ca3 commit e96d6e2

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "telegram-archive"
7-
version = "7.11.1"
7+
version = "7.11.2"
88
description = "Automated Telegram backup with Docker. Performs incremental backups of messages and media on a configurable schedule."
99
readme = "README.md"
1010
requires-python = ">=3.14"

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Telegram Backup Automation - Main Package
33
"""
44

5-
__version__ = "7.11.1"
5+
__version__ = "7.11.2"

src/web/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,9 @@ async def serve_media(path: str, download: int = Query(0), user: UserContext = D
947947
if not resolved.is_relative_to(_media_root):
948948
raise HTTPException(status_code=403, detail="Access denied")
949949

950-
_enforce_media_acl(str(resolved.relative_to(_media_root)), user)
950+
# ACL uses the original request path (chat folder), not the resolved symlink
951+
# target — symlinks into _shared/ don't carry chat folder context.
952+
_enforce_media_acl(path, user)
951953

952954
if not resolved.is_file():
953955
raise HTTPException(status_code=404, detail="File not found")

src/web/templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@
268268
</script>
269269
</head>
270270

271-
<body class="bg-gradient-to-br from-blue-600 via-blue-700 to-blue-800 text-white h-screen overflow-hidden">
271+
<body class="bg-slate-900 text-white h-screen overflow-hidden">
272272
<div id="app" class="w-full h-full">
273273
<!-- Login Page -->
274-
<div v-if="!isAuthenticated" class="w-full h-full flex items-center justify-center">
274+
<div v-if="!isAuthenticated" class="w-full h-full flex items-center justify-center bg-gradient-to-br from-blue-600 via-blue-700 to-blue-800">
275275
<div
276276
class="bg-white/10 backdrop-blur-lg rounded-2xl shadow-2xl p-10 w-full max-w-md border border-white/20">
277277
<!-- Telegram Logo -->

0 commit comments

Comments
 (0)