Compare commits

..
88 Commits
Author SHA1 Message Date
bot 15612eab4c Update build files. 2026-06-14 19:05:39 +00:00
bot 949e7b84f7 chore: update rupload wheel and sdist to version 1.3.37 with metadata version 2.4
RUpload build / Build (push) Successful in 1m6s
Replace binary wheel and source distribution archives in dist/ for rupload 1.3.37,
and bump PKG-INFO metadata version from 2.1 to 2.4 in the egg-info directory.
2026-06-14 14:46:14 +00:00
bot 5015e64bd2 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-12-13 19:24:52 +00:00
retoor ecf2aa0527 chore: increase max upload file size constant from 50MB to 300MB in rupload app config 2024-12-13 19:22:48 +00:00
bot c551e69bb6 chore: update build artifacts for rupload 1.3.37 with compressed wheel and tarball 2024-12-03 21:12:58 +00:00
retoor 22ed8844b9 fix: correct thumbnail path construction and case-insensitive image suffix check in get_images and create_images_html 2024-12-03 21:11:18 +00:00
bot 81b8825884 chore: update binary wheel and source tarball for rupload 1.3.37 release 2024-12-03 21:04:15 +00:00
retoor 65f596c51c fix: correct thumbnail path resolution to use upload_path instead of upload_folder 2024-12-03 21:02:53 +00:00
retoor 879a42039d feat: fix path traversal in thumbnail handler by using path.name on full path string 2024-12-03 21:01:57 +00:00
retoor 1747045941 fix: correct thumbnail path construction to use pathlib consistently in handle_thumbnail 2024-12-03 21:01:00 +00:00
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
bot f08844193b chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-12-03 20:57:49 +00:00
retoor e389d81aeb feat: change thumbnail route from /uploads/thumbnail/ to /thumbnail/ in app.py 2024-12-03 20:56:29 +00:00
bot 629439043d chore: update build artifacts for rupload 1.3.37 with strict mode and deprecated warnings disabled 2024-12-03 20:56:11 +00:00
retoor 201a78c963 feat: restrict thumbnail path to upload directory to prevent directory traversal 2024-12-03 20:54:58 +00:00
bot 458b98a870 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-12-03 20:52:00 +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
bot 6470e170f1 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-12-03 20:46:42 +00:00
retoor b1d1974704 feat: add pillow dependency and thumbnail endpoint for uploaded images 2024-12-03 20:45:26 +00:00
bot 5a2dd5f926 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-12-01 09:28:48 +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
bot 4821bae92f chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 07:26:51 +00:00
retoor 387a8dc9cd feat: add fallback message for empty upload status in handle_index response 2024-11-26 07:25:14 +00:00
bot d7ab7ddb13 chore: update PKG-INFO installation instructions to use make commands instead of raw venv steps 2024-11-26 07:15:12 +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
bot 8317958a0f chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 07:04:56 +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
bot ab304d82dc chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 07:00:36 +00:00
retoor da7fa63169 chore: add border-radius to thumbnails and register /uploads static route 2024-11-26 06:59:09 +00:00
bot 1a60bd02ad chore: update binary wheel and source tarball to version 1.3.37 2024-11-26 06:45:41 +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
bot 400cc1dc52 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:43:45 +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
bot 2e2d02340a chore: update built distribution archives for rupload v1.3.37 release 2024-11-26 06:42:22 +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
bot 3a000f2ce5 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:40:56 +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
bot 68828686bf chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:37:47 +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
bot 33e0155031 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:34:09 +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
bot e691bf5a18 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:32:51 +00:00
retoor 5570ecacb2 style: replace solid white background with subtle gradient in main container 2024-11-26 06:31:36 +00:00
bot 1cab3d2147 chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:30:27 +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
bot 38d935f8ad chore: update binary wheel and source tarball to version 1.3.37 in dist directory 2024-11-26 06:27:39 +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
bot 0d16afae00 chore: add compiled pyc cache files and rebuild wheel/tarball for v1.3.37 2024-11-26 06:22:48 +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
bot 0c594872bc chore: update rupload package to version 1.3.37 with rebuilt wheel and sdist artifacts 2024-11-26 06:12:00 +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
bot 934387860a chore: rebuild rupload 1.3.37 wheel and sdist with updated compiled bytecache 2024-11-26 06:10:05 +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
bot bff6baaa45 chore: update rupload wheel and sdist to version 1.3.37 with refreshed pyc bytecode 2024-11-26 06:08:25 +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
bot c2394502b5 chore: update rupload wheel and sdist binaries to version 1.3.37 with refreshed pyc cache 2024-11-26 06:01:31 +00:00
retoor 009b2ad475 fix: correct URL extraction offset in handle_index anchor generation 2024-11-26 06:00:06 +00:00
bot 9defb4e1b2 chore: remove outdated dist artifacts and __pycache__ bytecode for rupload 1.3.37 2024-11-26 05:58:49 +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
bot b97c05ceb8 chore: update rupload wheel and sdist to version 1.3.37 with rebuilt pyc cache 2024-11-26 05:57:27 +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
bot 0dcb3f0d45 chore: rebuild rupload 1.3.37 wheel and sdist with updated compiled bytecache 2024-11-26 05:52:14 +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
bot ee4d3dfd47 chore: update rupload wheel and sdist binaries to version 1.3.37 with refreshed pyc cache 2024-11-26 05:50:08 +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
bot 098b70fd09 chore: update binary wheel and source distribution for rupload 1.3.37 release 2024-11-26 05:48:01 +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
bot d6e684a58c chore: update binary wheel and source distribution to version 1.3.37 with refreshed bytecode caches 2024-11-26 05:32:47 +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
bot 206d4ff6a6 chore: add built wheel and sdist for rupload 1.3.37 with updated pyc cache 2024-11-26 05:26:28 +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
bot c736af6835 chore: add compiled pyc cache files and rebuild dist wheels for rupload 1.3.37 2024-11-26 05:06:53 +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
6 changed files with 31 additions and 5 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
+1
View File
@@ -16,6 +16,7 @@ python_requires = >=3.7
install_requires = install_requires =
aiohttp==3.10.10 aiohttp==3.10.10
dataset==1.6.2 dataset==1.6.2
pillow
[options.packages.find] [options.packages.find]
where = src where = src
+2 -1
View File
@@ -1,4 +1,4 @@
Metadata-Version: 2.1 Metadata-Version: 2.4
Name: rupload Name: rupload
Version: 1.3.37 Version: 1.3.37
Summary: upload tool Summary: upload tool
@@ -9,6 +9,7 @@ Requires-Python: >=3.7
Description-Content-Type: text/markdown Description-Content-Type: text/markdown
Requires-Dist: aiohttp==3.10.10 Requires-Dist: aiohttp==3.10.10
Requires-Dist: dataset==1.6.2 Requires-Dist: dataset==1.6.2
Requires-Dist: pillow
# RUpload # RUpload
+1
View File
@@ -1,2 +1,3 @@
aiohttp==3.10.10 aiohttp==3.10.10
dataset==1.6.2 dataset==1.6.2
pillow
+26 -3
View File
@@ -2,7 +2,7 @@ import pathlib
from aiohttp import web from aiohttp import web
MAX_FILE_SIZE = 1024 * 1024 * 50 # 50Mb MAX_FILE_SIZE = 1024 * 1024 * 300 # 50Mb
UPLOAD_FOLDER_QUOTA = 10 * 1024 * 1024 * 1024 # 10Gb UPLOAD_FOLDER_QUOTA = 10 * 1024 * 1024 * 1024 # 10Gb
UPLOAD_URL = "/" UPLOAD_URL = "/"
UPLOAD_PATH = "uploads" UPLOAD_PATH = "uploads"
@@ -174,7 +174,7 @@ def format_size(size):
def get_images(path): def get_images(path):
images = [] images = []
for image in pathlib.Path(path).iterdir(): for image in pathlib.Path(path).iterdir():
if image.is_file() and image.suffix in [ if image.is_file() and image.suffix.lower() in [
".png", ".png",
".jpg", ".jpg",
".gif", ".gif",
@@ -200,7 +200,8 @@ def create_images_html(url, image_paths):
images_html = "" images_html = ""
for image_path in image_paths: for image_path in image_paths:
path = url.rstrip("/") + "/" + image_path.name path = url.rstrip("/") + "/" + image_path.name
images_html += f'<a href="{path}"><img class="thumbnail" src="{path}" alt="{image_path.name}" /></a>\n' thumbnail_path = "/thumbnail/" + url.strip("/") + "/" + image_path.name
images_html += f'<a href="{path}"><img class="thumbnail" src="{thumbnail_path}" alt="{image_path.name}" /></a>\n'
return images_html return images_html
@@ -267,6 +268,27 @@ async def handle_upload(request: web.Request):
return web.Response(status=400, text="No file uploaded.") return web.Response(status=400, text="No file uploaded.")
async def handle_thumbnail(request: web.Request):
path = request.match_info["path"]
safe_path = pathlib.Path(request.app.upload_path).joinpath(pathlib.Path(path).name)
if not safe_path.is_file():
return web.Response(status=400, text="Invalid file type.")
thumbnail_path = pathlib.Path(request.app.upload_path).joinpath(".thumbnail").joinpath(pathlib.Path(safe_path).name)
if not thumbnail_path.parent.exists():
thumbnail_path.parent.mkdir(exist_ok=True,parents=False)
if not thumbnail_path.exists():
from PIL import Image
image = Image.open(safe_path)
image.thumbnail((200, 200))
image.save(thumbnail_path)
return web.FileResponse(thumbnail_path)
async def handle_index(request: web.Request): async def handle_index(request: web.Request):
image_paths = get_images(request.app.upload_path) image_paths = get_images(request.app.upload_path)
images_html = create_images_html( images_html = create_images_html(
@@ -312,6 +334,7 @@ def create_app(
web.get("/", handle_index), web.get("/", handle_index),
web.post("/upload", handle_upload), web.post("/upload", handle_upload),
web.static("/", upload_path), web.static("/", upload_path),
web.get("/thumbnail/{path:.*}", handle_thumbnail),
web.static("/uploads", upload_path), web.static("/uploads", upload_path),
] ]
) )