Commit Graph
14682 Commits
Author SHA1 Message Date
Prageeth Panicker f4b41c64af fix(pihole): use provider_ca_files (plural array), not provider_ca_file
oauth2-proxy's singular 'provider-ca-file' flag has a known bug
(oauth2-proxy/oauth2-proxy#2802) and may not be a valid config key on
:latest, causing oauth2-proxy to fail config parsing and crash on
startup. This made nginx's auth_request to sso-proxy return 500 for
every pihole request (HTTP Error 500 on https://pihole.infinito.example/),
blocking even the pre-Playwright readiness check.

provider_ca_files (plural, array of strings) is the documented,
working config key for loading a custom CA for the OIDC provider
connection.
2026-06-23 13:19:24 +00:00
Prageeth Panicker 49313dd9b5 fix(pihole): remove duplicate sso-proxy block from compose.yml.j2
This block was added in an earlier (reverted-in-intent but never
actually removed) attempt and caused a duplicate 'sso-proxy' YAML key
(also defined via sys-svc-compose/base.yml.j2's sso_proxy include),
breaking compose_ca.py's compose config parsing entirely.

The CA trust fix now lives solely in 01_core.yml's lineinfile task,
which patches the rendered oauth2-proxy config file directly -- no
compose.yml changes needed.
2026-06-23 13:19:23 +00:00
Prageeth Panicker bdeb32b5b6 fix(pihole): sort playwright.env.j2 keys alphabetically 2026-06-23 13:19:23 +00:00
Prageeth Panicker 2e995f33a5 fix(pihole): declare CANONICAL_DOMAIN in playwright.env.j2
Required by playwright.spec.js baseline checks (canonical domain
assertion), added in the previous commit.
2026-06-23 13:19:23 +00:00
Prageeth Panicker 20f5fb8e64 fix(pihole): address review feedback (Kevin)
- playwright.spec.js: remove duplicated SSO/persona scenarios now
  covered by test-guest.js/test-oauth2.js/test-native.js. Reduce to
  baseline checks (front page + TLS/HSTS, HTML content-type), matching
  the pgadmin pattern.
- meta/main.yml: rewrite description to describe Pi-hole the software
  (network-wide DNS sinkhole, DNS/DHCP management, web dashboard)
  rather than the role/integration details.
2026-06-23 13:19:22 +00:00
Prageeth Panicker 8e122f6f98 fix(pihole): resolve port collision with web-app-penpot
penpot was merged using ports 8041/16506 after our last rebase.
Reassign pihole to 8078 (http) and 16507 (sso) via
infinito contributing network ports suggest.
2026-06-23 13:19:22 +00:00
Prageeth Panicker 8e295c369c fix(pihole): trust self-signed platform CA for sso-proxy OIDC discovery
oauth2-proxy (quay.io/oauth2-proxy/oauth2-proxy) is a distroless image
with no /bin/sh, so the platform's CA-trust wrapper (with-ca-trust.sh,
applied by compose_ca.py for services with a shell) is skipped for this
container. Go binaries ignore SSL_CERT_FILE/REQUESTS_CA_BUNDLE and use
only the OS system cert pool, so on self-signed TLS setups oauth2-proxy
fails OIDC discovery against Keycloak with
'x509: certificate signed by unknown authority'. nginx then falls back
to pihole's native /admin/login instead of redirecting to Keycloak,
breaking SSO entirely in CI and on any self-signed deployment.

Fix: append provider_ca_file to the rendered sso-proxy config after
web-app-keycloak/tasks/sso_proxy.yml renders it and before compose up
runs. oauth2-proxy loads this CA explicitly for the OIDC provider
connection, bypassing the system cert pool entirely.

Scoped to this role: avoids touching the shared
oauth2-proxy-keycloak.cfg.j2 template (would affect every
flavor: oauth2 role platform-wide). No-op on production
(TLS_MODE=letsencrypt).
2026-06-23 13:19:21 +00:00
Prageeth Panicker 5400bef499 fix(pihole): inject CA cert for sso-proxy on self-signed TLS
oauth2-proxy is a distroless Go binary — the platform CA wrapper
(with-ca-trust.sh) is skipped because there is no /bin/sh, and Go
ignores SSL_CERT_FILE. Pass the CA cert directly via --provider-ca-file
so oauth2-proxy trusts the internal Keycloak OIDC endpoint.

Follows the penpot pattern of inline command override in compose.yml.j2
conditioned on TLS_MODE == self_signed. No-op on production (letsencrypt).
2026-06-23 13:19:21 +00:00
Prageeth Panicker acc6e5be05 fix(pihole): trust self-signed CA for sso-proxy OIDC connection
oauth2-proxy is distroless (no /bin/sh), so the platform CA wrapper
entrypoint is skipped. Go binaries ignore SSL_CERT_FILE and use the
system cert pool only, causing x509 errors on self-signed TLS setups.

Override sso-proxy command in compose.override.yml.j2 to append
--provider-ca-file pointing to the platform CA cert
(/tmp/infinito/ca/root-ca.crt, always bind-mounted by compose_ca.py)
when TLS_MODE is self_signed. No-op on production (letsencrypt).
2026-06-23 13:19:21 +00:00
Prageeth Panicker 0277cd4635 fix(web-app-pihole): add compose_handlers_flush and increase wait_for timeout to 300s 2026-06-23 13:19:20 +00:00
Prageeth Panicker eb65774ca1 fix(web-app-pihole): restore correct PORT_BANDS mariadb entry, remove legacy database band 2026-06-23 13:19:20 +00:00
Prageeth Panicker f002b0ce61 fix(web-app-pihole): fix nested template literal syntax error in playwright spec 2026-06-23 13:19:20 +00:00
Prageeth Panicker d60d1b9ded fix(web-app-pihole): fix string concatenation lint error in playwright spec 2026-06-23 13:19:19 +00:00
Prageeth Panicker a1fa71699e fix(web-app-pihole): fix SSO port collision - use 16506 instead of 16505 2026-06-23 13:19:19 +00:00
Prageeth Panicker 7dfd416d94 fix(web-app-pihole): address reviewer feedback - SSO/native password, split tests, remove schema 2026-06-23 13:19:18 +00:00
Prageeth Panicker 7a4542cf0d fix(web-app-pihole): fix bare URL in README 2026-06-23 13:19:18 +00:00
Prageeth Panicker fd5a64731f fix(web-app-pihole): migrate to v9.x SSO pattern and fix compose_volumes 2026-06-23 13:19:18 +00:00
Prageeth Panicker 6e7f847bc8 fix(web-app-pihole): fix dynamic flags, port, personas, block size, docker exec, README 2026-06-23 13:19:17 +00:00
Prageeth Panicker fe6ca57c81 fix(web-app-pihole): resolve CI lint failures and test compliance 2026-06-23 13:19:17 +00:00
Prageeth Panicker 44db7ed2b1 ci: retrigger CI after rebase on main 2026-06-23 13:19:16 +00:00
Prageeth Panicker bee5fd784c fix(web-app-pihole): remove duplicate TEST_E2E_PLAYWRIGHT_WAIT_ENABLED constant
Already defined in test-e2e-playwright/defaults/main.yml.
HTTP wait accepts 100-499 range including oauth2-proxy 403.
2026-06-23 13:19:16 +00:00
Prageeth Panicker b837d26739 fix(web-app-pihole): fix oauth2-proxy deployment and javascript injection
- Fix oauth2.enabled: replace Jinja2 group_names expression with literal true
- Set oauth2.shared: false to deploy role-local oauth2-proxy instance
- Add allowed_groups for RBAC administrator access control
- Add javascript service for logout button injection
- Remove variant 1 (standalone mode) - pihole always requires Keycloak
- Delete compose.override.yml.j2 (--ssl-insecure-skip-verify no longer needed)
- Fix javascript.js.j2: wrap redirect in DOMContentLoaded to fix DOM timing
- Add TEST_E2E_PLAYWRIGHT_WAIT_ENABLED: false for oauth2-protected app
2026-06-23 13:19:16 +00:00
Prageeth Panicker 0dd92cb852 fix(web-app-pihole): restore oauth2_proxy_cookie_secret to schema.yml
inventory.py auto-generation only triggers when oauth2.enabled is a literal
boolean True. Pihole uses a Jinja2 expression for enabled, so auto-generation
does not trigger. The credential must be defined in schema.yml explicitly.
2026-06-23 13:19:15 +00:00
Prageeth Panicker f10654ee7f fix(web-app-pihole): remove oauth2_proxy_cookie_secret from schema.yml
Other OAuth2-protected apps (decidim, espocrm, etc.) do not define this
credential in their schema.yml and work correctly. The platform handles
the cookie_secret for all apps through the web-app-oauth2-proxy role.
Defining it per-role was causing oauth2-proxy to crash on startup in CI
because the credential was not properly generated in the CI environment.
2026-06-23 13:19:15 +00:00
Prageeth Panicker 5e2c2488fe fix(web-app-pihole): skip TLS verification for oauth2-proxy OIDC discovery
oauth2-proxy cannot verify Keycloak's self-signed certificate during OIDC
discovery because the platform CA cert is injected via env vars but Go's
TLS stack doesn't pick it up reliably in the DinD environment.

Adding --ssl-insecure-skip-verify allows oauth2-proxy to complete OIDC
discovery and serve requests instead of crash-looping with certificate errors.
This is acceptable for a self-signed lab environment.
2026-06-23 13:19:15 +00:00
Prageeth Panicker 5467a1c503 fix(web-app-pihole): add compose.override.yml.j2 to fix oauth2-proxy DNS resolution
oauth2-proxy cannot resolve auth.infinito.example from inside Docker in CI
environments where CoreDNS does not have this entry. Adding extra_hosts via
compose.override.yml.j2 (auto-included by compose_file_args lookup) maps
the Keycloak domain to host-gateway so OIDC discovery succeeds.
2026-06-23 13:19:14 +00:00
Prageeth Panicker 8e31e7fea9 fix(web-app-pihole): wait for Keycloak OIDC endpoint before setup
Pi-hole deploys immediately after Keycloak but Keycloak needs time to
initialize OIDC. Adding explicit wait for Keycloak OIDC discovery endpoint
ensures oauth2-proxy can complete OIDC discovery and serve 302 redirects
instead of 500 errors when the platform Playwright wait check runs.
2026-06-23 13:19:14 +00:00
Prageeth Panicker 403c463514 fix(web-app-pihole): fix lint errors and add HTTPS health check
- meta/services.yml: add noqa comment for email integration
- tasks/01_setup.yml: use uri_retry instead of legacy uri module
- tasks/01_setup.yml: add HTTPS endpoint check to prevent 500 in CI wait check
- tasks/01_setup.yml: increase oauth2-proxy wait timeout to 300s with ignore_errors
2026-06-23 13:19:13 +00:00
Prageeth Panicker f6ba8d615e fix(web-app-pihole): add ignore_errors to oauth2-proxy wait task
oauth2-proxy requires Keycloak to complete OIDC discovery before binding its port.
If Keycloak is still warming up, oauth2-proxy may not be ready within the timeout.
Playwright tests validate the actual functionality end-to-end.
2026-06-23 13:19:13 +00:00
Prageeth Panicker 42c16d6495 fix(web-app-pihole): increase oauth2-proxy wait timeout to 300s
oauth2-proxy needs time to complete OIDC discovery against Keycloak in CI.
120s was insufficient - increased to 300s to allow for slower CI environments.
2026-06-23 13:19:13 +00:00
Prageeth Panicker 60c3489de9 fix(web-app-pihole): address reviewer feedback and fix CI failures
- tasks/01_core.yml: set docker_compose_flush_handlers: true, remove manual flush_handlers task
- tasks/01_setup.yml: add wait for oauth2-proxy port to fix HTTP 500 in CI wait check
- meta/services.yml: use NETWORK_PUBLIC_DNS_RESOLVERS SPOT for upstream_dns
- vars/main.yml: remove default from upstream_dns lookup, join list with semicolon
2026-06-23 13:19:12 +00:00
Prageeth Panicker 43b5a8932d fix(web-app-pihole): remove host port 53 binding to fix CI on Fedora
Port 53 is already in use by systemd-resolved on Fedora CI runners.
Pi-hole DNS still works within the Docker network without host binding.
Playwright tests don't require DNS functionality on the host.
2026-06-23 13:19:12 +00:00
Prageeth Panicker 0e1ae7b110 fix(web-app-pihole): remove duplicate TEST_E2E_PLAYWRIGHT_WAIT_ENABLED constant
Variable is already defined platform-wide in test-e2e-playwright/defaults/main.yml.
Redefining it in vars/main.yml violates the project-wide constant uniqueness rule.
2026-06-23 13:19:12 +00:00
Prageeth Panicker 1d58e10648 fix(web-app-pihole): fix playwright logout test, remove duplicate oauth2-proxy block, add playwright wait flag
- Update logout test to navigate directly to oauth2/sign_out endpoint with Keycloak logout redirect
- Remove duplicate oauth2-proxy service definition from compose.yml.j2 (was causing duplicate key error)
- Add TEST_E2E_PLAYWRIGHT_WAIT_ENABLED: false to vars/main.yml (oauth2-proxy returns 403 before redirect)
2026-06-23 13:19:11 +00:00
Prageeth Panicker 3f888a28d3 fix(web-app-pihole): resolve CI failures - subnet, port, resource limits
- Change subnet from 192.168.102.240/28 to 192.168.103.80/28 (overlap with web-app-fediwall)
- Change local.oauth2 port from 16493 to 16500 (collision with web-svc-libretranslate)
- Extend PORT_BANDS.local.oauth2 band from 16499 to 16514 (band exhausted)
- Add missing resource limits to meta/services.yml (cpus, mem_reservation, mem_limit, min_storage, pids_limit)
2026-06-23 13:19:11 +00:00
Prageeth Panicker fcc43627b0 fix(web-app-pihole): add schema.yml with oauth2_proxy_cookie_secret credential 2026-06-23 13:19:10 +00:00
Prageeth Panicker 5b80d2cd6d fix(web-app-pihole): wrap javascript.js.j2 in raw block to prevent Jinja2 parsing 2026-06-23 13:19:10 +00:00
Prageeth Panicker 5834c054f7 fix(web-app-pihole): fix config path for upstream_dns lookup 2026-06-23 13:19:10 +00:00
Prageeth Panicker 9718c83eb5 fix(web-app-pihole): add variants, javascript injection, fix oauth2 DNS, update playwright tests 2026-06-23 13:19:09 +00:00
Prageeth Panicker 71a3fdaa72 fix(web-app-pihole): restore PIHOLE_VOLUME_DATA and PIHOLE_VOLUME_DNSMASQ vars 2026-06-23 13:19:09 +00:00
Prageeth Panicker 44d4bf9f5d fix(web-app-pihole): fix CI lint and integration test failures 2026-06-23 13:19:09 +00:00
Prageeth Panicker c9f4f7f1ac fix(web-app-pihole): migrate to meta/services.yml, fix domain resolution, disable native password 2026-06-23 13:19:08 +00:00
Prageeth Panicker cad746af11 fix(web-app-pihole): fix compose template, RBAC group, playwright env and wait flag 2026-06-23 13:19:08 +00:00
Prageeth Panicker 1999910a4c fix(web-app-pihole): add sys-svc-compose networks include to compose template 2026-06-23 13:19:07 +00:00
Prageeth Panicker 16e255d3c5 fix(web-app-pihole): fix CI lint failures
- Add tasks/01_core.yml with run_once guard (test_service_core_first_task_run_once)
- Update tasks/main.yml to load 01_core.yml with run_once guard
- Add '# noqa: shared' comment on oauth2 config (test_service_shared_consistency)
- Remove unused PIHOLE_PORT variable from vars/main.yml (test_variable_usage)
2026-06-23 13:19:07 +00:00
Prageeth Panicker 02bcc94320 feat(web-app-pihole): add Pi-hole role with OAuth2/Keycloak RBAC
- Deploy Pi-hole as web app with NGINX proxy and OAuth2 protection
- Only web-app-pihole-administrators group can access the dashboard
- DNS port 53 (TCP/UDP) exposed for network-wide ad blocking
- Upstream DNS configurable per inventory (default: Cloudflare 1.1.1.1)
- Redis session store for OAuth2 proxy
- Timezone from HOST_TIMEZONE platform variable
- Port bindings use DOCKER_BIND_HOST platform variable
- Register subnet 192.168.102.240/28 in networks
- Register ports 8070 (http) and 16493 (oauth2) in ports
- Playwright tests: oauth2 protection, admin login, biber denied (3/3 passing)

Known limitations:
- Pi-hole v6 gravity blocklist requires manual setup via admin UI
- Internal *.infinito.example DNS forwarding to CoreDNS planned as follow-up
2026-06-23 13:18:51 +00:00
kevinveenbirkenbachandClaude Opus 4.8 67e7f93bda fix(pixelfed): group the best-effort ca-certificates install (shellcheck SC2015)
The CA-install entrypoint used 'apt-get update && apt-get install ... || true', which shellcheck flags as SC2015 (A && B || C is not if-then-else; C may run when A is true). Group it as '{ apt-get update && apt-get install ...; } || true' — identical best-effort semantics, shellcheck-clean. Verified by make test (lint-shellcheck green).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 12:10:03 +02:00
kevinveenbirkenbachandClaude Opus 4.8 d94eac13b0 fix(svc-ai-ollama): use the official ollama image so inference works
The CI variant overrode the role's ollama/ollama default with alpine/ollama, which ships the API/CLI but NOT the llama-server inference runner — so openwebui's ollama-chat completion failed with HTTP 400. Drop the variant's image override so it inherits ollama/ollama (runner built-in) from meta/services.yml. Reverts the earlier runner-provisioning approach (alpine + downloaded runner) as unnecessarily heavy/fragile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 12:10:03 +02:00
kevinveenbirkenbachandClaude Opus 4.8 6796658d03 fix(install): let the lint package installer wait for a busy dpkg lock
system_pkg.py's apt-get update/install failed immediately ('Could not get lock /var/lib/dpkg/lock-frontend') when a concurrent deploy held the dpkg lock, so make autoformat/test could not run while a deploy was in progress. Pass -o DPkg::Lock::Timeout=600 to both apt-get invocations so they wait for the lock instead of failing, and update the unit test to assert the lock-wait. Scope is the dev/lint package installer only; the Ansible deploys use ansible.builtin.apt and are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 12:10:02 +02:00
kevinveenbirkenbachandClaude Opus 4.8 fb9351cdb9 revert(bridgy-fed): drop the brevity @new-tlds sed normalization
The earlier 'sed -i "/brevity/ s/@new-tlds//" requirements.txt' did not resolve the pip ResolutionImpossible (the build still failed with it applied) and the analysis flagged it as a backwards/ineffective normalization. Remove it and leave the brevity/granary direct-URL resolution to pip as upstream ships it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 11:17:59 +02:00