Commit graph

152 commits

Author SHA1 Message Date
CTO Agent
4bc564152e fix: remove duplicate docker socket mount from runner container options
act_runner v4.0.1 automatically propagates the docker socket when
DOCKER_HOST env var is set. Adding the socket via 'container.options'
caused duplicate bind mounts which made Docker fail container creation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 16:28:27 +00:00
CTO Agent
3dbf0758d1 fix: mount Docker socket into job containers via runner container options
Job containers need access to the host Docker socket to run docker
build/push commands. Adding -v /var/run/docker.sock:/var/run/docker.sock
to container options so docker CLI in job containers can reach the
host Docker daemon.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 16:15:04 +00:00
1d525e6f5a apps/forgejo-runner/README.md aktualisiert 2026-07-18 16:12:11 +00:00
CTO Agent
2f006b6359 fix: register runner with external URL so job containers can resolve Forgejo
Docker containers launched by the runner on the host cannot resolve
forgejo.forgejo.svc.cluster.local (k8s cluster DNS is not available
from host Docker containers). Switching to https://forgejo.basicstack.de
for runner registration so GITHUB_SERVER_URL in job context uses the
externally reachable URL, fixing git fetch in actions/checkout.

Also adds detection to force re-registration if a pod starts with the
old internal-URL .runner file still present.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 16:10:57 +00:00
CTO Agent
e86b9fa29c fix: remove user restriction from runner containers to allow apt-get
Remove --user 1000:1000 option to allow workflow containers to run as root.
This is needed for the Docker CLI installation step which requires root
permissions for apt-get commands.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 15:56:38 +00:00
CTO Agent
46fa658a4e fix: use host network for runner containers to access cluster DNS
Change runner container network from bridge to host to allow workflow
containers to resolve Kubernetes service DNS names. With bridge network,
containers couldn't resolve forgejo.forgejo.svc.cluster.local.

Using host network gives containers access to the cluster's DNS resolver.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 15:52:20 +00:00
CTO Agent
65a293999f fix: add DNS resolution for Forgejo service in runner containers
Add --add-host mapping for forgejo.forgejo.svc.cluster.local to the
Forgejo service ClusterIP (10.102.251.20) in the runner container options.

This fixes the DNS resolution issue where workflow containers created by
the runner (via Docker-in-Docker) cannot resolve Kubernetes service DNS
names, causing the actions/checkout step to fail with "Could not resolve
host: forgejo.forgejo.svc.cluster.local".

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 15:49:28 +00:00
CTO Agent
0c66aa5eb6 fix: add security context to Forgejo runner for Docker socket access
Run the forgejo-runner container as root (uid 0) to allow access to the
Docker socket. This is required for Docker-in-Docker functionality needed
by Forgejo Actions workflows.

Without this, the runner fails with "permission denied" when trying to
access /var/run/docker.sock.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 15:46:54 +00:00
CTO Agent
64ce55d21f feat: add Forgejo runner registration token secret
Create sealed secret for forgejo-runner-token to enable Forgejo Actions
runner deployment. This token allows the runner to register with the
Forgejo instance and execute CI/CD workflows.

Fixes basicstack.org workflow failures (DEV-335) caused by missing runner.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 15:45:33 +00:00
CTO Agent
2ad8fc67b8 Add Forgejo Actions runner deployment configuration
Create runner deployment with:
- ServiceAccount and RBAC for runner pod
- ConfigMap for runner configuration
- Deployment using code.forgejo.org/forgejo/runner:4.0.1
- Argo CD application for automated deployment

Note: Runner requires a sealed secret with registration token.
See apps/forgejo-runner/README.md for setup instructions.

Part of DEV-334 CI/CD workflow implementation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 14:21:57 +00:00
CTO Agent
3fa9f6e6f5 Enable Forgejo Actions support
Add FORGEJO__actions__ENABLED and DEFAULT_ACTIONS_URL environment
variables to enable Actions/CI workflows in Forgejo.

