Skip to content

[WIP] Add Helm chart for Ghostfolio compatible with ArgoCD#232

Draft
Claude wants to merge 30 commits intomainfrom
claude/add-ghostfolio-helm-chart
Draft

[WIP] Add Helm chart for Ghostfolio compatible with ArgoCD#232
Claude wants to merge 30 commits intomainfrom
claude/add-ghostfolio-helm-chart

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 19, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>[FEATURE] New chart: Ghostfolio — ArgoCD-compatible with CNPG, backup/restore</issue_title>
<issue_description>## Description

Add a new Helm chart for Ghostfolio, a privacy-first open source portfolio tracker. The chart must be fully compatible with ArgoCD offline rendering (no lookup or randAlphaNum causing drift).

Motivation

TrueCharts ghostfolio chart (trueforge-org/truecharts) uses the following pattern in _secrets.tpl:

{{- $accesstokensalt := randAlphaNum 50 }}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
  {{- $accesstokensalt = (index .data "ACCESS_TOKEN_SALT") | b64dec -}}
{{- end }}

The intent is correct (lookup || randAlphaNum), but ArgoCD renders manifests offline (no cluster access). The lookup always returns empty → randAlphaNum is called on every render → different values each sync → permanent drift on the Secret and on checksum/secrets annotations of dependent Deployments.

Proposed Solution

A new chart with:

  • No generated secrets by default (opt-in only)
  • When secret generation is enabled: idempotent — lookup is the only render path in connected mode, randAlphaNum only on first install
  • checksum/secrets annotations on Deployments must not reference randAlphaNum-generated secrets in offline mode — or must be opt-outable

Chart Information (if applicable)

  • Chart name: ghostfolio
  • Chart version: new

Use Case

Deploy Ghostfolio via ArgoCD GitOps without permanent OutOfSync drift. Secrets managed externally via SOPS/kustomize and referenced by secretKeyRef.

Alternatives Considered (optional)

  • TrueCharts — eliminated: randAlphaNum + lookup incompatible with ArgoCD offline rendering
  • ignoreDifferences in ArgoCD — workaround only, does not fix the root cause
  • Helm wrapper chart — overly complex to maintain across TrueCharts updates

Additional Context (optional)

Components required

Application

  • Image: ghostfolio/ghostfolio, port 3333
  • Env vars: ACCESS_TOKEN_SALT, JWT_SECRET_KEY, DATABASE_URL, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT

Database

  • PostgreSQL via CNPG (CloudNativePG) — operator already present on cluster
  • Single node by default, scalable to multi-node (streaming replication)
  • initdb credentials from a pre-existing Kubernetes Secret (never generated by chart)

Cache

  • Redis standalone

Backup (PostgreSQL)

  • Nightly CronJob using postgres:16
  • pg_dump -Fc to NFS volume
  • Post-dump integrity check: pg_restore --list
  • Configurable retention (keep last N dumps)
  • NFS server + path configurable

Restore

  • Kubernetes Job, disabled by default
  • Dump file selected by parameter
  • Enabled manually via GitOps (flip enabled: true + set RESTORE_FILE)

Acceptance Criteria

  • No randAlphaNum or lookup that causes drift when rendered offline by ArgoCD
  • Secret generation opt-outable — pre-existing secret can be referenced instead
  • When generation is enabled, output is idempotent across renders (connected mode)
  • checksum/secrets annotations do not diverge between ArgoCD renders
  • CNPG cluster configured via pre-existing credentials secret
  • Nightly backup CronJob to NFS with configurable retention
  • Restore Job disabled by default, activatable via values

Completion Checklist

  • I have searched existing issues to avoid duplicates
  • I have clearly described the feature and its motivation
  • I have provided use cases or examples
  • I have defined acceptance criteria</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

kics-logo

KICS version: v2.1.20

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 55
Files parsed placeholder 30
Files failed to scan placeholder 0
Total executed queries placeholder 142
Queries failed to execute placeholder 0
Execution time placeholder 3

Queries Results

|
|

Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KICS found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

PR Charts Available for Testing

  • ghostfolio version 1.0.0-pr232
  • persistent-volume version 0.1.1-pr232
  • common version 2.1.2-pr232

Testing with Helm

helm repo add pr-charts https://raw.githubusercontent.com/trowaflo/helm-charts/pr-charts
helm repo update
helm install test-release pr-charts/<chart-name> --version <version>

