19 Commits

Author SHA1 Message Date
Georges-Antoine Assi
67375fa5cd
self cleanup 2025-11-19 18:38:51 -05:00
Georges-Antoine Assi
51652d5084
make all path stuff async 2025-07-18 10:53:55 -04:00
Georges-Antoine Assi
ff7fdbd9a4
fix moving files and folders 2025-07-17 21:31:27 -04:00
Georges-Antoine Assi
c93687a0f4
handle some errors better 2025-07-17 18:15:44 -04:00
Georges-Antoine Assi
ea50b2c401
fix the firmware endpoint 2025-07-17 14:59:20 -04:00
Georges-Antoine Assi
aaf6741e93
Create safe filesystem handler 2025-07-17 12:30:57 -04:00
zurdi
6f08912fc0
refactor: remove unnecessary logging highlights and improve log messages for clarity 2025-05-09 10:25:11 +00:00
zurdi
14761c2c83
refactor: enhance logging with highlighted output for improved readability 2025-05-09 09:05:59 +00:00
Georges-Antoine Assi
c2747c5185
file name matching should be reverse match 2025-04-23 14:24:24 -04:00
Georges-Antoine Assi
cc899b54e2
refactor exclude_files fnct 2025-04-23 13:52:11 -04:00
Georges-Antoine Assi
7bde4aee70
complete the rst of the files 2024-12-20 23:45:25 -05:00
Michael Manganiello
0fad8ac282
feat: Use nginx mod_zip to generate multi-file zip downloads
This change installs and configures the `mod_zip` nginx module [1],
which allows nginx to stream ZIP files directly.

It includes a workaround needed to correctly calculate CRC-32 values for
included files, by including a new `server` section listening at port
8081, only used for the file requests to be upstream subrequests that
correctly trigger the CRC-32 calculation logic.

Also, to be able to provide a `m3u` file generated on the fly, we add a
`/decode` endpoint fully implemented in nginx using NJS, which receives
a `value` URL param, and decodes it using base64. The decoded value is
returned as the response.

That way, the contents of the `m3u` file is base64-encoded, and set as
part of the response, for `mod_zip` to include it in the ZIP file.

[1] https://github.com/evanmiller/mod_zip
2024-08-20 22:39:33 -03:00
Georges-Antoine Assi
9386ca9e4a
changes from self-review 2024-07-27 16:31:32 -04:00
Georges-Antoine Assi
2e91c440e3
Read into mem in chunks 2024-07-16 17:42:25 -04:00
Michael Manganiello
f20a9ffe34
fix: Avoid recursive os.walk calls
`os.walk` is a generator that can iteratively navigate from the
specified path, top-bottom. However, most of the calls to `os.walk` in
the project cast the call to `list()`, which makes it traverse the path
and recursively find all nested directories.

This is commonly not needed, as we end up just using a `[0]` index to
only access the root path.

This change adds a few utils that simplifies listing files/directories,
and by default does it non-recursively. Performance gains shouldn't be
noticeable in systems with high-speed storage, but we can avoid the edge
cases of users having too many nested directories, by avoiding unneeded
I/O.
2024-07-13 15:30:04 -03:00
Georges-Antoine Assi
b2085f87a8
bunch of fixes for trunk 2024-05-21 17:10:11 -04:00
Georges-Antoine Assi
a7cf0d389a
run trunk format on all files 2024-05-21 10:18:13 -04:00
Georges-Antoine Assi
3e42f3ab56
also ignore firmware files on scan that match 2024-05-16 23:12:27 -04:00
Georges-Antoine Assi
dc33054ba1
more name refactoring 2024-05-05 16:45:58 -04:00