This is required for DEV-334 CI/CD workflow implementation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 14:20:48 +00:00
CTO Agent
60dc1ac0a0 Refactor Harbor deployment to follow project structure pattern
Move Helm chart configuration from inline values in app-harbor.yaml to
separate files in apps/harbor/ subdirectory, following the same pattern
as forgejo and other apps.

Changes:
- Create apps/harbor/Chart.yaml defining dependency on Harbor Helm chart
- Create apps/harbor/values.yaml with all Helm values configuration
- Update app-harbor.yaml to use git path source instead of direct Helm chart
- Add apps/harbor/README.md documenting OIDC setup procedure

OIDC authentication must be configured via Harbor UI after deployment,
as the Helm chart does not support OIDC configuration at deployment time.
The README provides step-by-step instructions for Pocket ID integration.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 14:02:31 +00:00
CTO Agent
daa8112e27 Add Harbor container registry deployment
- Created Argo CD Application for Harbor (app-harbor.yaml)
- Configured Harbor Helm chart with:
  - Ingress at harbor.basicstack.de with TLS via cert-manager
  - PVCs using hcloud-volumes-encrypted storage class
  - OIDC authentication via Pocket ID
  - Resource limits for all components
- Created sealed secret with Harbor admin password, database password, and OIDC client secret
- Configured DNS A record for harbor.basicstack.de -> 178.105.17.239
- Created Pocket ID OIDC client for Harbor with callback URL

Harbor will be available at https://harbor.basicstack.de after Argo CD sync.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 13:36:03 +00:00
a980fd9bfe apps/pocket-id/README.md aktualisiert 2026-07-18 13:12:34 +00:00
ae1cfb0e37 apps/pocket-id/deployment.yaml aktualisiert 2026-07-18 13:12:21 +00:00
70db0ccfd3 apps/headlamp/deployment.yaml aktualisiert 2026-07-18 08:45:24 +00:00
9e1988aba3 apps/headlamp/deployment.yaml aktualisiert 2026-07-18 08:44:20 +00:00
cee563f555 apps/headlamp/deployment.yaml aktualisiert 2026-07-18 08:41:53 +00:00
CTO Agent
c6993d337c Fix Headlamp OIDC callback URL generation
Set HEADLAMP_CONFIG_BASE_URL to https://headlamp.basicstack.de to ensure
the OIDC callback URL is generated correctly with HTTPS scheme. When
running behind Traefik without explicit base URL, Headlamp may generate
http:// callback URLs instead of https://, causing OIDC flow failures.

Also added traefik.ingress.kubernetes.io/preserve-host annotation to
ensure proper header forwarding.

Fixes: DEV-324

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 08:39:12 +00:00
CTO Agent
519e7e95e7 Revert BASE_URL to empty - Headlamp expects path not full URL
Headlamp's BASE_URL config expects a path prefix (e.g., "/headlamp") or empty
string, not a full URL. Since Headlamp is deployed at the domain root, BASE_URL
should be empty.

The OIDC redirect URIs in Pocket ID are correctly configured and the user has
been added to the headlamp group, which should resolve the authentication issue.

Related to DEV-324

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 08:33:33 +00:00
CTO Agent
442aca2254 Fix Headlamp OIDC login by setting BASE_URL and correcting env var names
- Set HEADLAMP_CONFIG_BASE_URL to https://headlamp.basicstack.de (was empty)
- Fix environment variable names to use underscores (OIDC_IDP_ISSUER_URL, etc.)
- Update image version to v0.43.0 to match deployed version

The missing BASE_URL caused the OIDC redirect flow to fail, resulting in the
auth popup closing immediately. Environment variable name corrections ensure
consistency with Headlamp's expected configuration format.

