{"id":50543850,"url":"https://github.com/colonelpanic8/org-agenda-api-template","last_synced_at":"2026-06-03T22:01:56.440Z","repository":{"id":333334742,"uuid":"1136438617","full_name":"colonelpanic8/org-agenda-api-template","owner":"colonelpanic8","description":"Template for deploying org-agenda-api to Fly.io with Nix","archived":false,"fork":false,"pushed_at":"2026-01-18T16:51:11.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-19T00:51:26.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/colonelpanic8.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":"2026-01-17T17:35:05.000Z","updated_at":"2026-01-18T16:51:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/colonelpanic8/org-agenda-api-template","commit_stats":null,"previous_names":["colonelpanic8/org-agenda-api-template"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/colonelpanic8/org-agenda-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Forg-agenda-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Forg-agenda-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Forg-agenda-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Forg-agenda-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colonelpanic8","download_url":"https://codeload.github.com/colonelpanic8/org-agenda-api-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Forg-agenda-api-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33881107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-03T22:01:55.876Z","updated_at":"2026-06-03T22:01:56.431Z","avatar_url":"https://github.com/colonelpanic8.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# org-agenda-api Template\n\nDeploy your org-mode agenda as a secure REST API on [Fly.io](https://fly.io).\n\n## Quick Start\n\nRun this command to get started:\n\n```bash\nbash \u003c(curl -fsSL https://raw.githubusercontent.com/colonelpanic8/org-agenda-api-template/master/setup.sh)\n```\n\nThe interactive setup wizard will:\n- Install Nix and direnv if needed\n- Fork or clone this template (with GitHub CLI, or plain git)\n- Walk you through all configuration\n- Set up encrypted secrets\n- Prepare everything for deployment\n\n## What You'll Need\n\nBefore running setup, make sure you have:\n\n1. **A Fly.io account** - Sign up at [fly.io](https://fly.io) (free tier available, credit card required)\n2. **A git repository with your .org files** - Private GitHub/GitLab repo or any SSH-accessible git server\n\nThe setup wizard handles everything else, including installing Nix if you don't have it.\n\n## What This Template Provides\n\nThis template sets up [org-agenda-api](https://github.com/colonelpanic8/org-agenda-api) with:\n- Encrypted secrets management (agenix)\n- Automatic git sync of your org files\n- HTTP Basic Auth protection\n- Infrastructure as code (OpenTofu/Terraform)\n\n## Manual Setup\n\nIf you prefer to clone manually:\n\n```bash\ngit clone https://github.com/colonelpanic8/org-agenda-api-template.git\ncd org-agenda-api-template\n./setup.sh\n```\n\nThe setup wizard will:\n- Check prerequisites and help install missing ones\n- Generate a secure password (or let you choose one)\n- Generate a dedicated SSH deploy key\n- Create all configuration files\n- Encrypt your secrets with agenix\n\n### Option B: Manual Setup\n\n1. Copy the example config:\n   ```bash\n   cp config.env.example config.env\n   ```\n\n2. Edit `config.env` with your values\n\n3. Create your SSH key and secrets manually (see [Secrets Management](#secrets-management))\n\n## Deployment\n\nAfter running setup.sh (or manual setup):\n\n```bash\n# Enter the development shell (loads all tools)\nnix develop\n# Or if using direnv: direnv allow\n\n# Authenticate with Fly.io\nflyctl auth login\n\n# Deploy infrastructure\ntofu init\ntofu apply\n\n# Build container and set Fly.io secrets\n./deploy.sh\n```\n\nYour API will be available at `https://YOUR-APP-NAME.fly.dev`\n\n## Testing\n\n```bash\n# Enter dev shell first\nnix develop\n\n# Test the deployed API\ncurl -u YOUR_USER:YOUR_PASSWORD https://YOUR-APP-NAME.fly.dev/agenda\n\n# Or use the justfile commands\njust health   # Check if server is running\njust agenda   # Get agenda (requires auth)\n```\n\n## Configuration\n\n### config.env\n\nMain configuration file (created by setup.sh or manually):\n\n| Variable | Description |\n|----------|-------------|\n| `FLY_APP_NAME` | Your Fly.io app name (becomes `NAME.fly.dev`) |\n| `FLY_REGION` | Deployment region (e.g., `ord`, `lax`, `ams`) |\n| `AUTH_USER` | Username for HTTP Basic Auth |\n| `GIT_SYNC_REPOSITORY` | SSH URL of your org files repo |\n| `GIT_USER_EMAIL` | Email for git commits |\n| `GIT_USER_NAME` | Name for git commits |\n| `SSH_IDENTITY_FILE` | Path to SSH key for agenix |\n\n### custom-config.el\n\nOrg-mode configuration loaded by Emacs. Edit this to customize:\n- Which files to include in the agenda\n- TODO keywords\n- Custom agenda views\n- Any other org-mode settings\n\nSee the file for examples and documentation.\n\n## Secrets Management\n\nSecrets are encrypted using [agenix](https://github.com/ryantm/agenix) and stored in the `secrets/` directory:\n\n| File | Contents |\n|------|----------|\n| `secrets/auth-password.age` | API login password |\n| `secrets/git-ssh-key.age` | SSH key for git sync |\n\n### Editing Secrets\n\n```bash\n# Enter dev shell\nnix develop\n\n# Edit a secret (opens in $EDITOR)\nagenix -e secrets/auth-password.age\n```\n\n### How It Works\n\n1. Secrets are encrypted with your SSH key's public key (converted to age format)\n2. When you enter `nix develop`, `decrypt-secrets.sh` decrypts them\n3. Decrypted values are exported as environment variables\n4. `deploy.sh` sends them to Fly.io's secret management\n\n## Updating\n\n### Update org-agenda-api version\n\n```bash\nnix flake update org-agenda-api\n./deploy.sh\n```\n\n### Update your org files\n\nThe container automatically syncs your org repository. Changes appear within a few minutes.\n\n## Troubleshooting\n\n### \"Permission denied\" when syncing org repo\n\nMake sure you've added the deploy key to your repository:\n1. Get your public key: `cat secrets/deploy-key.pub` (or your SSH key's .pub file)\n2. Add it as a deploy key in your repository settings\n\nFor GitHub: Repository Settings -\u003e Deploy keys -\u003e Add deploy key\n\n### Secrets won't decrypt\n\nCheck that `SSH_IDENTITY_FILE` in config.env points to the correct key, or that your key exists at `~/.ssh/id_ed25519`.\n\n### Container won't start\n\nCheck logs:\n```bash\nflyctl logs -a YOUR-APP-NAME\n```\n\n### Setup.sh fails on ssh-to-age\n\nMake sure you're using an ed25519 SSH key. RSA keys may not work with all versions of ssh-to-age.\n\n## API Endpoints\n\nOnce deployed, your API provides these endpoints:\n\n| Endpoint | Description |\n|----------|-------------|\n| `GET /health` | Health check (no auth required) |\n| `GET /agenda` | Today's agenda |\n| `GET /get-all-todos` | All TODO items |\n| `GET /get-todays-agenda` | Today's agenda items |\n| `GET /agenda-files` | List of agenda files |\n| `POST /create-todo` | Create a new TODO |\n\nAll endpoints except `/health` require HTTP Basic Auth.\n\n## Advanced Usage\n\nFor a more advanced setup with tangled dotfiles integration, see:\n[github.com/colonelpanic8/colonelpanic-org-agenda-api](https://github.com/colonelpanic8/colonelpanic-org-agenda-api)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Forg-agenda-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolonelpanic8%2Forg-agenda-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Forg-agenda-api-template/lists"}