summaryrefslogtreecommitdiff
path: root/run-demo.sh
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2025-10-13 03:12:36 +0900
committerhaturatu <taro@eyes4you.org>2025-10-13 03:12:36 +0900
commita8bff9fee9c01fdf7f3a377a838397945daad8c1 (patch)
tree1ae9f8c584e6fe09616a47b1787f01db0178b78b /run-demo.sh
parentd062e70ba21e5a4ec5b84a356c8905778535ac9c (diff)
update: run-demo.sh
Diffstat (limited to 'run-demo.sh')
-rwxr-xr-xrun-demo.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/run-demo.sh b/run-demo.sh
index 28852ac..c9bdc7a 100755
--- a/run-demo.sh
+++ b/run-demo.sh
@@ -14,11 +14,13 @@ cleanup() {
trap cleanup EXIT
echo "--> Creating .env file"
+IP_ADDRESS=$(ip -4 address | grep inet | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 | head -n1)
cat > .env << EOF
LISTEN_PORT=8080
-TARGET_URL=http://localhost:8081
+TARGET_URL=http://127.0.0.1:8081
SESSION_SECRET=$(openssl rand -base64 32)
CSRF_SECRET_KEY=$(openssl rand -base64 32)
+CSRF_TRUSTED_ORIGINS=${IP_ADDRESS}:8080
DATABASE_PATH=./auth.db
PROTECT_API=true
PROTECT_FRONTEND=true
@@ -55,8 +57,8 @@ echo ""
echo "API Token Response:"
echo "$TOKEN_RESPONSE"
echo "==================================="
-echo "Proxy is listening on http://localhost:8080/login"
-echo "Backend target is http://localhost:8081"
+echo "Proxy is listening on http://${IP_ADDRESS}:8080/login"
+echo "Backend target is http://127.0.0.1:8081"
echo ""
echo "Press Ctrl+C to stop the server."