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

Configuration File v3 #594

Open
mageddo opened this issue Nov 6, 2024 · 2 comments
Open

Configuration File v3 #594

mageddo opened this issue Nov 6, 2024 · 2 comments
Labels
feature Definition of a feature to be implemented feature-request Proposal of a new feature/behavior to be implemented, not reviewed by the repo authors yet

Comments

@mageddo
Copy link
Owner

mageddo commented Nov 6, 2024

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

  • Remove dataprovider.vo.ConfigJson, it's not necessary anymore as we have config.Config domain object.
  • Structure config.Config as proposed in section "New Modeling Propose"
  • 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
  • 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
    },
    "web": {
      "port": 5380
    },
    "protocol": "UDP_TCP",
    "noEntriesResponseCode": 3
  },
  "solver": {
    "remote": {
      "active": true,
      "dnsServers": [
        "8.8.8.8", "4.4.4.4:53"
      ],
      "circuitBreaker": {
        "name": "STATIC_THRESHOLD"
      }
    },
    "docker": {
      "registerContainerNames": false,
      "domain": "docker",
      "dpsNetwork": {
        "name": "dps",
        "autoCreate": false,
        "autoConnect": false
      },
      "networks": {
        "preferredNetworkNames": [
          "a", "b", "c"
        ]
      },
      "dockerDaemonUri": null
    },
    "system": {
      "hostMachineHostname": "host.docker",
      "hostMachineFallback": true
    },
    "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"
  }
}
@mageddo mageddo added the feature-request Proposal of a new feature/behavior to be implemented, not reviewed by the repo authors yet label Nov 6, 2024
@defung
Copy link
Contributor

defung commented Nov 7, 2024

I love the grouping, makes the configs more readable!

Curious, does solver.docker.networks.preferredNetworkNames make my feature request redundant?

Also, what's solver.docker.dpsNetwork? Does it make DPS only resolve IPs from the dps network?

@mageddo
Copy link
Owner Author

mageddo commented Nov 7, 2024

Curious, does solver.docker.networks.preferredNetworkNames make #595 redundant?

I'm considering #595 will be already implemented when this feature get done.

Also, what's solver.docker.dpsNetwork? Does it make DPS only resolve IPs from the dps network?

DPS Network and DPS Network Auto Connect features

@mageddo mageddo added the feature Definition of a feature to be implemented label Nov 7, 2024
@mageddo mageddo moved this to To Do in DNS Proxy Server Nov 7, 2024
@mageddo mageddo moved this from To Do to In progress in DNS Proxy Server Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Definition of a feature to be implemented feature-request Proposal of a new feature/behavior to be implemented, not reviewed by the repo authors yet
Projects
Status: In progress
Development

No branches or pull requests

2 participants