Resolves DEV-324

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 08:30:41 +00:00
f40b3c7362 apps/headlamp/deployment.yaml aktualisiert 2026-07-18 08:13:46 +00:00
00468d6d70 apps/headlamp/deployment.yaml aktualisiert 2026-07-18 08:11:26 +00:00
CTO Agent
38ddae08a9 docs(headlamp): document authentication methods and troubleshooting
Add clear documentation for both OIDC and token-based authentication.
Include troubleshooting section for common 403 errors caused by
using tokens from wrong namespace.

Fixes issue where token was generated from kube-system instead of
headlamp namespace, causing 403 errors on metrics API.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 08:00:11 +00:00
CTO Agent
0bc48c2f7c Enable automated sync for Headlamp ArgoCD application
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 07:38:58 +00:00
CTO Agent
e640db0880 Add Headlamp Kubernetes dashboard deployment
- Deploy Headlamp v0.27.0 in dedicated namespace
- Configure OIDC authentication with Pocket ID
- Grant cluster-admin access via service account
- Expose via Traefik ingress at headlamp.basicstack.de
- Seal OIDC client credentials
- Enable access for andreas.leinen@basicstack.de and admin@basicstack.de

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-18 07:37:58 +00:00
CTO Agent
0e12e443b7 Update Stalwart stability check window
Start new 7-day verification window: 2026-07-13 21:07 UTC → 2026-07-20 21:07 UTC
- CEO confirmed Web-UI SMTP and IMAP working
- Restarting verification per Option A (clean 7-day window)
- Baseline status: all services verified working

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 21:08:11 +00:00
CTO Agent
3cc450d08e docs(stalwart): Update stability check status with investigation results
- Verified all infrastructure working correctly (SMTP/IMAP/LoadBalancer)
- Identified user SMTP issue as client configuration (port 143 vs 587)
- Documented proposed verification window restart (2026-07-13 to 2026-07-20)
- Original window had 2+ days with broken LoadBalancer (10.42.1.1 vs 178.105.17.239)

Related: DEV-300

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 20:36:22 +00:00
CTO Agent
6541502682 docs(stalwart): Clarify LoadBalancer was working all along via hostPort
Investigation revealed that k3s ServiceLB uses hostPort bindings on nodes'
public IPs, not the misleading EXTERNAL-IP VIP (10.42.1.1) shown in kubectl.

External connectivity was working correctly the entire time. The confusion
was caused by misinterpreting the flannel pod network IP in the EXTERNAL-IP
field as meaning external traffic couldn't reach the service.

Verified all SMTP/IMAP ports responding correctly with proper Stalwart banners.

Related: DEV-235

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 20:12:11 +00:00
CTO Agent
ae3f164987 fix(stalwart): Add externalTrafficPolicy: Local to LoadBalancer services
Root cause: ArgoCD continuously reverts the LoadBalancer services to use
externalTrafficPolicy: Cluster (the k8s default), causing k3s to assign
internal flannel VXLAN IPs (10.42.1.x) instead of the node public IPs.

With externalTrafficPolicy: Cluster, traffic can be routed to any node,
and k3s's service controller assigns the flannel overlay IPs. This breaks
external connectivity because those IPs are not routable from outside.

With externalTrafficPolicy: Local, traffic is only routed to pods on the
same node, and k3s assigns the node's actual public IP to the LoadBalancer.

This was the missing piece from the reliability hardening in commit b0f2acf.
Without this in git, any manual kubectl patch is reverted by ArgoCD sync.

Evidence: stalwart-smtp and stalwart-imap both showing LoadBalancer IPs:
10.42.1.1, 10.42.1.2, 10.42.1.3, 10.42.1.5 (internal flannel IPs)

Related: DEV-230, DEV-231, DEV-233, DEV-235

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 20:03:49 +00:00
CTO Agent
c755bc1a45 Document SMTP/IMAP external access issue and solution options
Root cause: k3s ServiceLB assigns internal VIPs (10.42.1.x) that are not
publicly routable. External traffic to mail.basicstack.de cannot reach the
SMTP/IMAP services.

