diff --git a/README.md b/README.md index c2e3c60..ff79986 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Simple **live collaboration notepad** with websockets and FastAPI. -[Issue tracker](https://git.uphillsecurity.com/cf7/aukpad/issues) | `Libera Chat #aukpad` - - Status: Beta - expect minor changes. - Instance/Demo: [aukpad.com](https://aufkpad.com/) - Inspired by: @@ -15,21 +13,19 @@ The goal is to keep it simple! For feature-rich solutions are [hedgedoc](https:/ ## Features -**Use cases:** -- shared notepad on multiple machines -- collaboration on the same notepage with multiple people (notes, config, etc) -- config changes in aukpad > `curl -o app.conf https://aukpad.com/{pad_id}/raw` > change config in aukpad > repeat `curl` command - **Available**: - live collab notepad - line numbers -- custom path `{pad_id}` for more privacy +- custom path for more privacy - optional caching with valkey/redis - pad creation with HTTP post requests with curl (see *Usage*) -- `{pad_id}/raw` HTTP endpoint +- `[pad_id]/raw` HTTP endpoint **Ideas**: -[Check out the open feature requests](https://git.uphillsecurity.com/cf7/aukpad/issues?q=&type=all&sort=&state=open&labels=12&milestone=0&project=0&assignee=0&poster=0&archived=false) +- read-only views +- password protection +- E2EE +- caching/ auto-save to localstorage in browser / offline use **Not planned**: - accounts / RBAC @@ -50,69 +46,7 @@ ip -br a | curl -X POST https://aukpad.com --data-binary @- # command output ## Installation -**Please use a reverse proxy and TLS in production!** - -### Docker - -**Simple / Testing** - -`docker run -p 127.0.0.1:8000:8000 git.uphillsecurity.com/cf7/aukpad:latest` - -Open `127.0.0.1:8000` - -**Adv. example with Podman** - -```bash -# Create Pod -podman pod create --name aukpad-pod -p 127.0.0.1:8000:8000 - -# Start Valkey Container (or replace with redis) -podman run -d --name aukpad-cache \ - --replace \ - --pod aukpad-pod \ - --restart=unless-stopped \ - docker.io/valkey/valkey:7 \ - --requirepass xeZNopyIeMMncqDFPHtJQwMwIathgMWo \ - --maxmemory 2gb \ - --maxmemory-policy allkeys-lru \ - --save "" \ - --appendonly no \ - --bind 0.0.0.0 \ - --protected-mode yes - -# Start aukpad Container -podman run -d --name aukpad-app \ - --replace \ - --pod aukpad-pod \ - --read-only \ - --tmpfs /tmp \ - --security-opt no-new-privileges:true \ - --cap-drop ALL \ - --user 1000:1000 \ - -e USE_VALKEY=true \ - -e VALKEY_URL=redis://:xeZNopyIeMMncqDFPHtJQwMwIathgMWo@localhost:6379 \ - -e MAX_TEXT_SIZE=5 \ - -e MAX_CONNECTIONS_PER_IP=20 \ - -e RETENTION_HOURS=72 \ - git.uphillsecurity.com/cf7/aukpad:latest -``` - -*Tested only with Podman - Docker-Compose file might follows.* - -Enable support for web sockets in your reverse proxy of choice! - Nginx config example will be added at some point. - -### 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` | `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 after last access | -| `DESCRIPTION` | `powered by aukpad.com` | Instance description shown on info page | +WORK IN PROGRESS --- @@ -122,12 +56,6 @@ For security concerns or reports, please contact via `hello a t uphillsecurity d --- -## Notes - -- [Github Mirror available](https://github.com/CaffeineFueled1/aukpad) - ---- - ## License **Apache License** diff --git a/app.py b/app.py index e28fdd9..4f27ab3 100644 --- a/app.py +++ b/app.py @@ -11,10 +11,9 @@ 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", "5")) * 1024 * 1024 # 5MB default +MAX_TEXT_SIZE = int(os.getenv("MAX_TEXT_SIZE", "1048576")) # 1MB 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 @@ -129,7 +128,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; font-weight:bold; } + #newpad { background:#000; color:#fff; border:1px solid #000; } #status { font-size:.9rem; opacity:.7; margin-left:.5rem; } #status::before { content: "●"; margin-right: .3rem; color: #ef4444; } #status.connected::before { color: #22c55e; } @@ -141,7 +140,6 @@ 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; }
@@ -151,7 +149,6 @@ HTML = """
New pad - Info
@@ -159,7 +156,6 @@ HTML = """
-