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.

chore(deploy): harden entrypoint defaults, CI smoke test, and workflow cleanup

randoneeringd2bbc4e143ed
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d4ed1c5e..3a52041d4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -120,3 +120,22 @@ jobs:
- name: Run API integration tests
run: pnpm test:integration
+
+ docker-build:
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v4
+
+ - name: Build kaneo image (smoke test)
+ uses: docker/build-push-action@v7
+ with:
+ context: .
+ file: ./Dockerfile.kaneo
+ platforms: linux/amd64
+ push: false
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
diff --git a/.github/workflows/docker-manual.yml b/.github/workflows/docker-manual.yml
deleted file mode 100644
index 12e188334..000000000
--- a/.github/workflows/docker-manual.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-name: Manual Docker Build
-
-on:
- workflow_dispatch:
- inputs:
- version:
- description: 'Version to tag the images (e.g., 1.0.0-beta.1, test-branch)'
- required: true
- type: string
- latest:
- description: 'Also tag as latest (use with caution)'
- required: false
- type: boolean
- default: false
-
-env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
-
-jobs:
- build-and-push-image:
- runs-on: ubuntu-24.04
- strategy:
- fail-fast: false
- matrix:
- include:
- - dockerfile: ./Dockerfile.kaneo
- image: ghcr.io/${{ github.repository_owner }}/kaneo
- - dockerfile: ./apps/web/Dockerfile
- image: ghcr.io/${{ github.repository_owner }}/web
- - dockerfile: ./apps/api/Dockerfile
- image: ghcr.io/${{ github.repository_owner }}/api
- permissions:
- contents: read
- packages: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v4
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v4
-
- - name: Log in to GitHub Container Registry
- uses: docker/login-action@v4
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GH_PACKAGE_TOKEN }}
-
- - name: Extract metadata
- id: meta
- uses: docker/metadata-action@v6
- with:
- images: ${{ matrix.image }}
- tags: |
- type=raw,value=${{ inputs.version }}
- type=raw,value=latest,enable=${{ inputs.latest }}
-
- - name: Build and push
- uses: docker/build-push-action@v7
- with:
- context: .
- file: ${{ matrix.dockerfile }}
- platforms: linux/amd64,linux/arm64
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- cache-from: type=gha
- cache-to: type=gha,mode=max
diff --git a/Dockerfile.kaneo b/Dockerfile.kaneo
index 8bcf2e838..f75f5d5de 100644
--- a/Dockerfile.kaneo
+++ b/Dockerfile.kaneo
@@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM node:20.20.2-alpine AS api-builder
RUN apk add --no-cache python3 make g++ && \
corepack enable && \
- corepack prepare [email protected] --activate
+ corepack prepare [email protected] --activate
WORKDIR /app
@@ -38,7 +38,7 @@ COPY --from=api-builder /app/packages/email/package.json ./packages/email/
RUN sed -i 's/"prepare": "husky"/"prepare": ""/g' package.json && \
corepack enable && \
- corepack prepare [email protected] --activate && \
+ corepack prepare [email protected] --activate && \
HUSKY=0 NODE_ENV=production pnpm install --prod --frozen-lockfile --no-optional
COPY --from=api-builder /app/apps/api/dist ./apps/api/dist
@@ -49,7 +49,7 @@ FROM --platform=$BUILDPLATFORM node:20.20.2-alpine AS web-builder
RUN apk add --no-cache python3 make g++ && \
corepack enable && \
- corepack prepare [email protected] --activate
+ corepack prepare [email protected] --activate
WORKDIR /app
diff --git a/apps/docs/core/installation/migration.mdx b/apps/docs/core/installation/migration.mdx
new file mode 100644
index 000000000..84ec7c490
--- /dev/null
+++ b/apps/docs/core/installation/migration.mdx
@@ -0,0 +1,247 @@
+---
+title: Migration guide
+description: How to upgrade from the two-container setup (api + web) to the combined kaneo container introduced in v2.6.0.
+---
+
+## What changed in v2.6.0
+
+This release replaces the separate `api` and `web` containers with a single `kaneo` container. nginx runs on port 5173 and proxies `/api/` requests to the internal Node API. Everything else — the database, volumes, environment variables — works the same.
+
+Three areas require changes when upgrading:
+
+1. Docker Compose — replace the `api` and `web` services with `kaneo`
+2. Environment variables — `KANEO_API_URL` and `DATABASE_URL` are now optional
+3. Helm chart — all `api.*` and `web.*` values moved under `kaneo.*` (chart version 0.3.0)
+
+---
+
+## Docker Compose
+
+### Before
+
+```yml
+services:
+ postgres:
+ image: postgres:16-alpine
+ env_file:
+ - .env
+ ports:
+ - "5432:5432"
+ volumes:
+ - postgres_data:/var/lib/postgresql/data
+ restart: unless-stopped
+
+ api:
+ image: ghcr.io/usekaneo/api:latest
+ ports:
+ - "1337:1337"
+ env_file:
+ - .env
+ depends_on:
+ - postgres
+ restart: unless-stopped
+
+ web:
+ image: ghcr.io/usekaneo/web:latest
+ ports:
+ - "5173:5173"
+ env_file:
+ - .env
+ depends_on:
+ - api
+ restart: unless-stopped
+
+volumes:
+ postgres_data:
+```
+
+### After
+
+```yml
+services:
+ postgres:
+ image: postgres:16-alpine
+ env_file:
+ - .env
+ ports:
+ - "5432:5432"
+ volumes:
+ - postgres_data:/var/lib/postgresql/data
+ restart: unless-stopped
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U kaneo -d kaneo"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ kaneo:
+ image: ghcr.io/usekaneo/kaneo:latest
+ ports:
+ - "5173:5173"
+ env_file:
+ - .env
+ depends_on:
+ postgres:
+ condition: service_healthy
+ restart: unless-stopped
+
+volumes:
+ postgres_data:
+```
+
+Remove the `api` and `web` service blocks and add the `kaneo` service. The `postgres` service is unchanged except for the added healthcheck — `kaneo` waits for it before starting.
+
+---
+
+## Environment variables
+
+### KANEO_API_URL is now optional
+
+Previously both `KANEO_CLIENT_URL` and `KANEO_API_URL` were required. Now `KANEO_API_URL` is derived automatically from `KANEO_CLIENT_URL`:
+
+```
+KANEO_API_URL = KANEO_CLIENT_URL + "/api"
+```
+
+Remove `KANEO_API_URL` from your `.env` unless you need to override it (for example, when a reverse proxy changes the API path).
+
+**Before:**
+```env
+KANEO_CLIENT_URL=https://kaneo.example.com
+KANEO_API_URL=https://kaneo.example.com/api
+```
+
+**After:**
+```env
+KANEO_CLIENT_URL=https://kaneo.example.com
+# KANEO_API_URL is set automatically to https://kaneo.example.com/api
+```
+
+### DATABASE_URL is now optional
+
+`DATABASE_URL` is derived from `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` if you leave it unset:
+
+```
+postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
+```
+
+If you were setting `DATABASE_URL` explicitly with the same values, you can remove it. Keep it if you use an external database or a non-default hostname.
+
+**Before:**
+```env
+POSTGRES_DB=kaneo
+POSTGRES_USER=kaneo
+POSTGRES_PASSWORD=changeme
+DATABASE_URL=postgresql://kaneo:changeme@postgres:5432/kaneo
+```
+
+**After:**
+```env
+POSTGRES_DB=kaneo
+POSTGRES_USER=kaneo
+POSTGRES_PASSWORD=changeme
+# DATABASE_URL is derived automatically
+```
+
+### AUTH_SECRET fallback behavior
+
+If `AUTH_SECRET` is not set, the container generates a random 64-character hex secret at startup and prints a warning to stderr. This means sessions will not survive container restarts.
+
+Set a stable secret to avoid losing active sessions on restart:
+
+```bash
+openssl rand -hex 32
+```
+
+```env
+AUTH_SECRET=your_generated_secret_here
+```
+
+---
+
+## Helm chart (0.2.0 → 0.3.0)
+
+Chart version 0.3.0 is a breaking change. All `api.*` and `web.*` value keys have moved under `kaneo.*`.
+
+### Changed value keys
+
+| Old key | New key |
+|---|---|
+| `api.image.repository` | `kaneo.image.repository` |
+| `api.image.tag` | `kaneo.image.tag` |
+| `api.image.pullPolicy` | `kaneo.image.pullPolicy` |
+| `api.service.type` | `kaneo.service.type` |
+| `api.service.port` | `kaneo.service.port` |
+| `api.resources` | `kaneo.resources` |
+| `api.env.clientUrl` | `kaneo.env.clientUrl` |
+| `api.env.authSecret` | `kaneo.env.authSecret` |
+| `api.env.existingSecret` | `kaneo.env.existingSecret` |
+| `api.env.disableRegistration` | `kaneo.env.disableRegistration` |
+| `api.env.disablePasswordRegistration` | `kaneo.env.disablePasswordRegistration` |
+| `api.env.database` | `kaneo.env.database` |
+| `api.livenessProbe` | `kaneo.livenessProbe` |
+| `api.readinessProbe` | `kaneo.readinessProbe` |
+| `web.*` | removed — web is bundled in the kaneo image |
+
+### Example values migration
+
+**Before (`values.yaml`):**
+```yaml
+api:
+ image:
+ repository: ghcr.io/usekaneo/api
+ tag: "2.5.0"
+ service:
+ type: ClusterIP
+ port: 1337
+ env:
+ clientUrl: "https://kaneo.example.com"
+ authSecret: "your-secret-here"
+
+web:
+ image:
+ repository: ghcr.io/usekaneo/web
+ tag: "2.5.0"
+ service:
+ type: ClusterIP
+ port: 5173
+```
+
+**After (`values.yaml`):**
+```yaml
+kaneo:
+ image:
+ repository: ghcr.io/usekaneo/kaneo
+ tag: "2.6.0"
+ service:
+ type: ClusterIP
+ port: 5173
+ env:
+ clientUrl: "https://kaneo.example.com"
+ authSecret: "your-secret-here"
+```
+
+### Upgrade command
+
+```bash
+helm upgrade kaneo kaneo/kaneo \
+ --version 0.3.0 \
+ --values your-values.yaml \
+ --namespace kaneo
+```
+
+If you store values in a file, update the keys before running the upgrade. Helm will reject unknown keys and the deployment will fail if `api.*` or `web.*` keys remain.
+
+---
+
+## Minimum working configuration
+
+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
+```
+
+`POSTGRES_DB` and `POSTGRES_USER` default to `kaneo` if not set. `KANEO_API_URL` and `DATABASE_URL` are derived automatically.
diff --git a/compose.yml b/compose.yml
index ac2ee0b7a..640874599 100644
--- a/compose.yml
+++ b/compose.yml
@@ -24,6 +24,12 @@ 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
+ start_period: 60s
+ retries: 3
volumes:
postgres_data:
diff --git a/deploy/kaneo-entrypoint.sh b/deploy/kaneo-entrypoint.sh
index c2b164f8b..b39f65b49 100644
--- a/deploy/kaneo-entrypoint.sh
+++ b/deploy/kaneo-entrypoint.sh
@@ -9,11 +9,13 @@ fi
# Derive DATABASE_URL from individual postgres vars if not explicitly set
if [ -z "${DATABASE_URL:-}" ]; then
- if [ -n "${POSTGRES_USER:-}" ] && [ -n "${POSTGRES_PASSWORD:-}" ] && [ -n "${POSTGRES_DB:-}" ]; 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}"
echo "DATABASE_URL not set — derived from POSTGRES_* vars"
else
- echo "ERROR: DATABASE_URL is not set and POSTGRES_USER/PASSWORD/DB are incomplete" >&2
+ echo "ERROR: DATABASE_URL is not set and POSTGRES_PASSWORD is not set" >&2
exit 1
fi
fi