Commit Graph
17 Commits
Author SHA1 Message Date
daniel156161 3db374b1ab feat(files): cache served files and add HTML text viewer
Build and Push Docker Container / build-and-push (push) Successful in 2m37s
File cache:
- Add my_modules/filecache with metadata, blob, validator and store layers
- Cache convex.get_file via AsyncCache, TTL clamped to the file expiry
- Skip caching for missing, incomplete or already expired records
- Add a process-local, size-bounded LRU for immutable storage blobs
- Build the cache stack from FILE_CACHE_* env vars in build_file_cache
- Attach the cache to the app in my_modules/app/setup.py
- Expose app-bound helpers in filecache/access.py for routes

Serving:
- Send strong ETag, Last-Modified and Cache-Control on served files
- Answer If-None-Match and If-Modified-Since with 304 from metadata only
- Avoid pulling the blob from Convex on a revalidation hit
- Add a short Cloudflare-CDN-Cache-Control edge window for deleted files
- Record cache_status in the wide event on a 304
- Invalidate cached metadata after file update and delete in both routes

Text viewer:
- Add my_modules/textview to render text/plain and text/markdown as HTML
- Linkify http(s) URLs and trim trailing sentence punctuation
- Resolve links pointing at this instance to the referenced file
- Inline image previews, mark missing and expired targets
- Cap resolution at MAX_LOOKUPS backend lookups per document
- Serve the viewer only for real browser navigations, never for curl or CLI
- Keep raw bytes for ?raw=1, downloads and Accept headers without text/html
- Add templates/side/views/webpage/files/text_view.htm with a raw link

Other:
- Add tests for cache layers, serving, text rendering and the route
- Bump multidict to 7.2.1 in uv.lock
- Update the my_helpers submodule pointer
2026-10-25 18:54:46 +01:00
daniel156161 6514ba16f6 feat: adopt Python 3.15 and harden caching and share links
Build and Push Docker Container / build-and-push (push) Successful in 3m58s
- Switch local Python and the Docker base image to Python 3.15.
- Refresh locked dependencies with Python-version-specific resolution.
- Replace Pickle caching with native Redis strings, lists, and typed JSON.
- Validate cache TTLs and apply expiry atomically on Redis writes.
- Treat legacy binary cache values as misses and clear keys with SCAN.
- Ignore trailing prose after decoded spaces in share-link paths.
- Reject empty or slash-containing share IDs before database lookup.
- Add regression tests for plain and encoded spaces in share links.
- Update helper submodule for config lookup and tabular storage fixes.
- Update quart_common with JSON error response detection.
- Verify all 150 tests pass on CPython 3.15.0.
2026-10-24 00:29:20 +02:00
daniel156161 48414eb297 chore: refresh deps and adjust share rate limits
Build and Push Docker Container / build-and-push (push) Successful in 1m10s
- Raise index and file-serving limits to 20 requests per minute.
- Keep hourly file-serving allowance at 500 requests.
- Increase the index hourly allowance to 500 requests.
- Update the my_helpers submodule pointer.
- Refresh uv.lock for current dependency releases.
2026-07-21 09:13:20 +02:00
daniel156161 9c731d6e67 feat(logging): add NanoShare wide event instrumentation
Build and Push Docker Container / build-and-push (push) Failing after 51s
- Register quart_common wide-event logging during app setup so every HTTP request emits one canonical structured event.

- Replace the inline security middleware with reusable quart_common security middleware wiring and move skip path configuration into app constants.

- Add NanoShare-specific wide-event context for health checks, auth/error handlers, file list/edit/delete/serve flows and upload outcomes.

- Rename runtime logging/project metadata from simple-picoshare to nanoshare where it is emitted in service context.

- Update my_helpers and quart_common submodules for Convex/wide-event integration and reusable security middleware support.

- Add NanoShare middleware tests covering safe user context, client IP enrichment, missing Convex handling and Convex security lookup failures.
2026-05-13 20:22:43 +02:00
daniel156161 3d8d74785c fix file preview url
Build and Push Docker Container / build-and-push (push) Successful in 1m30s
2026-04-11 11:35:39 +02:00
daniel156161 7b77387182 remove feature_flag_required for edit and info routes and buttons 2026-04-01 21:15:23 +02:00
daniel156161 65951a23ce use correct convex function and change how the edit html gets the file id 2026-04-01 21:05:07 +02:00
daniel156161 5bbc100d83 add info page for files 2026-04-01 20:39:25 +02:00
daniel156161 eeda177182 allow to edit files 2026-04-01 19:45:22 +02:00
daniel156161 0681bd398c not show pages that not exists yet
Build and Push Docker Container / build-and-push (push) Successful in 1m25s
2026-04-01 16:19:56 +02:00
daniel156161 d635da039f move database and file storage from edgedb and disk to convex 2025-12-22 02:04:10 +01:00
daniel156161 cd96e9135f fix not logging when user accessed they files and only show the file access from the user files and not all
Build and Push Docker Container / build-and-push (push) Successful in 1m37s
2025-10-25 14:54:00 +02:00
daniel156161 31a3e25a16 move template page files into a better structure 2025-10-25 14:20:12 +02:00
daniel156161 501acce9ba don't log if the same user access they shared files
Build and Push Docker Container / build-and-push (push) Successful in 1m30s
2025-10-25 13:55:55 +02:00
daniel156161 180fd1c071 add better rate limits
Build and Push Docker Container / build-and-push (push) Successful in 1m48s
2025-10-24 21:59:02 +02:00
daniel156161 2eda108577 add code to convert datetime into localtime into file list and add access quarys 2025-10-24 10:50:19 +02:00
daniel156161 8c2259d1de add routes and upload functions 2025-10-24 08:25:57 +02:00