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

DNS Proxy Server 3 #267

Closed
39 tasks done
mageddo opened this issue Jan 29, 2023 · 2 comments
Closed
39 tasks done

DNS Proxy Server 3 #267

mageddo opened this issue Jan 29, 2023 · 2 comments
Labels
feature Definition of a feature to be implemented
Milestone

Comments

@mageddo
Copy link
Owner

mageddo commented Jan 29, 2023

Acceptance Criteria

Re-Write all features current version of DPS in Java using GraalVM Native Image so I can be more productive and contribute more to this project.

Context

  • I'm really rust in Golang, spend 99% of time coding in Java so when I come to code at this project I have change the paradigm , remember about the build tool, libraries and all Go program language stuff, it's reducing my productivity in this project, I don't have much time to spend also.
  • I'm also having to pay a Goland idea license to be able to program in Go, this is the unique Go project I contribute to though
  • Different from 5 years ago, nowadays you can build a really nice binary program with a low memory footprint coding in java using GraalVM
  • GraalVM probably won't make DPS considerably less compatible with the use cases that it have today, as native image can generate binaries for arm, x86_x64, also supports linux, mac and windows.

Scope

The project will respect the following requirements

  • A strict remake: Implement all current features with the same behavior, possibly fixing known bugs, keeping the GUI, config files, API with the same actual contract being compatible with DPS 2
  • Stack
    • GraalVM 22.3
    • Java 17
  • Use the minimum of libraries and write the minimum of code as possible so the output binary program can be small, use a low memory footprint, also have more chances to be compatible of a larger set of hardware and SO environments
  • The frontend stack and code will remain the very same, this is just a backend refactoring
  • Use byte and short numeric types when possible to reduce memory usage [1]

Steps

The steps are defined in priority order

Basic Structure

  • Setup basic structure being able to compile a graalvm binary for linux x86_x64
  • Docker must be optional, DPS must be usable without docker features
  • Update the running it docs

DNS Server

Configure DNS server for future config of the following solvers

  • UDP
  • TCP

Fix incomplete DPS A response (Warning)

  • Done
nslookup -po=8053 host.docker 127.0.0.1
;; Warning: query response not set
Server:		127.0.0.1
Address:	127.0.0.1#8053

Non-authoritative answer:
Name:	host.docker
Address: 172.17.0.1
;; Warning: query response not set
Name:	host.docker
Address: 172.17.0.1

Docker Container Solving

  • Solve containers by its hostname or HOSTNAME env
  • DPS network feature, prefer to solve ips from DPS network when available
  • Support for dps.network customized network
  • Find hostname by container name or service name Config.registerContainerNames

Local DB Container Solving

  • Local DB Container Solving respect the current env
  • Automatically detects Entry type, when IP is set type=A, when target is set type=CNAME
  • Generate random id for env entry when it's null
  • CNAME Support

Internet Container Solving

  • Proxy queries and solve from remote server
  • Configurable multi remote servers

Solver Caching

  • Create a solver cache and configure for local db, docker and remote server.

System solver

  • Criar o system solver para resolver a variável Config.hostMachineHostname

Config

  • JSON Config
  • Command line / Flags Config
  • Environment Config
  • Logs, log file...
  • Criar network bridge quando Config.dpsNetwork = true, e quando Config.dpsNetworkAutoConnect = true criar e conectar todos os containers nessa bridge assim todos resolverao uma mesma network e poderao se comunicar

GUI Support

  • Create REST API respecting current contracts
  • Make a backup for the json when it suffer a version upgrade from 1 to 2

Auto Configure

Be able to automatically configure DPS as the default DNS Server in the current OS and restore previous server when it shutdown

Install as Service

#325

Manual Acceptance Tests

Windows

👋 Windows issues are being tracked on this issue #308

Linux

  • Creating a network while dps is running is crashing the server, the server wont log anything and will stay started but wont respond any query, connection refused will be got by the client, docker network create --attachable network3
    • couldn't reproduce anymore
  • When no default network names are found, must prioritize to use bridge network over overlay, also update this doc
  • Implement v1 api http://mageddo.github.io/dns-proxy-server/latest/en/api/
  • Remove quarkus logo
  • Timed out remote servers responses are being cached, it cant happen, when its a timeout cant cache but when the record really dont exists, like AAAA for bookmarks.mageddo.com must cache.
  • Must read conf from dps binary path not the current os path where dps was called
  • Log level not being respected, at least no when running in native image binary

Mac

...

Others

  • Delete v2 legacy version file
  • CI
  • CD
    • Linux amd64 + Docker Image
    • Linux aarch64 + Docker Image
    • Standard uber jar
@addshore
Copy link
Contributor

addshore commented Mar 1, 2023

Just wanted to say thanks for spending the time on this
The e2e tests on the application I use the dns-proxy-server on all pass with v3 now, and the next release will use v3!
https://gitlab.wikimedia.org/repos/releng/cli/-/merge_requests/330

@mageddo
Copy link
Owner Author

mageddo commented Mar 2, 2023

You're welcome @addshore, thanks for helping with the acceptance tests

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
Projects
None yet
Development

No branches or pull requests

2 participants