Dan Fuhry [Thu, 6 Nov 2025 11:49:53 +0000 (06:49 -0500)]
[http] live reload, SNI proxying, bugfixes
- Initial backend live reload support, to be enabled in binary with merge of ephs/config_watcher
- Fix SNI listener closure upon single connection TLS handshake error
- added readme, because this is seriously getting too complicated for me to configure from memory
- refactored connection acceptance with a new `net.Listener` implementation that supports SNI, with virtual listeners that can be used with `http.Server`
- foundations laid for bare-TCP SNI proxying too, but implementation not started yet
- added `healthcheck` action
- added a mutable request context at the logging middleware level, to bubble up request data to the logger
- propagate SAML authorization state to global request context
- SAML action now skips if request was previously authorized
- got multiple listeners + multiple vhosts per listener working
To detect changes to the contents of /mnt/file using inotify instead of polling file contents, we need to detect when /mnt/..data is overwritten.
This requires complex symlink detection and resolution for not only the file but any of the directories in its path, and tracking of final absolute path and inode number to detect when the file was swapped with a different one.
This commit adds that support to fsnotify, along with lots of documentation and tests.
Dan Fuhry [Thu, 15 May 2025 14:39:24 +0000 (10:39 -0400)]
refactor MetricBusService to an interface
D-Bus metricbus server is being deprecated and being replaced with an https server that registers itself in sd and publishes its own stats.
This is the first step in the refactor, converting `MetricBusService` to an interface and updating all references accordingly. Full implementation will come later.
Dan Fuhry [Tue, 8 Apr 2025 21:59:26 +0000 (17:59 -0400)]
[http/saml] cookie bugfixes
- strip auth cookies before forwarding to origin
- when no session, send 401 instead of redirect for CORS and websocket requests
- delete unused relaystate cookies
Dan Fuhry [Sat, 29 Mar 2025 03:38:07 +0000 (23:38 -0400)]
Fine let's just make it a full HTTP proxy
Refactor samlproxy into a general purpose proxy with pluggable actions. Add S3 bucket serving backend. Route actions can fulfill the request or modify it and call next(), basically the same idea as coredns but for http.
Dan Fuhry [Sat, 22 Mar 2025 01:26:52 +0000 (21:26 -0400)]
machines bugfixes
- handle interface:deleted and host:deleted events
- coredns plugin: only call tryInit if we fail to load the saved state from disk
- coredns plugin: make all hostname lookups case insensitive
- coredns plugin: fix <interface>.<host>.<domain> lookups
- coredns plugin: bump init ticker interval to 10 seconds
- coredns plugin: tighten lock window when updating registry from API
- coredns plugin: increase verbosity level of some really noisy log messages
- tweak mqtt startup
- fix `allow/deny unknown-clients` being added to dhcp subnets with only one range
- add captive portal service in openbsd, fix maclist template
Dan Fuhry [Fri, 25 Oct 2024 15:46:00 +0000 (11:46 -0400)]
[mtls] Support service identity from cert-manager-csi-driver-spiffe
K8s support, commit 3 of 3.
Check the default mount location of `cert-manager-csi-driver-spiffe` for service certificate discovery. Support default and certbot file naming schemes.
Dan Fuhry [Fri, 25 Oct 2024 15:43:29 +0000 (11:43 -0400)]
[sd] add SRVHost option
Kubernetes support, commit 2 of 3: publish `pod-name.service.<SDDomain>` as the name in the SRV record when Kubernetes is detected. Preserve legacy behavior by defaulting to `AdvertiseHost` if configured, or our FQDN if not.
Dan Fuhry [Fri, 25 Oct 2024 15:34:43 +0000 (11:34 -0400)]
hostname: support /etc/hosts, /etc/resolv.conf; add container detection
Needed for Kubernetes compatibility.
Kubernetes doesn't publish DNS records for pods. So the runtime can no longer assume that A/AAAA records exist for the host.
As a first step we need to be able to detect the hostname and kubernetes domain name. K8s is pretty good about populating `/etc/hosts` and `/etc/resolv.conf`, so we parse those when k8s is detected.
Dan Fuhry [Fri, 13 Sep 2024 00:38:32 +0000 (20:38 -0400)]
utils/daemon: add new package
Add new "daemon" package to handle detaching on Linux and Unix systems.
Supports writing pid files, socket pair based startup messaging, and
systemd notification on Linux.
Dan Fuhry [Fri, 13 Sep 2024 00:17:37 +0000 (20:17 -0400)]
utils/hostname: handle special case of domain name = "(none)" on linux
Linux systems can return interesting values when the domain name is
unset, like "(none)" or an empty string. To handle these, hostname.go is
forked with special Hostname(), DomainName() and RegionName()
implementations for Linux and the original implementations for other
OSes.
Dan Fuhry [Fri, 26 Jul 2024 16:37:07 +0000 (12:37 -0400)]
dns_cache: bypass systemd-resolved
On Linux systems, the stub resolv.conf points at systemd-resolved which uses the hostsfile. We don't want this - we need the system's addresses as described by the network's DNS server.