shawn1m / overture

A customized DNS relay server
MIT License
1.79k stars 284 forks source link

auto reload config #236

Closed F-TD5X closed 4 years ago

F-TD5X commented 4 years ago

71

I can't wait LOL, so I tried to impletment it myself. I doesn't know more about Golang, so there might be some dirty code in this PR.

F-TD5X commented 4 years ago

Oh I forgot to rewatch changed file path. Hold on there.

shawn1m commented 4 years ago

Maybe it would be better only support something like "overture reloadconfig" and let the watcher outside ?

F-TD5X commented 4 years ago

You mean using some way to receive a overture reloadconfig signal? I don't know if golang has some cross platform way, or we have to open a port to do this communite.

shawn1m commented 4 years ago

Yeah, just like overture would like to offer some apis for configuration change requests. File watcher is too heavy for an application software I suppose.

F-TD5X commented 4 years ago

npipe and winio cause unknown bugs on my windows vm, I gave up IPC, and use http to serve /reload request.

codecov[bot] commented 4 years ago

Codecov Report

Merging #236 into master will increase coverage by 0.15%. The diff coverage is 88.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   49.69%   49.84%   +0.15%     
==========================================
  Files          10       13       +3     
  Lines         489      660     +171     
==========================================
+ Hits          243      329      +86     
- Misses        200      283      +83     
- Partials       46       48       +2     
Impacted Files Coverage Δ
core/outbound/dispatcher.go 57.29% <0.00%> (ø)
main/main.go 0.00% <0.00%> (ø)
core/common/ipset.go 92.94% <92.94%> (ø)
core/common/common.go 17.94% <100.00%> (ø)
core/common/edns.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f51edc8...49bdf68. Read the comment docs.

F-TD5X commented 4 years ago

sorry for delay for I have not received notificate email...

shawn1m commented 4 years ago

Merged. Thanks!