Commit graph

47 commits

Author SHA1 Message Date
Jeremie Fraeys
5791172575
feat(grafana): add SMTP configuration for email alerts
- Enable SMTP with GF_SMTP_ENABLED: true
- Configure internal Postfix relay (postfix:25)
- Set FROM address to grafana@grafana.jfraeys.com
- Disable TLS verification for internal relay (GF_SMTP_SKIP_VERIFY)
- Clear username/password for unauthenticated internal relay

Note: Grafana role currently commented out in playbook (1GB node constraint)
2026-03-06 14:25:43 -05:00
Jeremie Fraeys
465aed31c6
feat(forgejo): add SMTP configuration for email notifications
- Enable mailer with protocol: smtp
- Configure internal Postfix relay (postfix:25)
- Set FROM address to forgejo@git.jfraeys.com
- Use Jinja2 variable for customizable mailer_from

Enables: Password reset emails, issue notifications, webhook alerts
2026-03-06 14:25:36 -05:00
Jeremie Fraeys
6837683608
feat(lldap): add container healthcheck
- Add healthcheck using wget to /health endpoint
- Set interval: 30s, timeout: 3s, retries: 3, start_period: 10s
2026-03-06 14:25:23 -05:00
Jeremie Fraeys
3e0e97a00c
fix(postfix): enable TLS and fix Postmark authentication
- Add Python script to extract certificates from Traefik acme.json
- Mount extracted certs to /etc/ssl in container for TLS support
- Enable smtpd_tls_security_level: may for incoming STARTTLS
- Remove failed_when: false on cert extraction to catch failures early
- Fix relayhost username to default to password (Postmark server token auth)
- Change default Postmark port from 2525 to 587 (blocked on some networks)
- Create SSL directory before extraction

Fixes: SMTP authentication failures and enables TLS for Authelia password reset
2026-03-06 14:25:10 -05:00
Jeremie Fraeys
64defbd528
fix(authelia): resolve 502 error and SMTP authentication issues
- Remove read_only from docker-compose to fix healthcheck file creation
- Add container healthcheck for proper monitoring
- Disable SMTP auth for internal Postfix connections (username/password cleared)
- Remove NoTLS workaround now that Postfix has proper TLS
- Set startup_check_address to domain-based email (admin@auth.jfraeys.com)
- Fix conditional SMTP username/password in configuration template

