From 68eaee0b9f7ea43631db393de77b370dae1ba14e Mon Sep 17 00:00:00 2001 From: Anders Holck Date: Tue, 26 May 2026 23:51:02 +0200 Subject: [PATCH] Complete TODO items: security, features, polish Security: - Encrypt Gitea tokens at rest (AES-256-GCM with MH_SECRET) - Secure cookie flag when behind HTTPS (X-Forwarded-Proto) - Password complexity (min 8 chars) - TOTP: defer persist until verified (totp_pending column) - Audit log table + logging on login/rename/password change Features: - Rename files/folders (double-click in tree, /api/files/rename) - beforeunload warning for unsaved changes - Mobile hamburger menu - PWA icons (192px, 512px) - Max file size enforcement (10MB) - Shared file read access (cross-user with permission check) Polish: - Toast notifications replace all alert() calls - Keyboard shortcut help overlay (Ctrl+/) - File rename via double-click in FileTree --- TODO.md | 30 ++--- frontend/public/icon-192.png | Bin 0 -> 546 bytes frontend/public/icon-512.png | Bin 0 -> 1880 bytes frontend/src/App.vue | 157 ++++++++++++++++++++++++--- frontend/src/components/FileTree.vue | 7 +- internal/api/build.go | 19 +++- internal/api/handlers.go | 68 +++++++++++- internal/api/middleware.go | 4 + internal/api/router.go | 1 + internal/api/totp.go | 28 +++-- internal/crypto/crypto.go | 30 +++++ internal/db/db.go | 15 ++- 12 files changed, 310 insertions(+), 49 deletions(-) create mode 100644 frontend/public/icon-192.png create mode 100644 frontend/public/icon-512.png diff --git a/TODO.md b/TODO.md index bf5ee99..68f727a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,21 +1,21 @@ # TODO ## Security -- [ ] Encrypt Gitea tokens at rest in SQLite (use app-level AES with MH_SECRET) -- [ ] Add `Secure` flag to auth cookie when behind HTTPS (detect via X-Forwarded-Proto) -- [ ] Password complexity requirements (min length, etc.) -- [ ] TOTP: don't persist secret until verified (currently saves on setup) -- [ ] Audit log (who did what, when) +- [x] Encrypt Gitea tokens at rest in SQLite (use app-level AES with MH_SECRET) +- [x] Add `Secure` flag to auth cookie when behind HTTPS (detect via X-Forwarded-Proto) +- [x] Password complexity requirements (min 8 chars) +- [x] TOTP: don't persist secret until verified (uses totp_pending column) +- [x] Audit log (who did what, when) ## Features -- [ ] Rename files/folders (currently only move) +- [x] Rename files/folders (double-click in tree) - [ ] Image upload (drag-drop into editor, store in assets folder) -- [ ] Browser `beforeunload` warning with unsaved changes -- [ ] Mobile hamburger menu to toggle sidebar -- [ ] PWA icons (icon-192.png, icon-512.png) -- [ ] Session expiry / logout button in UI -- [ ] Max file size enforcement on upload -- [ ] Shared file read access (cross-user file serving) +- [x] Browser `beforeunload` warning with unsaved changes +- [x] Mobile hamburger menu to toggle sidebar +- [x] PWA icons (icon-192.png, icon-512.png) +- [x] Session expiry / logout button in UI +- [x] Max file size enforcement on upload (10MB) +- [x] Shared file read access (cross-user file serving) ## Testing - [ ] End-to-end: WYSIWYG mode (Milkdown) @@ -27,9 +27,9 @@ - [ ] End-to-end: offline edit → reconnect sync ## Polish -- [ ] Error toasts instead of alert() +- [x] Error toasts instead of alert() - [ ] Loading spinners on API calls -- [ ] Keyboard shortcut help overlay (Ctrl+?) -- [ ] File rename inline in tree (double-click) +- [x] Keyboard shortcut help overlay (Ctrl+/) +- [x] File rename inline in tree (double-click) - [ ] Drag files to trash - [ ] Sort files (name, date, size) diff --git a/frontend/public/icon-192.png b/frontend/public/icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..3885e1a6426974dfe044e0486ac8571a86674705 GIT binary patch literal 546 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE2}s`E_d9@rf$^oMi(^Q|oVS-Yaxy3|95A^5 zU4DJ>CwA)&ffJ0fR?lt~NhcXTrJk#0U^!dG$e_)`pm2(TVbLfx8U&-MU^F9)mIb55;mD{F?E3Du VJWXLX6a?0o44$rjF6*2UngETSuy+6e literal 0 HcmV?d00001 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index dcdae28..55d63bb 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,6 +1,11 @@