revised approach

This commit is contained in:
rskntroot
2025-06-14 09:50:15 +00:00
parent 12941cd2c5
commit cc32c6010e
27 changed files with 1092 additions and 133 deletions

25
paste/compose.yml Normal file
View File

@@ -0,0 +1,25 @@
services:
service:
image: orhunp/rustypaste:latest
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.paste.entrypoints=websecure
- traefik.http.routers.paste.rule=Host(`paste.rskio.com`)
- traefik.http.routers.paste.tls=true
- traefik.http.routers.paste.tls.options=external@file
- traefik.http.routers.paste.tls.certresolver=rskio_certresolver
- traefik.http.routers.paste.middlewares=secureHeaders@file
- traefik.http.routers.paste.service=paste@docker
- traefik.http.services.paste.loadbalancer.server.port=8000
environment:
- RUST_LOG=debug
volumes:
- ./paste/data/:/app/upload
- ./paste/config.toml:/app/config.toml
networks:
- traefik
networks:
traefik:
external: true

62
paste/config.toml Normal file
View File

@@ -0,0 +1,62 @@
[config]
refresh_rate = "3s"
[server]
address = "127.0.0.1:8000"
url = "https://paste.rskio.com"
#workers=4
max_content_length = "10MB"
upload_path = "./upload"
timeout = "30s"
expose_version = false
expose_list = false
#auth_tokens = [
# "super_secret_token1",
# "super_secret_token2",
#]
#delete_tokens = [
# "super_secret_token1",
# "super_secret_token3",
#]
handle_spaces = "replace" # or "encode"
[landing_page]
text = """
┌─┐┌─┐┬┌─┬┌─┐ ┌─┐┌─┐┌─┐┌┬┐┌─┐
├┬┘└─┐├┴┐││ │ ├─┘├─┤└─┐ │ ├┤
┴└─└─┘┴ ┴┴└─┘ ┴ ┴ ┴└─┘ ┴ └─┘
Submit files via HTTP POST here:
curl -F 'file=@example.txt' paste.rskio.com
This will return the URL of the uploaded file.
Content expires 24 hours.
The content may be removed without warning.
"""
#file = "index.txt"
content_type = "text/plain; charset=utf-8"
[paste]
random_url = { type = "petname", words = 2, separator = "-" }
#random_url = { type = "alphanumeric", length = 8 }
#random_url = { type = "alphanumeric", length = 8, no_extension = true }
#random_url = { type = "alphanumeric", length = 6, suffix_mode = true }
default_extension = "txt"
mime_override = [
{ mime = "image/jpeg", regex = "^.*\\.jpg$" },
{ mime = "image/png", regex = "^.*\\.png$" },
{ mime = "image/svg+xml", regex = "^.*\\.svg$" },
{ mime = "video/webm", regex = "^.*\\.webm$" },
{ mime = "video/x-matroska", regex = "^.*\\.mkv$" },
{ mime = "application/octet-stream", regex = "^.*\\.bin$" },
{ mime = "text/plain", regex = "^.*\\.(log|txt|diff|sh|rs|toml)$" },
]
mime_blacklist = [
"application/x-dosexec",
"application/java-archive",
"application/java-vm",
]
duplicate_files = true
# default_expiry = "1h"
delete_expired_files = { enabled = true, interval = "24h" }