Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new setting for configuring hostname #1664

Merged
merged 6 commits into from
Jul 29, 2021

Commits on Jul 28, 2021

  1. netdog: Switch to argh for argument parsing

    This removes the custom argument parsing logic in favor of using `argh`.
    `argh` makes it simpler to add additional subcommands that may or may
    not have their own arguments.
    zmrow committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    e76f8ba View commit details
    Browse the repository at this point in the history
  2. netdog: Add generate-hostname subcommand

    This adds a new subcommand `generate-hostname` that is meant to be used
    as a settings generator.  It will attempt to read the current IP from
    file and resolve it via DNS reverse lookup.  If the lookup is successful
    it is used, otherwise the IP is used with dots replaced by dashes to
    avoid any confusion from other software that may attempt to read it, e.g
    "1.2.3.4" will end up being hostname "ip-1-2-3-4".
    zmrow committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    ab3b3e6 View commit details
    Browse the repository at this point in the history
  3. netdog: Add set-hostname subcommand

    This adds a new subcommand `set-hostname` that sets the hostname for the
    system by writing it to `/proc/sys/kernel/hostname`
    zmrow committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    f6c9943 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2021

  1. Add hostname configurability with setting: settings.network.hostname

    This commit adds the ability to configure the hostname of the system via
    a new setting `settings.network.hostname`.  If the setting isn't
    populated, at boot time we use the settings generator `netdog
    generate-hostname` to populate it.  The generator attempts to resolve
    the current IP via reverse lookup, and if unsuccessful uses the IP to
    create a hostname in the format "ip-x-x-x-x".
    
    A new service `set-hostname` runs after `settings-applier` and writes
    the hostname to `/proc/sys/kernel/hostname` via `netdog set-hostname
    $HOSTNAME`.  The service unit file uses an env file that is a template
    using the setting `settings.network.hostname` to populate the $HOSTNAME
    variable.
    zmrow committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    5fe7fa5 View commit details
    Browse the repository at this point in the history
  2. Add migrations for settings.network.hostname

    This adds the migrations needed for `settings.network.hostname`, one for
    the setting, its service and configuration file, and one for the setting
    generator metadata.
    zmrow committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    9719b40 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bda731a View commit details
    Browse the repository at this point in the history