{"id":46100355,"url":"https://github.com/brianmichel/nomad-compass","last_synced_at":"2026-03-01T19:36:25.101Z","repository":{"id":319021949,"uuid":"1071943033","full_name":"brianmichel/nomad-compass","owner":"brianmichel","description":"A simple job reconciler for Nomad","archived":false,"fork":false,"pushed_at":"2025-10-28T02:04:56.000Z","size":4067,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-27T18:38:36.051Z","etag":null,"topics":["gitops","hashicorp","job-scheduler","nomad","paas","reconciliation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianmichel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-08T03:27:52.000Z","updated_at":"2025-11-17T16:11:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"6dc95c30-988d-45eb-bd71-8114681b6c27","html_url":"https://github.com/brianmichel/nomad-compass","commit_stats":null,"previous_names":["brianmichel/nomad-compass"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/brianmichel/nomad-compass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmichel%2Fnomad-compass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmichel%2Fnomad-compass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmichel%2Fnomad-compass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmichel%2Fnomad-compass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianmichel","download_url":"https://codeload.github.com/brianmichel/nomad-compass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmichel%2Fnomad-compass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29981602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitops","hashicorp","job-scheduler","nomad","paas","reconciliation"],"created_at":"2026-03-01T19:36:24.428Z","updated_at":"2026-03-01T19:36:25.093Z","avatar_url":"https://github.com/brianmichel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nomad Compass\n\nA work in progress gitops reconciler for Nomad.\n\nNomad Compass is a GitOps reconciler for HashiCorp Nomad. It runs as a single container that hosts a tiny onboarding UI, stores encrypted repository credentials, and continuously syncs Nomad job specifications committed to Git.\n\n## Features\n\n- **Single container** – Vue-powered onboarding UI and Go backend served from the same binary.\n- **Secure credential storage** – HTTPS tokens and SSH keys encrypted with a symmetric key supplied via configuration.\n- **SQLite persistence** – Lightweight, zero-dependency database managed automatically.\n- **Git polling** – Uses `go-git` to clone, fetch, and track `.nomad/*.nomad.hcl` job files.\n- **Nomad integration** – Parses HCL jobspecs and registers them via the Nomad API with commit metadata attached.\n- **Safe teardown** – Delete repositories or credentials from the UI and optionally purge their Nomad jobs.\n- **Extensive metadata** – Jobs are tagged with repository URL, commit SHA, author, and commit title for traceability.\n- **Well tested** – Core encryption, storage, reconciliation, and Git plumbing covered by unit tests.\n\n## Screenshots\n\n*Monitored Repositories*\n![](/images/compass-repos.png)\n\n*Monitored Jobs*\n![](/images/compass-jobs.png)\n\n## Getting Started\n\n### Tooling with `mise`\n\nThis project ships with a `.mise.toml` that pins Go and Node versions. After installing [`mise`](https://mise.jdx.dev/):\n\n```bash\nmise install\nmise shell\n```\n\n### Configuration\n\nNomad Compass is configured via environment variables:\n\n| Variable | Description | Default |\n| --- | --- | --- |\n| `COMPASS_HTTP_ADDR` | HTTP listener address | `:8080` |\n| `COMPASS_DATABASE_PATH` | Path to SQLite database | `data/nomad-compass.sqlite` |\n| `COMPASS_NOMAD_ADDR` | Nomad API address | `http://127.0.0.1:4646` |\n| `COMPASS_NOMAD_TOKEN` | Nomad ACL token | _empty_ |\n| `COMPASS_NOMAD_REGION` | Nomad region override | _empty_ |\n| `COMPASS_NOMAD_NAMESPACE` | Nomad namespace override | _empty_ |\n| `COMPASS_REPO_BASE_DIR` | Directory for cloned repositories | `data/repos` |\n| `COMPASS_REPO_POLL_SECONDS` | Polling cadence (seconds) | `30` |\n| `COMPASS_CREDENTIAL_KEY` | 32-byte encryption key encoded as 64 hex chars | _required_ |\n\n\u003e ⚠️ The encryption key is mandatory. Generate one with `openssl rand -hex 32`.\n\n### Running locally\n\n1. Install backend dependencies and prepare the database:\n\n    ```bash\n    go test ./...\n    ```\n\n2. Install frontend dependencies and launch the dev server (optional live reload):\n\n    ```bash\n    cd frontend\n    npm install\n    npm run dev\n    ```\n\n   The Vite proxy forwards `/api` requests to the Go backend on port 8080.\n\n3. Build the production bundle and run the Go binary:\n\n    ```bash\n    npm run build        # from frontend/\n    cd ..\n    go run ./cmd/nomad-compass\n    ```\n\n### Docker image\n\nBuild the container:\n\n```bash\ndocker build -t nomad-compass .\n```\n\nRun it:\n\n```bash\ndocker run \\\n  -e COMPASS_CREDENTIAL_KEY=$(openssl rand -hex 32) \\\n  -e COMPASS_NOMAD_ADDR=http://host.docker.internal:4646 \\\n  -p 8080:8080 \\\n  nomad-compass\n```\n\nRun it in Nomad\n\n```bash\nnomad run \\\n  -var=\"nomad_token=token-goes-here\" \\\n  -var=\"credential_key=credential-key-goes-here\" \\\n  example/nomad-compass.nomad.hcl\n```\n\nMount `/data` or change `COMPASS_DATABASE_PATH`/`COMPASS_REPO_BASE_DIR` if you prefer persistent volumes.\n\n### Repository onboarding workflow\n\n1. Create credentials in the UI (HTTPS token or SSH key). Values are encrypted before hitting disk.\n2. Onboard a repository by providing display name, Git URL, branch, optional credential, and the relative path to your job specs (defaults to `.nomad`).\n3. Nomad Compass clones the repo and watches every `*.nomad` and `*.nomad.hcl` file inside that path.\n4. When new commits land, Compass registers each job with metadata:\n\n   - `nomad-compass/repo-url`\n   - `nomad-compass/repo-name`\n   - `nomad-compass/job-file`\n   - `nomad-compass/commit`\n   - `nomad-compass/commit-author`\n   - `nomad-compass/commit-title`\n\nTrigger an immediate reconcile via the UI or `POST /api/repos/{id}/reconcile`.\n\n### Testing\n\nRun the Go test suite:\n\n```bash\ngo test ./...\n```\n\nVue component tests are not included yet. The backend carries the bulk of logic and has targeted unit coverage.\n\n## Project Layout\n\n```\ncmd/nomad-compass     # Application entrypoint\nfrontend/             # Vue + Vite UI\ninternal/auth         # Credential encryption helpers\ninternal/config       # Environment-driven configuration\ninternal/nomadclient  # Thin Nomad API wrapper\ninternal/reconcile    # Reconciliation loop\ninternal/repo         # Git sync and job discovery\ninternal/server       # HTTP API and SPA hosting\ninternal/storage      # SQLite persistence layer\ninternal/web          # Embedded frontend assets\n```\n\n## Future Enhancements\n\n- Background webhook receiver to replace polling when SCM supports it.\n- Audit log of reconciliation events.\n- Pluggable secret backends (Vault, AWS Secrets Manager, etc.).\n- Automated e2e pipeline for Docker image smoke testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianmichel%2Fnomad-compass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianmichel%2Fnomad-compass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianmichel%2Fnomad-compass/lists"}