Commit Graph

35 Commits

Author SHA1 Message Date
Kwitsch debac9eaa8
Refactoring/linter (#1447)
* update golangci-lint to v1.57.2

* linter fixes
2024-04-12 16:44:50 -04:00
ThinkChaos 0a47eaad09 feat: add a unique ID (`req_id`) to all logs related to a request 2024-03-19 19:10:07 -04:00
ThinkChaos 4919ffac0d fix(server): use RCode=ServFail instead of HTTP 500 for internal errors
RFC 8484 Section 4.2.1:
> A successful HTTP response with a 2xx status code (see
> Section 6.3 of RFC7231) is used for any valid DNS response,
> regardless of the DNS response code.  For example, a successful 2xx
> HTTP status code is used even with a DNS message whose DNS response
> code indicates failure, such as SERVFAIL or NXDOMAIN.
https://www.rfc-editor.org/rfc/rfc8484#section-4.2.1
2024-03-19 19:10:07 -04:00
ThinkChaos b335887992 refactor(log): store log in context so it's automatically propagated 2024-03-19 19:10:07 -04:00
ThinkChaos f0ad412d8d refactor(server): add `resolve` for common query code
Ensure all queries go through that common code path so we always enable
compression, truncate if required, etc.
2024-01-18 10:46:54 -05:00
ThinkChaos e9a1e8974d feat(api): support client name lookup when querying via the API 2024-01-18 10:46:54 -05:00
ThinkChaos eae99ec550 refactor: make use of contexts in more places
- `CacheControl.FlushCaches`
- `Querier.Query`
- `Resolver.Resolve`

Besides all the API churn, this leads to `ParallelBestResolver`,
`StrictResolver` and `UpstreamResolver` simplification: timeouts only
need to be setup in one place, `UpstreamResolver`.

We also benefit from using HTTP request contexts, so if the client
closes the connection we stop processing on our side.
2023-11-21 12:21:35 -05:00
Dimitri Herzog d77f0ed54f
feat: add API endpoint to flush the DNS Cache (#1178) 2023-09-30 16:13:01 -04:00
Dimitri Herzog 72d747c16f
feat: API-first approach for REST interface (#1129)
* feat: embed OpenAPI definition file

* feat: use OpenAPI generated server and client

* feat: provide OpenAPI interface documentation

* chore(test): add additional tests
2023-09-09 19:30:55 +02:00
Dimitri Herzog 2c108dabb8 chore: change branch name to "main" (#744) 2023-03-07 17:25:04 +01:00
Dimitri Herzog bcea1a93db
fix: query command doesn't show the client IP (#861) (#914) 2023-03-07 14:23:23 +01:00
Kwitsch 9abeaeddea
Added gofumpt (#805)
* fix linter errors

* added gofumpt

* Makefile cleanup

* gofumpt run

* Update Makefile

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* go mod tidy

* fmt + lint

* go mod tidy

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
2022-12-26 22:11:45 +01:00
Dimitri Herzog 421807fc22
chore: update golangci-lint (#631) 2022-08-19 22:04:35 +02:00
Dimitri Herzog a903565cb0
set content-type header for HTTP endpoints (#581) 2022-06-29 22:36:54 +02:00
Peter Dave Hello 9693ee339e
chore: Rename securityHeader -> secureHeader (#553) 2022-06-03 22:43:31 +02:00
Peter Dave Hello a120aafcdd
Add HTTP Secure Headers on HTTPS server response (#545) 2022-06-02 16:42:23 +02:00
Dimitri Herzog a4b89537db
update golangci-lint (#510)
* update golangci-lint

* enable gomnd linter

* enable asciicheck linter

* enable bidichk linter

* enable durationcheck linter

* enable errchkjson linter

* enable errorlint linter

* enable exhaustive linter

* enable gomoddirectives linter

* enable gomodguard guard

* enable grouper linter

* enable grouper and ifshort linters

* enable importas linter

* enable makezero linter

* enable nestif linter

* enable nilerr linter

* enable nilnil linter

* enable nlreturn linter

* enable nolintlint linter

* enable predeclared linter

* enable sqlclosecheck linter

* enable tenv linter

* enable wastedassign linter
2022-05-10 09:09:50 +02:00
ThinkChaos 102d31e0f7
Change swagger URL to match blocky's version (#498) 2022-04-22 22:27:00 +02:00
ThinkChaos 62c7816ab3
Support of DoH/DoT as bootstrap DNS (#485) 2022-04-22 22:12:35 +02:00
Dimitri Herzog 7ea5ba4cac updated github.com/go-chi/chi 2021-12-24 23:04:47 +01:00
Dimitri Herzog 61ca25c64c sanitize log output 2021-12-20 22:37:32 +01:00
Dimitri Herzog 40e749abb5 DoH endpoints should also accept trailing slash 2021-10-21 22:38:58 +02:00
Dimitri Herzog a90fb5d1c2
Extract client name from the URL (DoH and DoT) (#317)
* Extract client name from the URL (DoH and DoT) #304

* improved tests
2021-10-13 22:47:14 +02:00
Dimitri Herzog ee8f041938 refactoring: generate enums 2021-09-11 21:31:03 +02:00
Dimitri Herzog 63735546bb moving model types to the separate package 2021-09-08 21:38:34 +02:00
Dimitri Herzog 919512959b use full-qualified name as module 2021-08-27 13:41:36 +02:00
Dimitri Herzog 301c8e4374 #236: Enable wire format compression to support Android 9 DoH 2021-07-27 22:15:47 +02:00
Joseph Harnish d8903bc9c5
#203: Added version to web interface. (#195)
* Added more data to template data, and push the version to server.go in the makefile

* moving version and build time to util package, added build time to the web interface

Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
2021-05-05 22:38:22 +02:00
Dimitri Herzog 19718629c1 #176: Use correct Base64 decoding to make DoH really work 2021-04-13 22:51:53 +02:00
Dimitri Herzog 8f23f47a6d Renamed function, replaced global variable with function call, Initialize global logger only once, minor refactorings, fixed failing tests 2021-02-25 23:36:39 +01:00
Dimitri Herzog b043849159 command package refactoring 2021-02-08 22:00:11 +01:00
Dimitri Herzog eac0387a5b changed branch to master 2021-01-17 21:48:30 +01:00
Dimitri Herzog 2f756b654b replaced swagger-ui with static version to reduce memory footprint 2021-01-08 22:12:55 +01:00
Dimitri Herzog d1b3b929e4 #67: consider request protocol TCP/UDP on calling external DNS (AXFR fails most times) 2020-06-21 22:38:04 +02:00
Dimitri Herzog 3bd80242e8
DoH server support (#61)
#17: DoH server support
2020-05-23 22:54:51 +02:00