-
Notifications
You must be signed in to change notification settings - Fork 3
SSL and Domains
Govard provides local HTTPS for .test domains through the shared Caddy proxy and its internal certificate authority.
- Local
.testDNS routing viadnsmasq - Certificate issuance for all project domains
- Root CA export to
~/.govard/ssl/root.crt - System trust-store installation (best-effort)
- Browser NSS import when
certutilis available - PHP runtime trust refresh on
govard env up/govard env restartwhen the exported Root CA exists
Govard runs a built-in dnsmasq service that resolves *.test domains to your local environment. You need to tell your OS to forward .test queries to this service.
Works on Ubuntu, Debian, Arch, Fedora:
sudo mkdir -p /etc/systemd/resolved.conf.d
cat <<'EOF' | sudo tee /etc/systemd/resolved.conf.d/govard-test.conf
[Resolve]
DNS=127.0.0.1
Domains=~test
EOF
sudo systemctl restart systemd-resolvedsudo apt-get install resolvconf
echo "nameserver 127.0.0.1" | sudo tee /etc/resolvconf/resolv.conf.d/tail
sudo resolvconf -usudo mkdir -p /etc/resolver
echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/testresolvectl query laravel.test
dig +short laravel.testgovard svc up and govard svc restart auto-trust the Govard Root CA by default.
govard svc up # Auto-trusts CA
govard doctor trust # Manual trust (re-run anytime)Skip auto-trust when needed:
govard svc up --no-trustWhat doctor trust does:
- Exports Root CA from Caddy to
~/.govard/ssl/root.crt - Installs into system trust store (Linux/macOS)
- Best-effort import into Chromium/Firefox NSS stores when
certutilis available
Tip
On Linux, install certutil from the libnss3-tools package so Govard can import into browser NSS stores automatically:
sudo apt-get install libnss3-toolsIf the OS trust is installed but your browser still shows warnings:
- Locate
~/.govard/ssl/root.crt - Open browser certificate settings (e.g.,
chrome://settings/certificates) - Navigate to the Authorities tab → click Import
- Select
root.crtand mark it trusted for websites - Restart the browser
Once trusted, all *.test domains managed by Govard will show a "Green Lock" without further configuration.
govard domain add brand-b.test
govard domain remove brand-b.test
govard domain listGovard routes these domains through the same proxy and CA flow as the primary project domain.
By default, Govard projects are isolated. To allow one local PHP project to call another through the shared Caddy proxy, you must explicitly declare the dependency in your .govard.yml using the linked_projects field:
linked_projects:
- project-bWhen a project is linked:
-
Isolation by Default: Only projects explicitly linked will have their domains injected into the container's
/etc/hosts. -
Targeted Restarts: When
project-bstarts, Govard will refresh only the projects that depend on it (likeproject-a), ensuring minimal downtime. - Automatic Resolution: Listing a project name automatically maps its primary domain and all extra domains.
When ~/.govard/ssl/root.crt is present, Govard also mounts that Root CA into php and php-debug and refreshes the container trust store during govard env up / govard env restart, so TLS verification works from inside the runtime.
This host alias list is refreshed on govard env up. If connectivity issues persist after linking, run:
govard doctor trust
govard env restartFor Magento multi-site setups:
- Use
store_domainsto automatically route hostnames and set scoped base URLs - Use object entries (
type: websiteortype: store) for automaticMAGE_RUN_CODE/MAGE_RUN_TYPEinjection - Use
extra_domainsonly for additional hostnames not already instore_domains
store_domains:
brand-b.test:
code: brand_b
type: storeYou do not need manual SetEnvIf rules in .htaccess for the standard typed store_domains flow.
-
govard env uprenders the project stack and registers all routes -
govard env startandgovard env restartre-apply routes + local host entries after lifecycle changes - Govard injects known Govard project domains into PHP runtimes for container-to-container HTTP calls
- Caddy terminates HTTPS
- Caddy forwards traffic to the project web container
- Govard manages the local CA and exported root certificate
Check in this order:
govard svc up # Ensure global services are running
govard doctor trust # Re-import Root CA
ls ~/.govard/ssl/root.crt # Verify CA file existsIf still failing:
- Manually import
~/.govard/ssl/root.crtinto the browser - Install
certutil(Linux:sudo apt-get install libnss3-tools) - Restart the browser
Check:
-
.testresolver configuration (see DNS Configuration) -
govard svc upis running (includes the dnsmasq service)
govard svc up
resolvectl query myproject.testgovard env up
govard env logs
docker ps | grep caddygovard env restart # Re-applies proxy routes + local domain entriesgovard doctor trust
govard env restartThis re-exports the Govard Root CA, then recreates the PHP runtime with the CA mounted so curl, Composer, and other TLS clients trust *.test endpoints.
Govard — Go-based Versatile Runtime & Development
GitHub · Releases · Issues · MIT License
Developed with ❤️ by ddtcorex