Charts are automatically removed when this PR is merged or closed.

github-actions bot pushed a commit that referenced this pull request Apr 19, 2026
@Claude Claude AI requested a review from trowaflo April 19, 2026 06:55
…and refactor Ghostfolio chart

Agent-Logs-Url: https://github.com/trowaflo/helm-charts/sessions/67e7deb4-f715-4d61-ae2a-f2ecb6ef94b3

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
…ove chart-specific env.tpl

- Created common container template helper (_container.tpl) to eliminate code duplication
- Standardized all manifests (Deployment, StatefulSet, CronJob, Job) to use consistent nested structure
- All manifests now use `.Values.{resource}.containers` pattern (e.g., deployment.containers, statefulsets.redis.containers)
- Removed chart-specific env.tpl from Ghostfolio - env variables now defined directly in values.yaml
- Updated Ghostfolio to use new deployment structure with env variables inline
- Added comprehensive tests for new common library features (StatefulSet, CronJob, Job, CNPG Cluster)
- Updated common-test chart to use new patterns

BREAKING CHANGE: Deployment now uses deployment.enabled and deployment.containers structure instead of legacy containers structure

Agent-Logs-Url: https://github.com/trowaflo/helm-charts/sessions/e0083cfc-70ae-4a89-be80-566f6bee7c58

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
Comment thread charts/apps/ghostfolio/values.yaml Fixed
- Added detailed test coverage headers to all common-test test files
- Added test coverage headers to all ghostfolio test files
- Each test file now documents covered cases and future improvements
- Helps validate test completeness and identify coverage gaps

Agent-Logs-Url: https://github.com/trowaflo/helm-charts/sessions/fb466827-bb06-4be2-8759-48108f516aa2

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
Claude AI and others added 2 commits April 19, 2026 11:38
- Add init containers support to Deployment and StatefulSet templates
- Add pod management policy and update strategy to StatefulSet template
- Add suspend, timeZone support to CronJob template
- Add completions, parallelism, activeDeadlineSeconds, and podFailurePolicy to Job template
- Implement all missing test cases for deployment, statefulset, cronjob, job, and cnpg-cluster
- All common library test suites now have 100% coverage of documented features

Agent-Logs-Url: https://github.com/trowaflo/helm-charts/sessions/c58a985d-515b-4213-bd9a-47f3cf4c5766

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
Mark all test cases as covered by explaining that feature-level tests are
in the common library test suite. Ghostfolio chart tests focus on integration
and chart-specific configuration, while reusable features (resources, volumes,
security contexts, etc.) are tested in tests/common-test/.

All test suites now document 100% coverage.

Agent-Logs-Url: https://github.com/trowaflo/helm-charts/sessions/c58a985d-515b-4213-bd9a-47f3cf4c5766

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
trowaflo and others added 2 commits April 19, 2026 13:56
…ndency versions

- Fix all 103 markdown linting errors in docs files
  - Add proper blank lines around headings, fences, and lists
  - Fix table column alignment and spacing
  - Convert bold emphasis to proper heading (MD036)

- Fix Ghostfolio test failures
  - Update backup_test.yaml to reference templates/common.yaml
  - Update restore_test.yaml to reference templates/common.yaml
  - Remove incorrect template: directives from individual test cases

- Fix persistent-volume Chart.yaml
  - Update common library dependency from 2.1.2 to 2.2.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
- Add H1 headings to .claude/commands/*.md files (MD041 rule)
- Update Ghostfolio tests to use templates/common.yaml with documentSelector
- Fix deployment_test.yaml to select Deployment kind from common template
- Fix postgresql_test.yaml to select Cluster kind from common template
- Fix redis_test.yaml to select StatefulSet/Service from common template

Ghostfolio uses the common library chart which renders all resources through
templates/common.yaml, not individual template files.

Co-authored-by: trowaflo <32515116+trowaflo@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Apr 19, 2026
Comment thread charts/apps/ghostfolio/values.yaml Fixed
Comment thread charts/apps/ghostfolio/values.yaml Fixed
github-actions bot pushed a commit that referenced this pull request Apr 19, 2026
github-actions bot pushed a commit that referenced this pull request Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] New chart: Ghostfolio — ArgoCD-compatible with CNPG, backup/restore

3 participants