Skip to content

Configuration File v3 #594

Open
Open
@mageddo

Description

@mageddo

Summary & Motivation

  • After some features added, it's time to remodel and introduce a new version of the configuration file aiming a cleaner structure.
  • Proposed configuration below
  • Suggestions are welcome until: 2024-11-30

Goals

Description

Blocks:

Scope

  • Structure Domain Model config.Config as proposed in section "New Modeling Propose" 594: Structure Domain Model config.Config as proposed in section "New Modeling Propose" #614
  • Model a "single" (using factory, strategy design pattern) parser which is capable to convert JSON, YAML and ENV configs to config.Config
    • The parser must be dynamic
  • Create JSON v3 configuration
  • How can I remove ConfigJson Object and continue to manage env entries?
  • Only the terminal will stay with an dedicated mapper and receive new feature flags
  • JSON v2 and The Legacy Env will remain supported, will have a dedicated mapper but won't receive new flags, only the JSON v3 will

New Modeling Propose

I'm proposing the following model, JSON Configuration example, the same will be made for YAML, etc.

{
  "version": 3,
  "server": {
    "dns": {
      "port": 53,
      "noEntriesResponseCode": 3
    },
    "web": {
      "port": 5380
    },
    "protocol": "UDP_TCP"
  },
  "solver": {
    "remote": {
      "active": true,
      "dnsServers": [
        "8.8.8.8", "4.4.4.4:53"
      ],
      "circuitBreaker": {
        "name": "STATIC_THRESHOLD"
      }
    },
    "docker": {
      "registerContainerNames": false,
      "domain": "docker",
      "hostMachineFallback": true,
      "dpsNetwork": {
        "name": "dps",
        "autoCreate": false,
        "autoConnect": false
      },
      "networks": {
        "preferredNetworkNames": [
          "a", "b", "c"
        ]
      },
      "dockerDaemonUri": null
    },
    "system": {
      "hostMachineHostname": "host.docker"
    },
    "local": {
      "activeEnv": "",
      "envs": [
        {
          "name": "",
          "hostnames": [
            {
              "type": "A",
              "hostname": "github.com",
              "ip": "192.168.0.1",
              "ttl": 255
            }
          ]
        }
      ]
    },
    "stub": {
      "domainName": "stub"
    }
  },
  "defaultDns": {
    "active": true,
    "resolvConf": {
      "paths": "/host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf",
      "overrideNameServers": true
    }
  },
  "log": {
    "level": "DEBUG",
    "file": "console"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureDefinition of a feature to be implementedfeature-requestProposal of a new feature/behavior to be implemented, not reviewed by the repo authors yet

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions