BlueGit

timfa filemanager

Update technical and test indexes

Documented the new chmod/listing behaviour and installer root-mode toggle in the technical reference, and regenerated the test index to include the new files route coverage group.

timfa Tim Falken · pushed by timfa

Authored 2026-05-25 · 5 months ago

Hash
50f40b7c83e70d83ce8ffbba9a4c91b082792d99
Parent
ebc01089
2 files changed +9 −0
.github/technical-reference.md +8 −0
@@ -1,5 +1,9 @@
1 1 # Technical Reference
2 2
3 ## installsystemdservice.sh
4 - bool_is_true(value) - Parses common truthy string values used for installer feature flags.
5 - FILEMANAGER_SERVICE_RUN_AS_ROOT - Optional installer env flag; when true, writes a root-running systemd unit (omits User=) and enables FILEMANAGER_LIST_ACCESS_CHMOD in the unit environment.
6
3 7 ## server/index.js
4 8 - start() - Initialises DB/keys, starts HTTP/HTTPS servers, and starts the background thumbnail cache loop.
5 9 - shutdown(opts, ...servers) - Graceful teardown: stops thumbnail loop, closes DB/servers, exits with configurable code after drain/timeout.
@@ -80,6 +84,9 @@
80 84 - GET /api/files/roots - Returns readable roots with display label (alias when configured), originalName, and path.
81 85 - GET /api/files/roots - Adds a synthetic 'My folder' root for the authenticated user when userPath is configured.
82 86 - loadConfigAndRoots() - Loads config and effective roots together so route access checks stay consistent.
87 - parseOctalMode(rawValue, fallback) - Parses optional octal chmod mode overrides from environment variables and falls back to secure defaults when invalid.
88 - envFlagEnabled(name) - Boolean environment flag parser for file-route runtime feature toggles.
89 - applyRecursiveAccessChmod(startDir) - Best-effort recursive chmod pass used for Samba-style compatibility on folder-access requests; skips symlinks and continues past individual errors.
83 90 - resolveRootForUser(absPath, roots, user, config) - Resolves access for configured roots plus user-owned personal folder.
84 91 - resolveRootForUser(absPath, roots, user, config) - Allows admins to access orphaned user folders (deleted-account folders) under userPath.
85 92 - resolveRootForUser(absPath, roots, user, config) - Treats the local subtitle debug log directory as an admin-only read-only browse root for the debug menu.
@@ -96,6 +103,7 @@
96 103 - POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
97 104 - GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
98 105 - GET /api/files/list - Returns directory items including name/path/isDir plus size, mtime, and uploadedAt; uploadedAt comes from persisted `file_meta.uploaded_at` when present, otherwise it is backfilled from filesystem creation/change metadata and saved.
106 - GET /api/files/list - When FILEMANAGER_LIST_ACCESS_CHMOD=1, runs a best-effort recursive chmod on the opened folder before listing (defaults: dirs 0777, files 0666; overrides via FILEMANAGER_LIST_ACCESS_CHMOD_DIR_MODE and FILEMANAGER_LIST_ACCESS_CHMOD_FILE_MODE).
99 107 - GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
100 108 - GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
101 109 - GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
@@ -1,5 +1,9 @@
1# Technical Reference
1# Technical Reference
2
2
3## installsystemdservice.sh
4- bool_is_true(value) - Parses common truthy string values used for installer feature flags.
5- FILEMANAGER_SERVICE_RUN_AS_ROOT - Optional installer env flag; when true, writes a root-running systemd unit (omits User=) and enables FILEMANAGER_LIST_ACCESS_CHMOD in the unit environment.
6
3## server/index.js
7## server/index.js
4- start() - Initialises DB/keys, starts HTTP/HTTPS servers, and starts the background thumbnail cache loop.
8- start() - Initialises DB/keys, starts HTTP/HTTPS servers, and starts the background thumbnail cache loop.
5- shutdown(opts, ...servers) - Graceful teardown: stops thumbnail loop, closes DB/servers, exits with configurable code after drain/timeout.
9- shutdown(opts, ...servers) - Graceful teardown: stops thumbnail loop, closes DB/servers, exits with configurable code after drain/timeout.
@@ -80,6 +84,9 @@
80- GET /api/files/roots - Returns readable roots with display label (alias when configured), originalName, and path.
84- GET /api/files/roots - Returns readable roots with display label (alias when configured), originalName, and path.
81- GET /api/files/roots - Adds a synthetic 'My folder' root for the authenticated user when userPath is configured.
85- GET /api/files/roots - Adds a synthetic 'My folder' root for the authenticated user when userPath is configured.
82- loadConfigAndRoots() - Loads config and effective roots together so route access checks stay consistent.
86- loadConfigAndRoots() - Loads config and effective roots together so route access checks stay consistent.
87- parseOctalMode(rawValue, fallback) - Parses optional octal chmod mode overrides from environment variables and falls back to secure defaults when invalid.
88- envFlagEnabled(name) - Boolean environment flag parser for file-route runtime feature toggles.
89- applyRecursiveAccessChmod(startDir) - Best-effort recursive chmod pass used for Samba-style compatibility on folder-access requests; skips symlinks and continues past individual errors.
83- resolveRootForUser(absPath, roots, user, config) - Resolves access for configured roots plus user-owned personal folder.
90- resolveRootForUser(absPath, roots, user, config) - Resolves access for configured roots plus user-owned personal folder.
84- resolveRootForUser(absPath, roots, user, config) - Allows admins to access orphaned user folders (deleted-account folders) under userPath.
91- resolveRootForUser(absPath, roots, user, config) - Allows admins to access orphaned user folders (deleted-account folders) under userPath.
85- resolveRootForUser(absPath, roots, user, config) - Treats the local subtitle debug log directory as an admin-only read-only browse root for the debug menu.
92- resolveRootForUser(absPath, roots, user, config) - Treats the local subtitle debug log directory as an admin-only read-only browse root for the debug menu.
@@ -96,6 +103,7 @@
96- POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
103- POST /api/files/folder-icon - Sets or clears a folder's explicit icon assignment; imagePath must have a cached thumbnail; write access required.
97- GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
104- GET /api/files/search - Fuzzy-searches all readable roots (and personal folder when configured) for files, returning ranked matches with path metadata.
98- GET /api/files/list - Returns directory items including name/path/isDir plus size, mtime, and uploadedAt; uploadedAt comes from persisted `file_meta.uploaded_at` when present, otherwise it is backfilled from filesystem creation/change metadata and saved.
105- GET /api/files/list - Returns directory items including name/path/isDir plus size, mtime, and uploadedAt; uploadedAt comes from persisted `file_meta.uploaded_at` when present, otherwise it is backfilled from filesystem creation/change metadata and saved.
106- GET /api/files/list - When FILEMANAGER_LIST_ACCESS_CHMOD=1, runs a best-effort recursive chmod on the opened folder before listing (defaults: dirs 0777, files 0666; overrides via FILEMANAGER_LIST_ACCESS_CHMOD_DIR_MODE and FILEMANAGER_LIST_ACCESS_CHMOD_FILE_MODE).
99- GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
107- GET /api/files/search-images - Fuzzy-searches readable roots for image files with ready thumbnails, returning capped results plus scan-truncation metadata for scalable global favicon selection.
100- GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
108- GET /api/files/global-favicon-image - Publicly serves the configured global favicon thumbnail file so browsers can load `<link rel="icon">` without auth headers.
101- GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
109- GET /api/files/global-favicon - Returns the configured global favicon source file path ({favicon:{filePath}} or {favicon:null}).
.github/tests.md +1 −0
@@ -47,6 +47,7 @@
47 47 - `GET /api/files/thumbnail`
48 48 - `GET /api/files/root-access`
49 49 - `orphaned user folder access`
50 - `list access recursive chmod`
50 51 - `subtitle debug cache access`
51 52 - `folder icon endpoints`
52 53 - `file search endpoint`
@@ -47,6 +47,7 @@
47- `GET /api/files/thumbnail`
47- `GET /api/files/thumbnail`
48- `GET /api/files/root-access`
48- `GET /api/files/root-access`
49- `orphaned user folder access`
49- `orphaned user folder access`
50- `list access recursive chmod`
50- `subtitle debug cache access`
51- `subtitle debug cache access`
51- `folder icon endpoints`
52- `folder icon endpoints`
52- `file search endpoint`
53- `file search endpoint`