Compare commits

..
65 Commits
Author SHA1 Message Date
retoor b772ce8b7e Updated two extensions.
RUpload build / Build (push) Successful in 1m1s
2024-12-01 10:27:41 +01:00
retoor 8b925f852d Code style optimizations 2024-12-01 10:21:20 +01:00
bot 600edca8cd Update build files. 2024-11-26 07:26:51 +00:00
retoor 368e99da32 Added message.
RUpload build / Build (push) Successful in 1m19s
2024-11-26 08:25:24 +01:00
bot e4331976d9 Update build files. 2024-11-26 07:15:12 +00:00
retoor 2c1f519da7 Fixed typo.
RUpload build / Build (push) Successful in 1m2s
2024-11-26 08:14:03 +01:00
retoor 96fd9fd4a7 Updated readme,
RUpload build / Build (push) Has been cancelled
2024-11-26 08:13:34 +01:00
bot 96e154f9a3 Update build files. 2024-11-26 07:04:56 +00:00
retoor b7daa3ad0f Blacked.
RUpload build / Build (push) Successful in 1m1s
2024-11-26 08:03:48 +01:00
bot ed1090c773 Update build files. 2024-11-26 07:00:36 +00:00
retoor 9f20c461e4 Done.
RUpload build / Build (push) Successful in 1m12s
2024-11-26 07:59:19 +01:00
bot a4f9bd7727 Update build files. 2024-11-26 06:45:41 +00:00
retoor 54f58cbfc5 Lesss margin. New lines.
RUpload build / Build (push) Successful in 1m9s
2024-11-26 07:44:25 +01:00
bot 3b09f661d6 Update build files. 2024-11-26 06:43:45 +00:00
retoor 401f33411c Lesss margin. New lines.
RUpload build / Build (push) Successful in 1m4s
2024-11-26 07:42:35 +01:00
bot 34f3adc00c Update build files. 2024-11-26 06:42:22 +00:00
retoor 795b12f3c6 Lesss margin.
RUpload build / Build (push) Successful in 1m0s
2024-11-26 07:41:13 +01:00
bot b498f198cd Update build files. 2024-11-26 06:40:56 +00:00
retoor 46be4e34bf Responsive check.
RUpload build / Build (push) Successful in 1m5s
2024-11-26 07:39:46 +01:00
bot f3a7cebbbe Update build files. 2024-11-26 06:37:47 +00:00
retoor 5be04344cc Update background.
RUpload build / Build (push) Successful in 1m7s
2024-11-26 07:36:31 +01:00
bot f47e26143c Update build files. 2024-11-26 06:34:09 +00:00
retoor 719fa93abc Update background.
RUpload build / Build (push) Successful in 1m2s
2024-11-26 07:32:55 +01:00
bot 7a42012129 Update build files. 2024-11-26 06:32:51 +00:00
retoor 5570265eaa Update background.
RUpload build / Build (push) Successful in 1m1s
2024-11-26 07:31:45 +01:00
bot d86b8ac5a0 Update build files. 2024-11-26 06:30:27 +00:00
retoor df141e57ca Updated style.
RUpload build / Build (push) Successful in 1m8s
2024-11-26 07:29:14 +01:00
bot c91dc264f5 Update build files. 2024-11-26 06:27:39 +00:00
retoor 52e1149f74 Updated style.
RUpload build / Build (push) Successful in 1m6s
2024-11-26 07:26:27 +01:00
retoor 30d7ed5118 Changed style a bit. 2024-11-26 07:25:31 +01:00
bot c6386eb794 Update build files. 2024-11-26 06:22:48 +00:00
retoor bad8e011ce Ffs.
RUpload build / Build (push) Successful in 1m5s
2024-11-26 07:21:23 +01:00
retoor 78874deb56 Ffs.
RUpload build / Build (push) Failing after 1m1s
2024-11-26 07:19:13 +01:00
retoor 0b958e3800 Ffs.
RUpload build / Build (push) Has been cancelled
2024-11-26 07:18:20 +01:00
retoor 49f69cb688 Ffs.
RUpload build / Build (push) Has been cancelled
2024-11-26 07:17:56 +01:00
bot 9600f64eb9 Update build files. 2024-11-26 06:12:00 +00:00
retoor ec489ab30f Ffs.
RUpload build / Build (push) Successful in 1m1s
2024-11-26 07:10:52 +01:00
bot 304d163464 Update build files. 2024-11-26 06:10:05 +00:00
retoor a51c3739c9 Update url.
RUpload build / Build (push) Successful in 1m9s
2024-11-26 07:08:50 +01:00
bot a7aabcd36f Update build files. 2024-11-26 06:08:25 +00:00
retoor 03c8fb02a7 Update url.
RUpload build / Build (push) Successful in 1m1s
2024-11-26 07:07:13 +01:00
bot 3ee5232f49 Update build files. 2024-11-26 06:01:31 +00:00
retoor fb2a733f4c Right.
RUpload build / Build (push) Successful in 1m13s
2024-11-26 07:00:11 +01:00
bot 85fe10b7cd Update build files. 2024-11-26 05:58:49 +00:00
retoor 235cdc628b Fixed typo.
RUpload build / Build (push) Successful in 1m2s
2024-11-26 06:57:41 +01:00
bot 8bfa141a85 Update build files. 2024-11-26 05:57:27 +00:00
retoor 36ef6d7e4d Fix upload url replacement.
RUpload build / Build (push) Successful in 59s
2024-11-26 06:56:21 +01:00
bot 9209e43b8b Update build files. 2024-11-26 05:52:14 +00:00
retoor 28300cb055 Added missing slash.
RUpload build / Build (push) Successful in 1m3s
2024-11-26 06:51:00 +01:00
bot a875616522 Update build files. 2024-11-26 05:50:08 +00:00
retoor 37b9907334 Minor snafu.
RUpload build / Build (push) Successful in 1m5s
2024-11-26 06:48:54 +01:00
bot d79664fdc5 Update build files. 2024-11-26 05:48:01 +00:00
retoor ad1243afb7 Not sure if this will work, hope it just falls back.
RUpload build / Build (push) Successful in 1m1s
2024-11-26 06:46:53 +01:00
bot d6d31a0500 Update build files. 2024-11-26 05:32:47 +00:00
retoor 983d4d668f Automatic upload folder creation if not exists.
RUpload build / Build (push) Successful in 1m2s
2024-11-26 06:31:32 +01:00
retoor 2f6ecfe06d Made upload path dynamic. 2024-11-26 06:31:32 +01:00
bot 254cb6004b Update build files. 2024-11-26 05:26:28 +00:00
retoor e0fcf53788 Update storage quota.
RUpload build / Build (push) Successful in 1m5s
2024-11-26 06:25:07 +01:00
bot 456e3c0823 Update build files. 2024-11-26 05:06:53 +00:00
retoor 5f518c8df7 Added upload directory contents to .gitignore.
RUpload build / Build (push) Successful in 1m14s
2024-11-26 06:05:24 +01:00
retoor 15869d6537 Removed uploads content 2024-11-26 06:04:50 +01:00
retoor 3bd46cb640 Created build server configuration. 2024-11-26 06:04:33 +01:00
retoor 1ed30e0d80 Updated readme. 2024-11-26 05:57:50 +01:00
retoor 67d91a42e5 Updated readme. 2024-11-26 05:57:12 +01:00
retoor 3e72ecab20 Initial commit 2024-11-26 04:34:46 +01:00
6 changed files with 5 additions and 31 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
-1
View File
@@ -16,7 +16,6 @@ python_requires = >=3.7
install_requires =
aiohttp==3.10.10
dataset==1.6.2
pillow
[options.packages.find]
where = src
+1 -2
View File
@@ -1,4 +1,4 @@
Metadata-Version: 2.4
Metadata-Version: 2.1
Name: rupload
Version: 1.3.37
Summary: upload tool
@@ -9,7 +9,6 @@ Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: aiohttp==3.10.10
Requires-Dist: dataset==1.6.2
Requires-Dist: pillow
# RUpload
-1
View File
@@ -1,3 +1,2 @@
aiohttp==3.10.10
dataset==1.6.2
pillow
+4 -27
View File
@@ -2,7 +2,7 @@ import pathlib
from aiohttp import web
MAX_FILE_SIZE = 1024 * 1024 * 300 # 50Mb
MAX_FILE_SIZE = 1024 * 1024 * 50 # 50Mb
UPLOAD_FOLDER_QUOTA = 10 * 1024 * 1024 * 1024 # 10Gb
UPLOAD_URL = "/"
UPLOAD_PATH = "uploads"
@@ -174,7 +174,7 @@ def format_size(size):
def get_images(path):
images = []
for image in pathlib.Path(path).iterdir():
if image.is_file() and image.suffix.lower() in [
if image.is_file() and image.suffix in [
".png",
".jpg",
".gif",
@@ -200,8 +200,7 @@ def create_images_html(url, image_paths):
images_html = ""
for image_path in image_paths:
path = url.rstrip("/") + "/" + image_path.name
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'
images_html += f'<a href="{path}"><img class="thumbnail" src="{path}" alt="{image_path.name}" /></a>\n'
return images_html
@@ -268,27 +267,6 @@ async def handle_upload(request: web.Request):
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):
image_paths = get_images(request.app.upload_path)
images_html = create_images_html(
@@ -330,11 +308,10 @@ def create_app(
)
pathlib.Path(upload_path).mkdir(parents=True, exist_ok=True)
app.add_routes(
[
[
web.get("/", handle_index),
web.post("/upload", handle_upload),
web.static("/", upload_path),
web.get("/thumbnail/{path:.*}", handle_thumbnail),
web.static("/uploads", upload_path),
]
)