Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(deploy): resolve CR PR notes

justin6a5e84d1d223
diff --git a/Dockerfile.kaneo b/Dockerfile.kaneo
index f75f5d5de..bf44a5ee3 100644
--- a/Dockerfile.kaneo
+++ b/Dockerfile.kaneo
@@ -23,8 +23,7 @@ WORKDIR /app/packages/email
RUN pnpm run build
WORKDIR /app/apps/api
-RUN sed -i 's/"extends": "@kaneo\/typescript-config\/base.json"/"extends": "..\/..\/packages\/typescript-config\/base.json"/g' /app/apps/api/tsconfig.json && \
- pnpm run build
+RUN pnpm run build
FROM node:20.20.2-alpine AS api-runtime
diff --git a/apps/docs/core/installation/docker-compose.mdx b/apps/docs/core/installation/docker-compose.mdx
index 8513ddb70..2ce882e74 100644
--- a/apps/docs/core/installation/docker-compose.mdx
+++ b/apps/docs/core/installation/docker-compose.mdx
@@ -34,6 +34,11 @@ services:
postgres:
condition: service_healthy
restart: unless-stopped
+ healthcheck:
+ test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5173/api/health"]
+ interval: 30s
+ timeout: 5s
+ retries: 3
volumes:
postgres_data:
diff --git a/apps/docs/core/installation/migration.mdx b/apps/docs/core/installation/migration.mdx
index 456f2b65d..5678b5e6e 100644
--- a/apps/docs/core/installation/migration.mdx
+++ b/apps/docs/core/installation/migration.mdx
@@ -69,7 +69,7 @@ services:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
- test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-kaneo} -d $${POSTGRES_DB:-kaneo}"]
+ test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER:-kaneo}\" -d \"$${POSTGRES_DB:-kaneo}\""]
interval: 10s
timeout: 5s
retries: 5
@@ -241,7 +241,9 @@ After upgrading, a minimal `.env` for Docker Compose requires three values:
```env
KANEO_CLIENT_URL=http://localhost:5173
POSTGRES_PASSWORD=changeme
-AUTH_SECRET= # generate: openssl rand -hex 32
+AUTH_SECRET=replace_with_output_of_openssl_rand_hex_32
```
+Generate a stable secret with `openssl rand -hex 32` and keep it persistent, or active sessions will be invalidated after a container restart.
+
`POSTGRES_DB` and `POSTGRES_USER` default to `kaneo` if not set. `KANEO_API_URL` and `DATABASE_URL` are derived automatically.
diff --git a/apps/web/nginx.kaneo.conf b/apps/web/nginx.kaneo.conf
index 73ba56ad7..95cee51ab 100644
--- a/apps/web/nginx.kaneo.conf
+++ b/apps/web/nginx.kaneo.conf
@@ -4,8 +4,9 @@ server {
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
- add_header X-XSS-Protection "1; mode=block" always;
+ add_header X-XSS-Protection "0" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
+ client_max_body_size 25m;
gzip on;
gzip_vary on;
@@ -18,6 +19,8 @@ server {
proxy_pass http://127.0.0.1:1337/api/;
proxy_http_version 1.1;
proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
diff --git a/deploy/kaneo-entrypoint.sh b/deploy/kaneo-entrypoint.sh
index b39f65b49..5fd53eff0 100644
--- a/deploy/kaneo-entrypoint.sh
+++ b/deploy/kaneo-entrypoint.sh
@@ -1,6 +1,25 @@
#!/bin/sh
set -eu
+urlencode() {
+ node -e 'const input = process.argv[1]; process.stdout.write(encodeURIComponent(input).replace(/[!\x27()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`));' "$1"
+}
+
+api_pid=""
+nginx_pid=""
+
+cleanup() {
+ if [ -n "$api_pid" ]; then
+ kill "$api_pid" 2>/dev/null || true
+ fi
+
+ if [ -n "$nginx_pid" ]; then
+ kill "$nginx_pid" 2>/dev/null || true
+ fi
+}
+
+trap cleanup EXIT INT TERM
+
# Derive KANEO_API_URL from KANEO_CLIENT_URL if not explicitly set
if [ -z "${KANEO_API_URL:-}" ] && [ -n "${KANEO_CLIENT_URL:-}" ]; then
export KANEO_API_URL="${KANEO_CLIENT_URL}/api"
@@ -12,7 +31,9 @@ if [ -z "${DATABASE_URL:-}" ]; then
POSTGRES_DB="${POSTGRES_DB:-kaneo}"
POSTGRES_USER="${POSTGRES_USER:-kaneo}"
if [ -n "${POSTGRES_PASSWORD:-}" ]; then
- export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
+ encoded_user="$(urlencode "$POSTGRES_USER")"
+ encoded_password="$(urlencode "$POSTGRES_PASSWORD")"
+ export DATABASE_URL="postgresql://${encoded_user}:${encoded_password}@postgres:5432/${POSTGRES_DB}"
echo "DATABASE_URL not set — derived from POSTGRES_* vars"
else
echo "ERROR: DATABASE_URL is not set and POSTGRES_PASSWORD is not set" >&2
@@ -22,7 +43,7 @@ fi
# Auto-generate AUTH_SECRET if not set
if [ -z "${AUTH_SECRET:-}" ]; then
- export AUTH_SECRET="$(openssl rand -hex 32)"
+ export AUTH_SECRET="$(node -e 'process.stdout.write(require("node:crypto").randomBytes(32).toString("hex"))')"
echo "WARNING: AUTH_SECRET not set — generated a random secret for this session."
echo "WARNING: Set AUTH_SECRET in your .env to persist sessions across restarts."
fi
@@ -45,12 +66,6 @@ echo "API is ready"
nginx -g "daemon off;" &
nginx_pid=$!
-cleanup() {
- kill "$api_pid" "$nginx_pid" 2>/dev/null || true
-}
-
-trap cleanup INT TERM
-
while kill -0 "$api_pid" 2>/dev/null && kill -0 "$nginx_pid" 2>/dev/null; do
sleep 1
done