Fixes: auth.jfraeys.com 502 Bad Gateway and password reset email failures
2026-03-06 14:24:56 -05:00
Jeremie Fraeys
c70768294a
docs(readme): fix inconsistencies and update service status
- Change setup.sh references to setup for consistency
- Update Overview examples to show active services (git, auth, app)
- Add note to Grafana section about DNS being commented out
- All changes now accurately reflect current infrastructure state
2026-03-06 10:44:20 -05:00
Jeremie Fraeys
d930fe5e26
chore(terraform): comment out unused Grafana/Prometheus DNS, keep App active
- Comment out grafana_services_a, grafana_services_aaaa DNS records
- Comment out prometheus_services_a, prometheus_services_aaaa DNS records
- Keep app_services_a, app_services_aaaa active (user will use app)
- Update README DNS section to show app as active, grafana/prometheus commented out
- Update Role layout to reflect app is active
2026-03-06 10:41:35 -05:00
Jeremie Fraeys
f87512426a
docs(gap-analysis): mark Alertmanager as implemented and add email variables
- Update Alerting section to show IMPLEMENTED status
- Add Postfix/Postmark email to Runtime platform list
- Update Forgejo description to mention AI scrapers blocklist
- Add Email variables section with Postmark configuration
- Update section title to include email implementation
2026-03-06 10:37:42 -05:00
Jeremie Fraeys
e95eac3016
docs(env): update .env.example with Postmark SMTP configuration
- Add POSTFIX_RELAYHOST_PORT=2525 for Postmark
- Clarify Postmark server token usage for username/password
- Remove outdated AUTHELIA_USE_POSTFIX option
2026-03-06 10:37:10 -05:00
Jeremie Fraeys
bb12e5396c
docs(readme): add Postmark email integration and update service docs
- Add Email section with Postfix/Postmark configuration
- Document DNS records (DKIM, return-path, DMARC) for email
- Update Forgejo section with AI scrapers blocklist and OIDC details
- Update Role layout to include Postfix and Traefik file provider notes
- Add Notes about Traefik Docker API workaround and Postfix port 2525
2026-03-06 10:36:22 -05:00
Jeremie Fraeys
9668b6f84e
chore(infra): add Postmark DNS records and update example secrets
- Add DKIM, return-path (CNAME), and DMARC DNS records to Terraform
- Add example variables for Postmark integration to vault.example.yml
- Update .gitignore patterns
2026-03-06 10:32:08 -05:00
Jeremie Fraeys
74fb183b7f
chore(deps): bump watchtower to v1.14 and update Docker API version
- Update watchtower from 1.7.1 to 1.14
- Set DOCKER_API_VERSION to 1.44 for compatibility
2026-03-06 10:31:58 -05:00
Jeremie Fraeys
0a85b23a33
refactor(monitoring): update Alertmanager and exporter configurations
- Simplify Alertmanager to use localhost:25 by default (Postfix)
- Update node-exporter and cadvisor compose configurations
- Bump Loki, Grafana, Prometheus image versions
2026-03-06 10:31:52 -05:00
Jeremie Fraeys
1a7cde2939
feat(forgejo): add AI scrapers blocklist, OIDC config, and UI settings
- Add AI scrapers robots.txt update script with weekly cron job
- Add OIDC group claim and admin group configuration for Authelia
- Add UI settings (SHOW_USER_EMAIL: false)
- Increase memory limit to 512M
2026-03-06 10:31:46 -05:00
Jeremie Fraeys
6ea9c060bd
feat(postfix): configure Postmark SMTP relay for transactional email
- Change default relay port from 587 to 2525 (Postmark)
- Add Docker provider environment variables for API version compatibility
- Configure for Postmark server token authentication
2026-03-06 10:31:39 -05:00
Jeremie Fraeys
6bf29f90e6
fix(traefik): add Docker provider and file provider fallback for service discovery
- Add vault vars include with traefik tag for CF_DNS_API_TOKEN availability
- Add Docker provider socket and API version to home compose
- Add Forgejo router to file provider as fallback (Docker provider broken due to API version mismatch)
- Fixes 404 errors on git.jfraeys.com when Docker provider fails
2026-03-06 10:31:05 -05:00
Jeremie Fraeys
dd1f9df69b
Restructure playbooks and update main deployment workflows
- Delete playbooks/app.yml (replaced by deploy-app.yml)
- Delete playbooks/test_config.yml (moved to playbooks/tests/)
- Delete setup.sh (renamed to setup)
- Update deploy.yml with improved deployment orchestration
- Update services.yml to include new infrastructure roles
2026-02-21 18:31:53 -05:00
Jeremie Fraeys
2610b904a2
Update secrets management and authentication scripts
- Update vault.example.yml with current secret structure
- Enhance gen-auth-secrets.sh for improved OIDC client generation
2026-02-21 18:31:36 -05:00
Jeremie Fraeys
9eee1183b0
Update Terraform infrastructure configuration
- Update main.tf with current infrastructure definitions
- Adjust resource configurations for production requirements
2026-02-21 18:31:30 -05:00
Jeremie Fraeys
2ce1af3b1e
Update Traefik reverse proxy configuration
- Enhance home-docker-compose.yml template with improved networking
- Update deployment tasks for better label handling
- Improve TLS certificate verification flow
2026-02-21 18:31:25 -05:00
Jeremie Fraeys
4842c71cae
Add new playbooks and update inventory configuration
- Add deploy-app.yml playbook for application-specific deployments
- Add web.yml playbook for web infrastructure management
- Restructure tests/test_config.yml for better organization
- Update inventory/group_vars/all.yml with new hostnames and settings
2026-02-21 18:31:20 -05:00
Jeremie Fraeys
b9c5cdff12
Add app deployer role for automated deployments
- Systemd service and timer for deployment orchestration
- Webhook listener for Git-triggered deployments
- Forgejo Actions workflow for CI/CD pipeline
- Deployment scripts with rollback capability
- Deploy token validation for security
2026-02-21 18:31:12 -05:00
Jeremie Fraeys
e364538206
Update Forgejo and runner with new features
- Add Redis cache support to Forgejo for improved performance
- Add AI scrapers blocking with update script and robots.txt
- Update Forgejo runner tasks with improved caching support
- Add OIDC authentication configuration tasks
2026-02-21 18:31:06 -05:00
Jeremie Fraeys
e4634484f8
Update authentication stack (Authelia, LLDAP)
- Update Authelia configuration template for OIDC and access control
- Enhance Authelia deployment tasks
- Update LLDAP deployment tasks
2026-02-21 18:31:01 -05:00
Jeremie Fraeys
ed6101be76
Enhance monitoring stack (Prometheus, Grafana)
- Add Prometheus alert rules configuration (alerts.yml.j2)
- Update Prometheus docker-compose and main configuration
- Add Grafana tasks for improved deployment and verification
- Integrate Alertmanager with Prometheus for alerting pipeline
2026-02-21 18:30:57 -05:00
Jeremie Fraeys
7d66552482
Add Alertmanager role for Prometheus alerting
- Docker Compose deployment for Alertmanager v0.27.0
- Optional Discord webhook integration for notifications
- Persistent storage for alert state
2026-02-21 18:30:51 -05:00
Jeremie Fraeys
78ad592664
Add core infrastructure security and utility roles
- Add firewall role for UFW/iptables management
- Add fail2ban role for intrusion prevention with Docker-aware jails
- Add postfix role for mail relay capabilities
- Add backups role for automated infrastructure backups
  - systemd timer for scheduled backups
  - Backup scripts for Docker volumes and configurations
