Fix linter and umask setting
This commit is contained in:
parent
0d1ca5cad7
commit
f448431675
3
main.go
3
main.go
@ -4,7 +4,6 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/joohoi/acme-dns/pkg/acmedns"
|
||||
"github.com/joohoi/acme-dns/pkg/api"
|
||||
@ -15,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
syscall.Umask(0077)
|
||||
setUmask()
|
||||
configPtr := flag.String("c", "/etc/acme-dns/config.cfg", "config file location")
|
||||
flag.Parse()
|
||||
// Read global config
|
||||
|
||||
@ -250,7 +250,7 @@ func TestAuthoritative(t *testing.T) {
|
||||
func TestResolveTXT(t *testing.T) {
|
||||
iServer, db, _ := setupDNS()
|
||||
server := iServer.(*Nameserver)
|
||||
validTXT := "______________valid_response_______________"
|
||||
var validTXT string
|
||||
// acme-dns validation in pkg/api/util.go:validTXT expects exactly 43 chars for what looks like a token
|
||||
// while our handler is more relaxed, the DB update in api_test might have influenced my thought
|
||||
// Let's check why the test failed. Ah, "Received error from the server [REFUSED]"? No, "NXDOMAIN"?
|
||||
|
||||
9
umask_unix.go
Normal file
9
umask_unix.go
Normal file
@ -0,0 +1,9 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
|
||||
import "syscall"
|
||||
|
||||
func setUmask() {
|
||||
syscall.Umask(0077)
|
||||
}
|
||||
7
umask_windows.go
Normal file
7
umask_windows.go
Normal file
@ -0,0 +1,7 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
func setUmask() {
|
||||
// umask is not supported on Windows
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user