generate TYPESENSE_API_KEY

This commit is contained in:
2026-02-07 20:59:02 +01:00
parent af81fb3159
commit 08ced1e938
11 changed files with 236 additions and 15 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -e
DATA_DIR="/data"
KEY_FILE="$DATA_DIR/api-key"
if [ ! -f "$KEY_FILE" ]; then
tr -dc A-Za-z0-9 </dev/urandom | head -c 32 > "$KEY_FILE"
fi
API_KEY=$(cat "$KEY_FILE")
exec /opt/typesense-server \
--data-dir "$DATA_DIR" \
--api-key "$API_KEY" \
--enable-cors