Investigation shows:
- Web-UI works (goes through Traefik IngressRoute)
- SMTP/IMAP ports have correct firewall rules
- iptables DNAT rules exist but don't help external traffic
- Internal connectivity works correctly
- LoadBalancer 'external IPs' are actually pod network IPs

Three solution options documented:
A. NodePort + iptables REDIRECT (recommended)
B. Deploy MetalLB for true LoadBalancer IPs
C. Hetzner Cloud LoadBalancers (not recommended, cost)

Awaiting approval on approach before implementing fix.

Related: DEV-235

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 20:00:19 +00:00
CTO Agent
c84411d99f Add comprehensive Stalwart stability check procedure
This document establishes operational rules and diagnostic playbooks for
Stalwart stability monitoring and incident response.

Key sections:
- Critical operational rules (repository as single point of truth)
- Requirement to read git history before any investigation
- Current 7-day stability check procedures (DEV-235)
- Known issues and their fixes (k3s networking, commit b0f2acf)
- Diagnostic playbook for SMTP/IMAP/Web-UI issues
- Issue documentation template
- Evidence requirements for verification completion

This ensures all future investigations follow documented procedures and
avoid repeated debugging cycles.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-13 19:56:35 +00:00
CTO Agent
c429df27ea Enable auto-sync for bookstack application
Configure Argo CD to automatically sync bookstack from the repository,
ensuring the repository remains the single source of truth.

Changes:
- Added automated sync policy with prune and selfHeal
- prune: removes resources no longer in repo
- selfHeal: reverts manual cluster changes back to repo state

This resolves the manual sync requirement and ensures continuous
synchronization without data loss.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 17:17:53 +00:00
CTO Agent
36b794a94e Document mysql-data-encrypted PVC as pre-existing, unmanaged resource
The mysql-data-encrypted PVC exists in the cluster and is working correctly,
but attempting to manage it through Argo CD causes sync failures because the
PVC is already bound and its spec is immutable. Leaving it unmanaged while
documenting its existence.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 17:13:26 +00:00
CTO Agent
0e5566d3b9 Add missing mysql-data-encrypted PVC definition to bookstack manifests
The MySQL deployment was referencing a PVC that wasn't defined in the
manifests. This PVC exists in the cluster but wasn't tracked by Argo CD.
Adding the definition ensures Argo CD can properly manage all resources
and prevents sync issues.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 17:11:14 +00:00
CTO Agent
c32e04c840 Add managed label to argocd sealed secrets
Adds the sealedsecrets.bitnami.com/managed: "true" label to all three
argocd sealed secrets (argocd-oidc-secret, repo-basicstack-org,
repo-stack-basicstack-de) to fix Health Degraded status in Argo CD.

This follows the same fix pattern applied in DEV-291, DEV-290, and DEV-289.

Closes DEV-293

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 16:32:34 +00:00
fa581374b2 apps/opencloud/openldap-deployment.yaml aktualisiert 2026-07-12 16:02:10 +00:00
ea7b1d64a4 apps/pocket-id/deployment.yaml aktualisiert
Update to version v2.10.0
2026-07-12 14:53:18 +00:00
CTO Agent
3149867b9b Add IgnoreExtraneous annotation to Pocket ID sealed secret template
This tells Argo CD to ignore the unsealed secret created by the sealed-secrets controller, preventing the health status from being degraded.

This is the same fix applied in DEV-289 and DEV-290 for Forgejo and Argo.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 14:49:32 +00:00
CTO Agent
2cdbd04848 Add Pocket ID migration verification and rollout guide
Documents the complete migration process, safety measures, and verification steps
for the Pocket ID Argo CD migration.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 14:36:50 +00:00
CTO Agent
794cf51d0c Add Pocket ID deployment manifests for Argo CD GitOps
Migrated Pocket ID deployment from manual kubectl to GitOps. All existing resources
will be adopted by Argo CD without recreation, preserving data and configuration.

