Skip to content

Commit 28c7640

Browse files
committed
version bump v1.3.2
1 parent 92c6823 commit 28c7640

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
*.key
44
sdns
55
sdns.conf
6-
sdns_*
76
coverage.out
8-
blist_data
7+
bl
98
access.log
109
vendor

contrib/linux/sdns.conf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Config version, config and build versions can be different.
2-
version = "1.2.0"
2+
version = "1.3.2"
33

44
# Address to bind to for the DNS server
55
bind = ":53"
@@ -10,6 +10,9 @@ bind = ":53"
1010
# Address to bind to for the DNS-over-HTTPS server
1111
# binddoh = ":8053"
1212

13+
# Address to bind to for the DNS-over-QUIC server
14+
# binddoq = ":853"
15+
1316
# TLS certificate file
1417
# tlscertificate = "server.crt"
1518

@@ -129,6 +132,10 @@ expire = 600
129132
# Cache size (total records in cache)
130133
cachesize = 256000
131134

135+
# Cache prefetch before expire. Default threshold is 10%, 0 for disabled.
136+
# The threshold percent should be between 10% ~ 90%
137+
prefetch = 10
138+
132139
# Maximum iteration depth for a query
133140
maxdepth = 30
134141

contrib/linux/sdns.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Group=sdns
1111
LimitNOFILE=131072
1212
Restart=on-failure
1313
RestartSec=10
14-
Environment="SDNS_DEBUGNS=true"
15-
Environment="SDNS_PPROF=true"
14+
Environment="SDNS_DEBUGNS=false"
15+
Environment="SDNS_PPROF=false"
1616
WorkingDirectory=/var/lib/sdns
1717
ExecStart=/usr/bin/sdns --config=/etc/sdns.conf
1818
PermissionsStartOnly=true

sdns.go

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"fmt"
99
"os"
1010
"os/signal"
11-
"runtime"
11+
"runtime/debug"
1212
"syscall"
1313
"time"
1414

@@ -19,33 +19,37 @@ import (
1919
"github.com/semihalev/sdns/server"
2020
)
2121

22-
const version = "1.3.1-rc1"
22+
const version = "1.3.2"
2323

2424
var (
25-
flagcfgpath = flag.String("config", "sdns.conf", "location of the config file, if config file not found, a config will generate")
26-
flagprintver = flag.Bool("v", false, "show version information")
25+
flagcfgpath string
26+
flagprintver bool
2727

2828
cfg *config.Config
2929
)
3030

3131
func init() {
32-
runtime.GOMAXPROCS(runtime.NumCPU())
32+
flag.StringVar(&flagcfgpath, "config", "sdns.conf", "Location of the config file. If it doesn't exist, a new one will be generated.")
33+
flag.StringVar(&flagcfgpath, "c", "sdns.conf", "Location of the config file. If it doesn't exist, a new one will be generated.")
34+
35+
flag.BoolVar(&flagprintver, "version", false, "Show the version of the program.")
36+
flag.BoolVar(&flagprintver, "v", false, "Show the version of the program.")
3337

3438
flag.Usage = func() {
35-
fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS]\n\n", os.Args[0])
36-
fmt.Fprintln(os.Stderr, "Options:")
37-
flag.PrintDefaults()
38-
fmt.Fprintln(os.Stderr, "")
39-
fmt.Fprintln(os.Stderr, "Example:")
40-
fmt.Fprintf(os.Stderr, "%s -config=sdns.conf\n", os.Args[0])
41-
fmt.Fprintln(os.Stderr, "")
39+
fmt.Fprintf(os.Stderr, "Usage:\n sdns [OPTIONS]\n\n")
40+
fmt.Fprintf(os.Stderr, "Options:\n")
41+
fmt.Fprintf(os.Stderr, " -c, --config PATH\tLocation of the config file. If it doesn't exist, a new one will be generated.\n")
42+
fmt.Fprintf(os.Stderr, " -v, --version\t\tShow the version of the program.\n")
43+
fmt.Fprintf(os.Stderr, " -h, --help\t\tShow this message and exit.\n\n")
44+
fmt.Fprintf(os.Stderr, "Example:\n")
45+
fmt.Fprintf(os.Stderr, " sdns -c sdns.conf\n\n")
4246
}
4347
}
4448

4549
func setup() {
4650
var err error
4751

48-
if cfg, err = config.Load(*flagcfgpath, version); err != nil {
52+
if cfg, err = config.Load(flagcfgpath, version); err != nil {
4953
log.Crit("Config loading failed", "error", err.Error())
5054
}
5155

@@ -77,8 +81,9 @@ func run(ctx context.Context) *server.Server {
7781
func main() {
7882
flag.Parse()
7983

80-
if *flagprintver {
81-
println("SDNS v" + version)
84+
if flagprintver {
85+
buildInfo, _ := debug.ReadBuildInfo()
86+
fmt.Fprintf(os.Stderr, "SDNS v%s built with %s\n", version, buildInfo.GoVersion)
8287
os.Exit(0)
8388
}
8489

0 commit comments

Comments
 (0)