Commit Graph
47 Commits
Author SHA1 Message Date
retoor 85fec57bb7 feat: replace upload_path with upload_folder in thumbnail handler path resolution
The diff shows a single change in `src/rupload/app.py` within the `handle_thumbnail` function: the attribute `request.app.upload_path` is replaced with `request.app.upload_folder` when constructing the `thumbnail_path`. This aligns the thumbnail generation logic with the correct configuration key used elsewhere in the application, fixing a potential `AttributeError` or path mismatch when the `upload_path` attribute is undefined or deprecated.
2024-12-03 20:59:57 +00:00
retoor 0516bd4a5f fix: correct thumbnail path resolution to use request.app instead of app in handle_thumbnail 2024-12-03 20:59:06 +00:00
retoor 05b70cf94e fix: correct thumbnail path resolution to use app.upload_path instead of safe_path parent
The thumbnail path was incorrectly derived from the safe_path parent directory,
causing thumbnails to be stored relative to the file location rather than the
configured upload root. This change ensures thumbnails are consistently placed
under the application's upload_path/.thumbnail/ directory, fixing path resolution
for files in nested subdirectories.
2024-12-03 20:58:21 +00:00
retoor e389d81aeb feat: change thumbnail route from /uploads/thumbnail/ to /thumbnail/ in app.py 2024-12-03 20:56:29 +00:00
retoor 201a78c963 feat: restrict thumbnail path to upload directory to prevent directory traversal 2024-12-03 20:54:58 +00:00
retoor 92d855dd2a feat: remove existence check before file type validation in thumbnail handler 2024-12-03 20:50:32 +00:00
retoor 5ce5796abb fix: remove unsafe path join in handle_thumbnail to prevent directory traversal
The previous implementation joined the user-supplied path with the configured upload directory, but the resulting path was not validated against the intended base directory. This change removes the base path join entirely, leaving the path resolution to the caller or a separate validation layer. The fix prevents potential directory traversal attacks where a malicious path could escape the upload directory.
2024-12-03 20:50:16 +00:00
retoor b1d1974704 feat: add pillow dependency and thumbnail endpoint for uploaded images 2024-12-03 20:45:26 +00:00
retoor 118140ca55 chore: extract default constants and add webp/svg to get_images extensions 2024-12-01 09:27:41 +00:00
retoor ebad87c5d1 style: reformat imports, f-string, and line wrapping in rupload app and cli modules 2024-12-01 09:21:20 +00:00
retoor 387a8dc9cd feat: add fallback message for empty upload status in handle_index response 2024-11-26 07:25:14 +00:00
retoor 40fa720ad9 fix: correct typo in virtual environment activation path in README
The activation script path in the installation instructions was missing a forward slash, changing 'bin/activate' to 'bin.activate'. This fix restores the correct path for sourcing the Python virtual environment.
2024-11-26 07:14:03 +00:00
retoor a550667378 docs: replace pip-based install steps with make commands in README 2024-11-26 07:13:31 +00:00
retoor d564093193 feat: add full-screen black overlay with fade-in animation and interaction blocking
Implements a complete blacked-out visual state where all content is replaced by a solid black overlay covering the entire viewport. The overlay includes smooth fade-in animation and prevents any user interaction with underlying elements. This creates an immersive dark experience suitable for cinematic transitions or focus modes.
2024-11-26 07:03:36 +00:00
retoor da7fa63169 chore: add border-radius to thumbnails and register /uploads static route 2024-11-26 06:59:09 +00:00
retoor bda8470f67 style: adjust h2 margin-top and remove redundant line breaks in upload page 2024-11-26 06:44:15 +00:00
retoor 2fa7c04898 style: reduce thumbnail margin to 3px and add line break before uploaded files section 2024-11-26 06:42:27 +00:00
retoor ef93230bed style: reduce thumbnail margin from 10px to 5px in upload page CSS for tighter grid density 2024-11-26 06:41:09 +00:00
retoor 5ce5a9ede3 style: adjust viewport initial-scale from 1.0 to 0.9 for better mobile layout scaling 2024-11-26 06:39:43 +00:00
retoor d345030f86 style: add invert filter to container-images and fix HTML line breaks in image/file lists 2024-11-26 06:36:28 +00:00
retoor f6e41aa002 feat: replace static background image with brand-color css linear gradient in layout
Updated the main layout component's background styling by swapping the previous static image URL for a CSS linear-gradient using brand colors. This change improves page load performance and aligns the visual theme with the updated design system.
2024-11-26 06:32:52 +00:00
retoor 5570ecacb2 style: replace solid white background with subtle gradient in main container 2024-11-26 06:31:36 +00:00
retoor 02dd36aa06 style: add word-break rule to upload page CSS for long filename wrapping 2024-11-26 06:29:06 +00:00
retoor 2bcf2dc990 chore: remove stale pycache binaries and fix .gitignore path from src/upload to src/rupload 2024-11-26 06:26:27 +00:00
retoor f70f2854e1 style: update page title, monospace font, and wrap thumbnails in links in upload page 2024-11-26 06:25:27 +00:00
retoor 1f43d61524 fix: correct syntax error in handle_index by removing stray equals sign 2024-11-26 06:21:23 +00:00
retoor aeb54beb27 feat: fix malformed anchor tag syntax in handle_index response builder 2024-11-26 06:19:13 +00:00
retoor f8c3fbee7d feat: fix f-string interpolation for anchor tag href attribute in handle_index 2024-11-26 06:18:20 +00:00
retoor 53925dab2c fix: correct URL hyperlink generation in upload success message handling
The handle_index function now properly constructs HTML anchor tags by splitting the message at the "here: " prefix instead of using the raw upload URL, fixing broken link rendering when the upload URL appears in the success message. The handle_upload function also adds a trailing space after the "here:" prefix to ensure consistent parsing.
2024-11-26 06:17:53 +00:00
retoor bd5f0bd042 feat: wrap upload url in anchor tag with proper href attribute in handle_index 2024-11-26 06:10:41 +00:00
retoor b67024ab06 fix: fix index extraction from upload URL message using find instead of hardcoded offset
The previous implementation used a hardcoded offset of `len("here: ")` from the start of the string after `"here:"`, which would fail if the URL appeared at a different position or if the message structure changed. This commit replaces the brittle slice with a dynamic `str.find()` call to locate the `"here: "` substring, ensuring the URL is correctly extracted regardless of its position in the message. The fix applies to the `handle_index` handler in `src/rupload/app.py`.
2024-11-26 06:08:41 +00:00
retoor 87ebae5a79 fix: replace hardcoded upload url extraction with dynamic "here:" prefix parsing in handle_index 2024-11-26 06:07:13 +00:00
retoor 009b2ad475 fix: correct URL extraction offset in handle_index anchor generation 2024-11-26 06:00:06 +00:00
retoor ad8cbe211c fix: correct variable name typo 'rquest' to 'request' in upload URL extraction logic 2024-11-26 05:57:32 +00:00
retoor 351934b9ed fix: correct upload URL replacement logic to handle edge cases with trailing slashes
The previous implementation incorrectly sliced the URL from the message by starting at the found index without accounting for the length of the upload URL, causing malformed anchor tags when the URL contained trailing slashes. This fix adjusts the slicing to start after the full upload URL string and properly escapes double quotes in the href attribute.
2024-11-26 05:56:12 +00:00
retoor bcb18e8195 fix: add missing slash between upload_url and filename in generate_upload_url
The generate_upload_url method previously concatenated self.upload_url directly with the filename, producing malformed URLs when upload_url did not end with a trailing slash. Changed the concatenation to insert "/" between the base URL and filename, ensuring correct redirect paths regardless of upload_url format.
2024-11-26 05:50:56 +00:00
retoor a280f5dec7 fix: fix AttributeError in handle_upload by calling generate_upload_url on request.app instead of self 2024-11-26 05:48:39 +00:00
retoor 1aa4712a86 fix: change static file mount point from /uploads to root path in app router 2024-11-26 05:46:42 +00:00
retoor 462b7ebdee fix: fix syntax error in mkdir call by removing trailing whitespace before closing parenthesis 2024-11-26 05:31:23 +00:00
retoor fb327d2f9b feat: make upload path configurable via UPLOAD_PATH env var with fallback to ./uploads 2024-11-26 05:30:47 +00:00
retoor 836f809df4 feat: add upload folder quota parameter and enforce 10GB default in Rupload class 2024-11-26 05:24:14 +00:00
retoor 42e48271e2 chore: add uploads directory wildcard to .gitignore for exclusion
The diff adds a new line `uploads/*` to the `.gitignore` file, ensuring all contents within the `uploads` directory are excluded from version control.
2024-11-26 05:05:24 +00:00
retoor ab5d3d6333 chore: delete all 13 png screenshots and surf-2.1.tar.gz from uploads directory 2024-11-26 05:04:50 +00:00
retoor ccd9edf566 feat: add Gitea CI build pipeline with Makefile install target and updated CLI help in PKG-INFO 2024-11-26 05:04:33 +00:00
retoor 45ce49c246 docs: add code block formatting and missing closing fence to usage section in readme 2024-11-26 04:57:50 +00:00
retoor 57a9a89cd8 docs: add project description, setup instructions, and CLI usage to README 2024-11-26 04:57:12 +00:00
retoor b5d889c478 feat: scaffold rupload project with Makefile, setup.cfg, cli, and aiohttp app skeleton 2024-11-26 03:34:46 +00:00