Compare commits

..

3 Commits

Author SHA1 Message Date
ruinivist 1dc75b1dcf perf: memoize EditorCanvas to prevent unnecessary re-renders 2026-06-01 18:50:33 +00:00
ruinivist 870a321c51 perf: memoize EditorCanvas to prevent unnecessary re-renders 2026-06-01 18:46:58 +00:00
ruinivist aed3ed2e8b perf: memoize EditorCanvas to prevent unnecessary re-renders 2026-06-01 07:37:59 +00:00
4 changed files with 4 additions and 36 deletions
-4
View File
@@ -4,10 +4,6 @@
}
:80 {
basicauth /* {
{$AUTH_USER:admin} {$AUTH_HASH:$2a$14$J3A9qfgJTikjVe.XmDn49OUjOrPiiwAN3.SXbK1tvfef1XzDkIuRm}
}
encode zstd gzip
@mcp path /mcp
+1 -26
View File
@@ -3,6 +3,7 @@
Private self-hosted Excalidraw with Bun, Caddy, and SQLite.
This is bare wrapper around the excalidraw packages that adds autosave and disk-persistence.
No auth to keep things simple - you either run in a private network or put it behind Caddy auth or similar solutions.
> GPT 5.5 generated
@@ -81,29 +82,3 @@ docker run --rm \
Bind-mounting a different file to `/config/styles-guide.md` overrides the bundled default for that container.
Local non-container runs are unchanged; if you want a styles guide there, you still need a file at `/config/styles-guide.md`.
## Authentication
By default, the application is protected by basic authentication using Caddy.
The default credentials are:
- **Username:** `admin`
- **Password:** `password`
You can customize these by setting the following environment variables when running the Docker container.
The password must be hashed using `bcrypt` since Caddy requires hashed passwords for basicauth.
**Intended flow to set a custom password:**
1. Generate a bcrypt hash of your desired password. For example, using a container to run Caddy's hash-password utility:
```bash
docker run --rm caddy:2-alpine caddy hash-password --plaintext your_secure_password
```
2. Pass the generated hash and your desired username via environment variables when running the app:
```bash
docker run --rm \
-p 127.0.0.1:3000:80 \
-e PUBLIC_BASE_URL=http://localhost:3000 \
-e AUTH_USER=myuser \
-e AUTH_HASH='\$2a\$14\$exampleHash...' \
-v "$PWD/excali-box-data:/data" \
ghcr.io/ruinivist/excalidraw-box:latest
```
-4
View File
@@ -1,10 +1,6 @@
#!/bin/sh
set -eu
if [ "${AUTH_HASH:-}" = "\$2a\$14\$J3A9qfgJTikjVe.XmDn49OUjOrPiiwAN3.SXbK1tvfef1XzDkIuRm" ] || [ -z "${AUTH_HASH:-}" ]; then
echo "WARNING: Using the default password for basic authentication. It is highly recommended to change it by setting the AUTH_HASH environment variable." >&2
fi
app_pid=""
mcp_pid=""
caddy_pid=""
+3 -2
View File
@@ -1,3 +1,4 @@
import { memo } from "react";
import "../../../node_modules/@excalidraw/excalidraw/dist/prod/index.css";
import { Excalidraw } from "@excalidraw/excalidraw";
import type {
@@ -33,7 +34,7 @@ function sceneFromEditor(
};
}
export function EditorCanvas({
export const EditorCanvas = memo(function EditorCanvas({
activeId,
scene,
loading,
@@ -58,4 +59,4 @@ export function EditorCanvas({
/>
</div>
);
}
});