yscialom / pinanas

Cloud services, safely hosted at home.
GNU General Public License v3.0
5 stars 1 forks source link

Auto discovery of network settings #47

Closed yscialom closed 2 years ago

yscialom commented 2 years ago

Upon configure.sh:

  1. If found, use pinanas.network.* settings;
  2. Else, use auto discovery to determine those values (from dhcp or system configuration);
  3. If 2. fails, use backup, hardcoded values.

List of settings:

    # MAC address of PiNana's host network card. Type: string. Example: "01:02:03:04:05:06".
    hmac: "01:02:03:04:05:06"
    # Desired IP address of PiNanas's host. Type: string. Example "192.168.0.1".
    ip: 192.168.0.1

    dhcp:
      # Base IP for the network. Type: string. Example: "192.168.0.0".
      base: 192.168.0.0

      # Network subnet mask. Type: string. Example: "255.255.255.0".
      subnet: 255.255.255.0

      # Network gateway. Type: string. Example: "192.168.0.254".
      gateway: 192.168.0.254

      range:
        # First (included) IP of clients inside the network. Type: string. Example: "192.168.0.16".
        start: 192.168.0.16

        # Last (included) IP of clients inside the network. Type: string. Example: "192.168.0.64".
        end: 192.168.0.64

    dns:
      # Upstream DNS servers. Type: list of strings. Example:
      # - 1.1.1.1
      # - 1.0.0.1
      upstreams:
        - 1.1.1.1
        - 1.0.0.1