From 072409b3b4df53e1622e68bdc235b1a406254213 Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sat, 20 Sep 2025 19:12:28 +0200 Subject: [PATCH 1/3] ADD env variables section in README --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index ff79986..8843593 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,20 @@ ip -br a | curl -X POST https://aukpad.com --data-binary @- # command output ## Installation +### Environment Variables + +The following environment variables can be configured: + +| Variable | Default | Description | +|----------|---------|-------------| +| `USE_VALKEY` | `false` | Enable Valkey/Redis caching. Set to `true` to enable | +| `VALKEY_URL` | `redis://localhost:6379/0` | Redis/Valkey connection URL | +| `MAX_TEXT_SIZE` | `1048576` | Maximum text size in bytes (1MB default) | +| `MAX_CONNECTIONS_PER_IP` | `10` | Maximum concurrent connections per IP address | +| `RETENTION_HOURS` | `48` | How long to retain pads in hours (48 hours default) | + +### Running + WORK IN PROGRESS --- From a982722d50d9f66ecdbaaf83de4c2d980c20f3fc Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sat, 20 Sep 2025 19:16:45 +0200 Subject: [PATCH 2/3] CHANGE unit of MAX_FILE_SIZE from byte to megabyte --- README.md | 2 +- app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8843593..769649f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The following environment variables can be configured: |----------|---------|-------------| | `USE_VALKEY` | `false` | Enable Valkey/Redis caching. Set to `true` to enable | | `VALKEY_URL` | `redis://localhost:6379/0` | Redis/Valkey connection URL | -| `MAX_TEXT_SIZE` | `1048576` | Maximum text size in bytes (1MB default) | +| `MAX_TEXT_SIZE` | `5` | Maximum text size in MB (5MB default) | | `MAX_CONNECTIONS_PER_IP` | `10` | Maximum concurrent connections per IP address | | `RETENTION_HOURS` | `48` | How long to retain pads in hours (48 hours default) | diff --git a/app.py b/app.py index 4f27ab3..fa88503 100644 --- a/app.py +++ b/app.py @@ -11,7 +11,7 @@ application = app # alias if you prefer "application" # Environment variables USE_VALKEY = os.getenv("USE_VALKEY", "false").lower() == "true" VALKEY_URL = os.getenv("VALKEY_URL", "redis://localhost:6379/0") -MAX_TEXT_SIZE = int(os.getenv("MAX_TEXT_SIZE", "1048576")) # 1MB default +MAX_TEXT_SIZE = int(os.getenv("MAX_TEXT_SIZE", "5")) * 1024 * 1024 # 5MB default MAX_CONNECTIONS_PER_IP = int(os.getenv("MAX_CONNECTIONS_PER_IP", "10")) RETENTION_HOURS = int(os.getenv("RETENTION_HOURS", "48")) # Default 48 hours From b117eab888d5d721641bc2178e510bf4799f25ad Mon Sep 17 00:00:00 2001 From: CaffeineFueled Date: Sat, 20 Sep 2025 19:44:18 +0200 Subject: [PATCH 3/3] ADD DESCRIPTION env var and /system/info endpoint --- README.md | 1 + app.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 769649f..cde0d08 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ The following environment variables can be configured: | `MAX_TEXT_SIZE` | `5` | Maximum text size in MB (5MB default) | | `MAX_CONNECTIONS_PER_IP` | `10` | Maximum concurrent connections per IP address | | `RETENTION_HOURS` | `48` | How long to retain pads in hours (48 hours default) | +| `DESCRIPTION` | `powered by aukpad.com` | Instance description shown on info page | ### Running diff --git a/app.py b/app.py index fa88503..e28fdd9 100644 --- a/app.py +++ b/app.py @@ -14,6 +14,7 @@ VALKEY_URL = os.getenv("VALKEY_URL", "redis://localhost:6379/0") MAX_TEXT_SIZE = int(os.getenv("MAX_TEXT_SIZE", "5")) * 1024 * 1024 # 5MB default MAX_CONNECTIONS_PER_IP = int(os.getenv("MAX_CONNECTIONS_PER_IP", "10")) RETENTION_HOURS = int(os.getenv("RETENTION_HOURS", "48")) # Default 48 hours +DESCRIPTION = os.getenv("DESCRIPTION", "powered by aukpad.com") # Valkey/Redis client (initialized later if enabled) redis_client = None @@ -128,7 +129,7 @@ HTML = """ max-width: 1000px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; height: 100vh; box-sizing: border-box; } header { display:flex; justify-content:space-between; align-items:center; margin-bottom: .5rem; flex-shrink: 0; } a,button { padding:.35rem .6rem; text-decoration:none; border:1px solid #ddd; border-radius:8px; background:#fff; } - #newpad { background:#000; color:#fff; border:1px solid #000; } + #newpad { background:#000; color:#fff; border:1px solid #000; font-weight:bold; } #status { font-size:.9rem; opacity:.7; margin-left:.5rem; } #status::before { content: "●"; margin-right: .3rem; color: #ef4444; } #status.connected::before { color: #22c55e; } @@ -140,6 +141,7 @@ HTML = """ #t { padding:.5rem .75rem; width:100%; height: 100%; resize: none; border:0; outline:0; overflow:auto; white-space: pre; } #newpad { margin-left:.5rem; } + #info { margin-left:.5rem; color: black; font-size: 0.8rem; } pre {margin: 0; }
@@ -149,6 +151,7 @@ HTML = """
New pad + Info
@@ -156,6 +159,7 @@ HTML = """
+