2026-02-21 18:30:42 -05:00
Jeremie Fraeys
ac19b5918f
Add documentation and infrastructure gap analysis
- Update README.md with current architecture documentation
- Add INFRA_GAP_ANALYSIS.md for tracking infrastructure improvements
- Add .python-version for pyenv version management
2026-02-21 18:30:33 -05:00
Jeremie Fraeys
e7b9546f7f
Update infrastructure tooling and configuration
- Rename setup.sh to setup (drop extension for cleaner CLI)
- Update ansible.cfg for improved playbook execution
- Update .env.example with current environment variables
2026-02-21 18:30:16 -05:00
Jeremie Fraeys
d36d3db10d
Add Redis cache to Forgejo 2026-02-21 18:27:04 -05:00
Jeremie Fraeys
67eb2227dd
refactor(scripts): simplify forgejo actions secret helper
Keep only app_ssh_access essentials: generate keypairs, upload plaintext Actions secrets, optionally update vault public keys.
2026-01-21 23:15:38 -05:00
Jeremie Fraeys
872d0cbe49
fix(forgejo): clearer PAT scope error for user/org secrets
Exit cleanly on 403 for user/org scoped secrets and surface required token scope(s) when provided by the API.
2026-01-21 23:10:48 -05:00
Jeremie Fraeys
0814900598
fix(scripts): python3.9 compatibility + better Forgejo secret errors
- Replace PEP604 unions with typing.Optional for broader Python compatibility
- Print actionable guidance when user/org-scoped secret API calls return 403
2026-01-21 23:09:44 -05:00
Jeremie Fraeys
35796b1069
feat(forgejo): set Actions secrets at user/org scope
- Add --scope {user,org,repo} (default user) to upsert Actions secrets\n- Keep repo support and add --org for org scope\n- Include security caveat in CLI help and warning output
2026-01-21 23:07:02 -05:00
Jeremie Fraeys
0c6d09abcd
fix(ssh): allow dual-stack runner source for restricted keys
- Include web IPv6 alongside IPv4 in authorized_keys from= allowlist\n- Write web public IPv6 into inventory/host_vars/web.yml from Terraform outputs
2026-01-21 15:08:36 -05:00
Jeremie Fraeys
8ac79d3300
feat(terraform): add services-ssh DNS record
Add non-proxied Cloudflare A/AAAA records for services-ssh to support infra-controller SSH access.
2026-01-21 14:43:43 -05:00
Jeremie Fraeys
92003e8f1c
fix(forgejo-runner): prevent duplicate runner registrations
- Persist runner registration state by setting container working_dir to /data\n- Add post-register assertion that /opt/forgejo-runner/data/.runner exists
2026-01-20 18:06:51 -05:00
Jeremie Fraeys
adca1b0ef9
chore(test): update test_config for current infra
- Validate forgejo-runner compose stack on web host
- Validate infra-controller runtime directories on services host
- Improve missing-dir failure message with guidance
2026-01-20 17:28:15 -05:00
Jeremie Fraeys
f9a7411cfb
chore(setup): improve setup.sh UX and update README
- Add --help and ansible-only/no-terraform modes\n- Add basic prereq checks and clearer error messages\n- Update README with new setup options and python requirements for helper scripts
2026-01-20 17:19:06 -05:00
Jeremie Fraeys
a22381492e
feat(infra-controller): add restricted SSH access role
- Add infra_controller role to provision a dedicated user\n- Install register/deregister forced-command authorized_keys entries\n- Read SSH public keys from vault/env and restrict access by source IP
2026-01-20 17:14:31 -05:00
Jeremie Fraeys
9e7b51b69a
docs: document Actions SSH key setup
- Document required register/deregister SSH keys for controller workflows\n- Update vault.example.yml with FORGEJO_API_TOKEN and SSH public key placeholders
2026-01-20 17:10:41 -05:00
Jeremie Fraeys
a3da8deb0f
feat(actions-ssh): use register/deregister keys for services access
- Add app_ssh_access role to install forced-command keys for infra-register-stdin and infra-deregister\n- Ensure required infra-controller runtime directories exist on services host\n- Add helper script to generate/register both Actions SSH secrets and update vault public keys
2026-01-20 17:10:02 -05:00
Jeremie Fraeys
c2056d4cd4
fix(forgejo-runner): validate label executor scheme
- Set default runner label to 'self-hosted:docker://…'\n- Add an early assert to fail fast when labels use an invalid executor scheme
2026-01-20 17:09:17 -05:00
Jeremie Fraeys
997aff6be3
initial infra commit 2026-01-19 15:02:13 -05:00
Jeremie Fraeys
1d2f8e6141
retry workflows with debian 2026-01-19 14:28:20 -05:00
Jeremie Fraeys
c397737ff1
retry actions 2026-01-19 14:27:52 -05:00
Jeremie Fraeys
3ab4e338b2
retry actions 2026-01-19 14:27:43 -05:00