GitOps repository for personal infrastructure management
  • Nix 32.5%
  • Jinja 21.5%
  • Python 17.9%
  • Shell 11.8%
  • Go 8.1%
  • Other 8.2%
Find a file
Erich Blume 0cdc143227 Deploy Dex OIDC identity provider with Grafana SSO (#222)
## Summary
- Deploys Dex OIDC identity provider on ringtail k3s cluster as central authentication service
- Integrates Grafana as first SSO client via `auth.generic_oauth`
- Uses Kubernetes CRD storage backend (no PVC needed)
- All secrets (bcrypt hash, client secrets) injected via ExternalSecrets from 1Password item "Dex (blumeops)"
- NixOS-built container image via `containers/dex/default.nix`

## Pre-requisites (manual, before deployment)
1. Create 1Password item "Dex (blumeops)" in `blumeops` vault with fields:
   - `password`: strong generated password for Dex login
   - `static-password-hash`: bcrypt hash of above (`htpasswd -BnC 10 eblume`, copy hash after `eblume:`)
   - `grafana-client-secret`: random 32-char hex (`openssl rand -hex 16`)
2. Build container: `mise run container-tag-and-release dex v1.0.0`

## Deployment sequence
1. Build container: `mise run container-tag-and-release dex v1.0.0`
2. Deploy Caddy: `mise run provision-indri -- --tags caddy`
3. Sync ArgoCD: `argocd app sync apps` → `argocd app sync dex`
4. Verify Dex: `curl https://dex.ops.eblu.me/.well-known/openid-configuration`
5. Sync Grafana: `argocd app sync grafana-config` → `argocd app sync grafana`
6. Test SSO: Visit `https://grafana.ops.eblu.me/login`, click "Sign in with Dex"

## Verification
- [ ] Container image exists: `mise run container-list` shows `dex:v1.0.0-nix`
- [ ] `curl https://dex.ops.eblu.me/.well-known/openid-configuration` returns valid OIDC discovery
- [ ] `curl https://dex.ops.eblu.me/healthz` returns healthy
- [ ] Grafana login shows "Sign in with Dex" button alongside local login
- [ ] OIDC flow: click Dex → enter credentials → redirect back → logged in as Admin
- [ ] Break-glass: local admin login still works
- [ ] `mise run services-check` passes

## Files changed
| File | Action | Purpose |
|------|--------|---------|
| `containers/dex/default.nix` | Create | NixOS container build |
| `argocd/apps/dex.yaml` | Create | ArgoCD app targeting ringtail |
| `argocd/manifests/dex/*` (8 files) | Create | K8s manifests (RBAC, ExternalSecret, Deployment, Service, Ingress) |
| `argocd/manifests/grafana-config/external-secret-dex-oauth.yaml` | Create | Grafana OIDC client secret |
| `argocd/manifests/grafana-config/kustomization.yaml` | Modify | Add new ExternalSecret resource |
| `argocd/manifests/grafana/values.yaml` | Modify | Add `auth.generic_oauth` config + envFromSecrets |
| `ansible/roles/caddy/defaults/main.yml` | Modify | Add `dex.ops.eblu.me` reverse proxy entry |
| `docs/changelog.d/feature-dex-oidc.feature.md` | Create | Changelog fragment |

Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/222
2026-02-19 20:24:24 -08:00
.claude Add pre-commit hooks for code quality (#19) 2026-01-16 19:33:02 -08:00
.dagger Polish ringtail NixOS config and add documentation (#208) 2026-02-18 17:53:47 -08:00
.forgejo/workflows Nix container build for nettest (#214) 2026-02-19 08:42:58 -08:00
.github Add k3s, 1Password Connect, and systemd nix-container-builder to ringtail (#209) 2026-02-18 21:15:30 -08:00
ansible Deploy Dex OIDC identity provider with Grafana SSO (#222) 2026-02-19 20:24:24 -08:00
argocd Deploy Dex OIDC identity provider with Grafana SSO (#222) 2026-02-19 20:24:24 -08:00
containers Deploy Dex OIDC identity provider with Grafana SSO (#222) 2026-02-19 20:24:24 -08:00
docs Deploy Dex OIDC identity provider with Grafana SSO (#222) 2026-02-19 20:24:24 -08:00
fly Fix cache hit rate on APM and Fly.io dashboards (#177) 2026-02-12 18:40:48 -08:00
mise-tasks Fix services-check and update docs for Frigate migration to ringtail (#218) 2026-02-19 14:38:21 -08:00
nixos/ringtail Port Frigate NVR to ringtail k3s with GPU acceleration (#217) 2026-02-19 14:27:04 -08:00
pulumi Deploy Tailscale operator on ringtail k3s cluster (#215) 2026-02-19 09:33:05 -08:00
.ansible-lint Add pre-commit hooks for code quality (#19) 2026-01-16 19:33:02 -08:00
.gitignore Add pre-commit hooks for code quality (#19) 2026-01-16 19:33:02 -08:00
.pre-commit-config.yaml Adopt Dagger CI for docs build (Phase 2) (#157) 2026-02-11 16:33:16 -08:00
.yamllint.yaml Deploy Tailscale operator on ringtail k3s cluster (#215) 2026-02-19 09:33:05 -08:00
Brewfile Add op-backup mise task for encrypted 1Password disaster recovery (#136) 2026-02-09 20:37:39 -08:00
CHANGELOG.md Update docs release to v1.9.4 2026-02-17 07:30:39 -08:00
CLAUDE.md Fix services-check and update docs for Frigate migration to ringtail (#218) 2026-02-19 14:38:21 -08:00
dagger.json Adopt Dagger CI for container builds (Phase 1) (#156) 2026-02-11 15:38:31 -08:00
LICENSE Adopt Dagger CI for container builds (Phase 1) (#156) 2026-02-11 15:38:31 -08:00
mise.toml Adopt Dagger CI for container builds (Phase 1) (#156) 2026-02-11 15:38:31 -08:00
README.md Add Fly.io public reverse proxy for docs.eblu.me (#120) 2026-02-08 02:36:19 -08:00
service-versions.yaml Replace Homepage Helm chart with kustomize manifests and custom Dockerfile (#221) 2026-02-19 18:29:19 -08:00
towncrier.toml Fix Quartz build to preserve git history for accurate file dates (#105) 2026-02-04 08:25:46 -08:00

blumeops

                    l0K                                k..:k.
                  .:...c.                            ;c....
                    ....'o                          x.....
                      ....k                        x....
                       ... l'                    'c....
                        ....,l                  o'....
                         .....x                k....
                          .....d.             c....
                            ... l            x....
                              .,.d         ;c.c'
                               'c':;      x',c.
                                .:,'o   .x.::.
                                 .;:.k ,:.c'
                                   ,c.c';:.
                                    .,.:;.
                                   ;'.c, l
                                  d',c..:.d.
                                 O.:;.  'c';c
                               ;c.c'     .:;.x
                              o',c.       .;:.k
                             x.::.          'c.l.
                         dOKl.c,             .c,'o
                   0l'...... ..'              .::.ocx.
                 'o ............              o .... :olx;
                x,ox;. ....... .k             ....,dKKo;..x
              'd,OXXXXk:. ...... ;            ;:dXOl;',';l;o;
             x,oXXXXXXXXXkc. ...              .lc,',':dKNNNx;x;
           ;o;0KXXXXXXXXXXXX0l.                .',ckNNNNNNNNNxco0d
          l,d0oOXKOKXXXXKXXXX0.                  kNNNNNNNNNNNNNXxloo::
             .OXxdXKOX0kXXXX0.                   .KNNNNNNNNNNXONX0o.
                ,OdxKldXXXXx.                     ,NNNNNNNNNNNKoc
                   :.OXXkKo                       .kNNNNNNNNXx.
                      ':0c                         .NdNkXkc

Blue Mops — GitOps for Erich Blume's personal computing environment.

What is this?

Infrastructure-as-code for my tailnet (tail8d86e.ts.net). This repo contains ansible playbooks, configuration, and automation for managing my personal infrastructure.

This codebase was heavily co-authored by Claude Code, as an experiment in LLM-assisted development. I want to include a personal note here that I don't know entirely how I feel about LLMs in our current era, but it felt important to learn.

Development

Pre-commit Hooks

This repo uses pre-commit for code quality and consistency. Install hooks with:

uvx pre-commit install

Run all hooks manually:

uvx pre-commit run --all-files

Hooks include:

  • General: trailing whitespace, end-of-file fixer, large files, merge conflicts
  • Secrets: TruffleHog for secret detection
  • YAML: yamllint, ansible-lint
  • Python: ruff (linting + formatting)
  • Shell: shellcheck, shfmt
  • TOML: taplo
  • JSON: prettier

CI/CD

This repo uses Forgejo Actions for CI/CD. Workflows live in .forgejo/workflows/ (not .github/workflows/). The runner executes jobs in host mode within the Kubernetes cluster.

Documentation

Documentation lives in docs/ and follows the Diataxis framework. Published at https://docs.eblu.me.

Docs use Obsidian wiki-link syntax ([[link]]) for cross-references. Edit with any markdown editor, or use obsidian.nvim for enhanced navigation.