From 2a334c56ace6896962b2909ec107f788ecee304d Mon Sep 17 00:00:00 2001 From: OpenCode Test Date: Wed, 24 Dec 2025 11:03:53 -0800 Subject: [PATCH] Rename tline to porthole --- README.md | 28 +++++++++---------- ...ication.yaml => porthole-application.yaml} | 2 +- helm/{tline => porthole}/Chart.yaml | 2 +- .../templates/_helpers.tpl | 5 +++- .../templates/configmap.yaml.tpl | 0 .../cronjob-cleanup-staging.yaml.tpl | 0 .../templates/ingress-tailscale.yaml.tpl | 0 .../templates/job-ensure-bucket.yaml.tpl | 0 .../templates/job-migrate.yaml.tpl | 0 .../templates/minio.yaml.tpl | 0 .../templates/postgres.yaml.tpl | 0 .../templates/redis.yaml.tpl | 0 .../templates/secret.yaml.tpl | 14 ++++++++-- .../service-minio-tailscale-console.yaml.tpl | 0 .../service-minio-tailscale-s3.yaml.tpl | 0 .../templates/web.yaml.tpl | 0 .../templates/worker.yaml.tpl | 0 helm/{tline => porthole}/values.yaml | 16 ++++++----- package.json | 2 +- packages/queue/src/index.ts | 2 +- 20 files changed, 42 insertions(+), 29 deletions(-) rename argocd/{tline-application.yaml => porthole-application.yaml} (95%) rename helm/{tline => porthole}/Chart.yaml (88%) rename helm/{tline => porthole}/templates/_helpers.tpl (93%) rename helm/{tline => porthole}/templates/configmap.yaml.tpl (100%) rename helm/{tline => porthole}/templates/cronjob-cleanup-staging.yaml.tpl (100%) rename helm/{tline => porthole}/templates/ingress-tailscale.yaml.tpl (100%) rename helm/{tline => porthole}/templates/job-ensure-bucket.yaml.tpl (100%) rename helm/{tline => porthole}/templates/job-migrate.yaml.tpl (100%) rename helm/{tline => porthole}/templates/minio.yaml.tpl (100%) rename helm/{tline => porthole}/templates/postgres.yaml.tpl (100%) rename helm/{tline => porthole}/templates/redis.yaml.tpl (100%) rename helm/{tline => porthole}/templates/secret.yaml.tpl (53%) rename helm/{tline => porthole}/templates/service-minio-tailscale-console.yaml.tpl (100%) rename helm/{tline => porthole}/templates/service-minio-tailscale-s3.yaml.tpl (100%) rename helm/{tline => porthole}/templates/web.yaml.tpl (100%) rename helm/{tline => porthole}/templates/worker.yaml.tpl (100%) rename helm/{tline => porthole}/values.yaml (93%) diff --git a/README.md b/README.md index 042ae1d..60d5099 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ Porthole: timeline media library (Next.js web + worker), backed by Postgres/Redi - set `images.web.repository/tag` and `images.worker.repository/tag` - set `global.tailscale.tailnetFQDN` (recommended), or set `app.minio.publicEndpointTs` (must be `https://minio.`) -- Render locally: `helm template porthole helm/tline -f your-values.yaml --namespace porthole` +- Render locally: `helm template porthole helm/porthole -f your-values.yaml --namespace porthole` -- Install (to `porthole` namespace): `helm upgrade --install porthole helm/tline -f your-values.yaml --namespace porthole` +- Install (to `porthole` namespace): `helm upgrade --install porthole helm/porthole -f your-values.yaml --namespace porthole` ## ArgoCD -A ready-to-apply ArgoCD `Application` manifest is included at `argocd/tline-application.yaml` (it deploys the Helm release name `porthole`). +A ready-to-apply ArgoCD `Application` manifest is included at `argocd/porthole-application.yaml` (it deploys the Helm release name `porthole`). Reference example (deploys into the `porthole` namespace; the Helm chart itself does not hardcode a namespace): @@ -31,7 +31,7 @@ spec: source: repoURL: git@gitea-gitea-ssh.taildb3494.ts.net:will/porthole.git targetRevision: main - path: helm/tline + path: helm/porthole helm: releaseName: porthole valueFiles: @@ -41,8 +41,8 @@ spec: # parameters: # - name: global.tailscale.tailnetFQDN # value: tailxyz.ts.net - # - name: images.web.repository - # value: registry.lan:5000/tline-web + # - name: images.web.repository + # value: registry.lan:5000/porthole-web # - name: images.web.tag # value: dev destination: @@ -89,25 +89,25 @@ This repo is a Bun monorepo, but container builds use Docker Buildx. - Your Docker daemon is configured to allow that registry as an insecure registry. - Create/use a buildx builder (one-time): - - `docker buildx create --name tline --use` + - `docker buildx create --name porthole --use` - Build + push **web** (Next standalone): - `REGISTRY=registry.lan:5000 TAG=dev` - - `docker buildx build --platform linux/amd64,linux/arm64 -f apps/web/Dockerfile -t "$REGISTRY/tline-web:$TAG" --push .` + - `docker buildx build --platform linux/amd64,linux/arm64 -f apps/web/Dockerfile -t "$REGISTRY/porthole-web:$TAG" --push .` - Notes: - The Dockerfile uses `bun install --frozen-lockfile` and copies all workspace `package.json` files first to keep Bun from mutating `bun.lock`. - Runtime entrypoint comes from Next standalone output (the image runs `node app/apps/web/server.js`). - Build + push **worker** (includes `ffmpeg` + `exiftool`): - `REGISTRY=registry.lan:5000 TAG=dev` - - `docker buildx build --platform linux/amd64,linux/arm64 -f apps/worker/Dockerfile -t "$REGISTRY/tline-worker:$TAG" --push .` + - `docker buildx build --platform linux/amd64,linux/arm64 -f apps/worker/Dockerfile -t "$REGISTRY/porthole-worker:$TAG" --push .` - Notes: - The Dockerfile uses `bun install --frozen-lockfile --production` and also copies all workspace `package.json` files first for stable `workspace:*` resolution. - Then set Helm values: - - `images.web.repository: registry.lan:5000/tline-web` + - `images.web.repository: registry.lan:5000/porthole-web` - `images.web.tag: dev` - - `images.worker.repository: registry.lan:5000/tline-worker` + - `images.worker.repository: registry.lan:5000/porthole-worker` - `images.worker.tag: dev` ### Private registry auth (optional) @@ -167,7 +167,7 @@ This chart assumes you label nodes like: - Pi 5 nodes: `node-class=compute` - Pi 3 node: `node-class=tiny` -The default scheduling in `helm/tline/values.yaml` pins heavy pods to `node-class=compute`. +The default scheduling in `helm/porthole/values.yaml` pins heavy pods to `node-class=compute`. Example `values.yaml` you can start from: @@ -181,10 +181,10 @@ secrets: images: web: - repository: registry.lan:5000/tline-web + repository: registry.lan:5000/porthole-web tag: dev worker: - repository: registry.lan:5000/tline-worker + repository: registry.lan:5000/porthole-worker tag: dev global: diff --git a/argocd/tline-application.yaml b/argocd/porthole-application.yaml similarity index 95% rename from argocd/tline-application.yaml rename to argocd/porthole-application.yaml index 44b72e6..79d025f 100644 --- a/argocd/tline-application.yaml +++ b/argocd/porthole-application.yaml @@ -8,7 +8,7 @@ spec: source: repoURL: git@gitea-ssh.gitea.svc:will/porthole.git targetRevision: main - path: helm/tline + path: helm/porthole helm: releaseName: porthole valueFiles: diff --git a/helm/tline/Chart.yaml b/helm/porthole/Chart.yaml similarity index 88% rename from helm/tline/Chart.yaml rename to helm/porthole/Chart.yaml index 3087738..45bd7f1 100644 --- a/helm/tline/Chart.yaml +++ b/helm/porthole/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: tline +name: porthole description: Timeline media library (porthole) type: application version: 0.1.0 diff --git a/helm/tline/templates/_helpers.tpl b/helm/porthole/templates/_helpers.tpl similarity index 93% rename from helm/tline/templates/_helpers.tpl rename to helm/porthole/templates/_helpers.tpl index 3590ebc..9dc91e4 100644 --- a/helm/tline/templates/_helpers.tpl +++ b/helm/porthole/templates/_helpers.tpl @@ -105,8 +105,11 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- $label = .Values.minio.tailscaleServiceS3.hostnameLabel -}} {{- end -}} {{- printf "https://%s.%s" $label .Values.global.tailscale.tailnetFQDN -}} +{{- else if .Values.minio.enabled -}} +{{- $svc := include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "minio") -}} +{{- printf "http://%s:%d" $svc (.Values.minio.service.s3Port | int) -}} {{- else -}} -{{- fail "app.minio.publicEndpointTs is required (or set global.tailscale.tailnetFQDN to derive it)" -}} +{{- fail "app.minio.publicEndpointTs is required when minio.enabled=false and no tailscale tailnetFQDN is set" -}} {{- end -}} {{- end -}} diff --git a/helm/tline/templates/configmap.yaml.tpl b/helm/porthole/templates/configmap.yaml.tpl similarity index 100% rename from helm/tline/templates/configmap.yaml.tpl rename to helm/porthole/templates/configmap.yaml.tpl diff --git a/helm/tline/templates/cronjob-cleanup-staging.yaml.tpl b/helm/porthole/templates/cronjob-cleanup-staging.yaml.tpl similarity index 100% rename from helm/tline/templates/cronjob-cleanup-staging.yaml.tpl rename to helm/porthole/templates/cronjob-cleanup-staging.yaml.tpl diff --git a/helm/tline/templates/ingress-tailscale.yaml.tpl b/helm/porthole/templates/ingress-tailscale.yaml.tpl similarity index 100% rename from helm/tline/templates/ingress-tailscale.yaml.tpl rename to helm/porthole/templates/ingress-tailscale.yaml.tpl diff --git a/helm/tline/templates/job-ensure-bucket.yaml.tpl b/helm/porthole/templates/job-ensure-bucket.yaml.tpl similarity index 100% rename from helm/tline/templates/job-ensure-bucket.yaml.tpl rename to helm/porthole/templates/job-ensure-bucket.yaml.tpl diff --git a/helm/tline/templates/job-migrate.yaml.tpl b/helm/porthole/templates/job-migrate.yaml.tpl similarity index 100% rename from helm/tline/templates/job-migrate.yaml.tpl rename to helm/porthole/templates/job-migrate.yaml.tpl diff --git a/helm/tline/templates/minio.yaml.tpl b/helm/porthole/templates/minio.yaml.tpl similarity index 100% rename from helm/tline/templates/minio.yaml.tpl rename to helm/porthole/templates/minio.yaml.tpl diff --git a/helm/tline/templates/postgres.yaml.tpl b/helm/porthole/templates/postgres.yaml.tpl similarity index 100% rename from helm/tline/templates/postgres.yaml.tpl rename to helm/porthole/templates/postgres.yaml.tpl diff --git a/helm/tline/templates/redis.yaml.tpl b/helm/porthole/templates/redis.yaml.tpl similarity index 100% rename from helm/tline/templates/redis.yaml.tpl rename to helm/porthole/templates/redis.yaml.tpl diff --git a/helm/tline/templates/secret.yaml.tpl b/helm/porthole/templates/secret.yaml.tpl similarity index 53% rename from helm/tline/templates/secret.yaml.tpl rename to helm/porthole/templates/secret.yaml.tpl index b406373..6a72555 100644 --- a/helm/tline/templates/secret.yaml.tpl +++ b/helm/porthole/templates/secret.yaml.tpl @@ -1,4 +1,12 @@ {{- if not .Values.secrets.existingSecret -}} +{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "tline.secretName" .) -}} +{{- $existingData := dict -}} +{{- if $existing -}} +{{- $existingData = (get $existing "data") | default dict -}} +{{- end -}} +{{- $pgPassB64 := (get $existingData "POSTGRES_PASSWORD") | default (randAlphaNum 32 | b64enc) -}} +{{- $minioKeyB64 := (get $existingData "MINIO_ACCESS_KEY_ID") | default (randAlphaNum 20 | b64enc) -}} +{{- $minioSecretB64 := (get $existingData "MINIO_SECRET_ACCESS_KEY") | default (randAlphaNum 40 | b64enc) -}} apiVersion: v1 kind: Secret metadata: @@ -7,9 +15,9 @@ metadata: {{ include "tline.labels" . | indent 4 }} type: Opaque data: - POSTGRES_PASSWORD: {{ required "secrets.postgres.password is required" .Values.secrets.postgres.password | b64enc }} - MINIO_ACCESS_KEY_ID: {{ required "secrets.minio.accessKeyId is required" .Values.secrets.minio.accessKeyId | b64enc }} - MINIO_SECRET_ACCESS_KEY: {{ required "secrets.minio.secretAccessKey is required" .Values.secrets.minio.secretAccessKey | b64enc }} + POSTGRES_PASSWORD: {{ .Values.secrets.postgres.password | default ($pgPassB64 | b64dec) | b64enc }} + MINIO_ACCESS_KEY_ID: {{ .Values.secrets.minio.accessKeyId | default ($minioKeyB64 | b64dec) | b64enc }} + MINIO_SECRET_ACCESS_KEY: {{ .Values.secrets.minio.secretAccessKey | default ($minioSecretB64 | b64dec) | b64enc }} {{- end }} {{- if .Values.registrySecret.create -}} diff --git a/helm/tline/templates/service-minio-tailscale-console.yaml.tpl b/helm/porthole/templates/service-minio-tailscale-console.yaml.tpl similarity index 100% rename from helm/tline/templates/service-minio-tailscale-console.yaml.tpl rename to helm/porthole/templates/service-minio-tailscale-console.yaml.tpl diff --git a/helm/tline/templates/service-minio-tailscale-s3.yaml.tpl b/helm/porthole/templates/service-minio-tailscale-s3.yaml.tpl similarity index 100% rename from helm/tline/templates/service-minio-tailscale-s3.yaml.tpl rename to helm/porthole/templates/service-minio-tailscale-s3.yaml.tpl diff --git a/helm/tline/templates/web.yaml.tpl b/helm/porthole/templates/web.yaml.tpl similarity index 100% rename from helm/tline/templates/web.yaml.tpl rename to helm/porthole/templates/web.yaml.tpl diff --git a/helm/tline/templates/worker.yaml.tpl b/helm/porthole/templates/worker.yaml.tpl similarity index 100% rename from helm/tline/templates/worker.yaml.tpl rename to helm/porthole/templates/worker.yaml.tpl diff --git a/helm/tline/values.yaml b/helm/porthole/values.yaml similarity index 93% rename from helm/tline/values.yaml rename to helm/porthole/values.yaml index 2431a73..57126b0 100644 --- a/helm/tline/values.yaml +++ b/helm/porthole/values.yaml @@ -28,7 +28,7 @@ scheduling: app: name: porthole - queueName: tline + queueName: porthole # Optional overrides when bringing your own services. databaseUrl: "" # defaults to in-chart Postgres when empty @@ -45,9 +45,9 @@ secrets: existingSecret: "" # if set, chart will not create secrets postgres: - user: tline + user: porthole password: "" # REQUIRED if not using existingSecret - database: tline + database: porthole minio: accessKeyId: "" # REQUIRED if not using existingSecret @@ -55,12 +55,14 @@ secrets: images: web: - repository: "" - tag: "" + # Default is a local/in-cluster registry example; override for your environment. + repository: registry.lan:5000/porthole-web + tag: dev pullPolicy: IfNotPresent worker: - repository: "" - tag: "" + # Default is a local/in-cluster registry example; override for your environment. + repository: registry.lan:5000/porthole-worker + tag: dev pullPolicy: IfNotPresent postgres: repository: postgres diff --git a/package.json b/package.json index e4b096e..b4d6506 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tline", + "name": "porthole", "private": true, "version": "0.0.0", "description": "Timeline media library (porthole)", diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index c05ffde..f969488 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -5,7 +5,7 @@ import IORedis from "ioredis"; const envSchema = z.object({ REDIS_URL: z.string().min(1).default("redis://localhost:6379"), - QUEUE_NAME: z.string().min(1).default("tline") + QUEUE_NAME: z.string().min(1).default("porthole") }); export const jobNameSchema = z.enum([