Skip to content
Snippets Groups Projects
  • Jean-Paul Calderone's avatar
    0eee7f76
    Read the VPN server IP address from the monitoring node config · 0eee7f76
    Jean-Paul Calderone authored
    morph offers an auto-passed `nodes` parameter from which we can read all of
    the nodes in the morph "network".  We can dig around in this to find the
    monitoring node and then read its configured IP address.
    
    It may be worth noting that this address appears in at least two places in the
    configuration.  It appears in our "input" configuration which grid.nix
    defines.  This change reads it from there.  We also have a NixOS module
    `nixos/modules/monitoring/vpn/server.nix` which reads this "input" and uses it
    to configure `networking.wireguard.interfaces.monitoringvpn`.  This is fed
    onwards to <nixos> to generate actual system configuration.
    
    It seems better to use the former than the latter because we have more direct
    control over it and if we consider the whole configuration system a function
    then it is more like an argument we are supplying rather than an obscure
    implementation detail.
    0eee7f76
    History
    Read the VPN server IP address from the monitoring node config
    Jean-Paul Calderone authored
    morph offers an auto-passed `nodes` parameter from which we can read all of
    the nodes in the morph "network".  We can dig around in this to find the
    monitoring node and then read its configured IP address.
    
    It may be worth noting that this address appears in at least two places in the
    configuration.  It appears in our "input" configuration which grid.nix
    defines.  This change reads it from there.  We also have a NixOS module
    `nixos/modules/monitoring/vpn/server.nix` which reads this "input" and uses it
    to configure `networking.wireguard.interfaces.monitoringvpn`.  This is fed
    onwards to <nixos> to generate actual system configuration.
    
    It seems better to use the former than the latter because we have more direct
    control over it and if we consider the whole configuration system a function
    then it is more like an argument we are supplying rather than an obscure
    implementation detail.