Skip to main content

Module hosts

Module hosts 

Source
Expand description

Host-to-npub static mapping.

Provides a HostMap that resolves human-readable hostnames to Nostr public keys (npubs). Populated from two sources:

  1. Peer alias fields in the YAML configuration
  2. An operator-maintained hosts file (/etc/fips/hosts)

The DNS resolver checks the host map before falling back to direct npub resolution, enabling gateway.fips instead of npub1...xyz.fips.

Structs§

HostMap
Bidirectional hostname ↔ npub mapping table.
HostMapReloader
Tracks a hosts file and reloads it when the modification time changes.

Enums§

HostMapError
Errors from host map operations.

Constants§

DEFAULT_HOSTS_PATH
Default path for the FIPS hosts file.

Functions§

file_mtime
Return the modification time of a file, or None if it doesn’t exist or the metadata can’t be read.
validate_hostname
Validate a hostname for use as a FIPS DNS alias.