Key safety measures:
- PVC has Delete=false annotation to prevent data loss
- Existing sealed secret reused for ENCRYPTION_KEY
- TLS certificate managed by cert-manager (not in Git)
- All OIDC clients and user data preserved in existing PVC

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 14:35:28 +00:00
66905ba424 apps/forgejo/forgejo-postgres-secret-sealed.yaml aktualisiert 2026-07-12 14:10:45 +00:00
CTO Agent
b0fce8e16b Add managed annotation to forgejo-postgres-secret SealedSecret
Adds sealedsecrets.bitnami.com/managed annotation to ensure proper
lifecycle management by the sealed-secrets controller. This is a
non-destructive fix that improves secret synchronization without
touching encrypted data or affecting access.

Related: DEV-290, DEV-289

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 14:03:31 +00:00
CTO Agent
08030791c1 Add Forgejo deployment manifests for Argo CD GitOps
Migrate all Forgejo deployment resources from cluster to Git repository:
- Forgejo Deployment with PostgreSQL backend
- Forgejo Service and Ingress with TLS
- Forgejo PersistentVolumeClaim (5Gi)
- PostgreSQL StatefulSet and Service
- Backup CronJob (daily at 03:00 UTC, 14-day retention)

All existing PVCs (forgejo-data, postgres-data-forgejo-postgres-0) and
Pocket-ID SSO configuration are preserved. No data loss expected.

The Argo CD Application (app-forgejo.yaml) is already configured to
sync from apps/forgejo/ path in this repository.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 13:55:47 +00:00
CTO Agent
2ae7e30041 Add managed label to mysql sealed secret
This adds the sealedsecrets.bitnami.com/managed: "true" label to the
mysql sealed secret to fix Health Degraded status in Argo CD.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 12:16:48 +00:00
CTO Agent
0523d6e0c6 Fix Bookstack OIDC client ID to match Pocket ID configuration
The deployment was using client ID "bookstack" which does not exist in
Pocket ID. Updated to use the actual client ID from Pocket ID.

This fixes the "Record not found" error when attempting to login via
Pocket ID.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 11:51:18 +00:00
CTO Agent
2e8bb89261 Update Bookstack OIDC configuration and fix Ingress hostname
- Fix Ingress rule host from bookstack.basicstack.de to books.basicstack.de
- Update OIDC issuer from pocket-id.basicstack.de to auth.basicstack.de
- Enable AUTH_AUTO_INITIATE for seamless SSO
- Update OIDC_NAME from "Pocket-ID" to "Pocket ID"

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 11:42:22 +00:00
CTO Agent
a882636043 Fix Bookstack hostname from bookstack.basicstack.de to books.basicstack.de
Updated APP_URL environment variable and Ingress configuration to use the correct hostname books.basicstack.de.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 11:40:46 +00:00
CTO Agent
bfbd791103 Fix bookstack deployment to use existing resources
- Change MySQL from StatefulSet to Deployment to match existing setup
- Use existing PVC mysql-data-encrypted (contains live data) instead of creating new mysql-data
- Add PersistentVolumeClaim for bookstack-config to persist APP_KEY and configuration
- Remove duplicate MySQL resource definitions
- Align with current working deployment while making Forgejo the source of truth

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 11:24:21 +00:00
CTO Agent
62c4398787 Add complete Bookstack deployment manifests
Added comprehensive Kubernetes deployment for Bookstack including:
- MySQL StatefulSet with PersistentVolumeClaim (10Gi encrypted storage)
- MySQL Service (ClusterIP)
- Bookstack Deployment with OIDC/Pocket-ID integration
- Bookstack Service (ClusterIP)
- Ingress with TLS certificate (bookstack.basicstack.de)

The deployment uses existing sealed secrets for MySQL credentials and
Bookstack OIDC client secret. Bookstack is configured with proper
health checks and resource limits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-07-12 11:14:33 +00:00