cleanup code warnings, update RaspberryPi readme

This commit is contained in:
Christoph Haas
2022-11-11 18:17:38 +01:00
parent bda8c9a3d1
commit 51fb9b4139
10 changed files with 34 additions and 31 deletions

View File

@@ -4,8 +4,8 @@ import (
"context"
"encoding/gob"
"html/template"
"io"
"io/fs"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
@@ -110,7 +110,7 @@ func (s *Server) Setup(ctx context.Context) error {
// Setup http server
gin.SetMode(gin.DebugMode)
gin.DefaultWriter = ioutil.Discard
gin.DefaultWriter = io.Discard
s.server = gin.New()
if logrus.GetLevel() == logrus.TraceLevel {
s.server.Use(ginlogrus.Logger(logrus.StandardLogger()))

View File

@@ -4,7 +4,7 @@ import (
"context"
"crypto/md5"
"fmt"
"io/ioutil"
"os"
"path"
"syscall"
"time"
@@ -224,7 +224,7 @@ func (s *Server) WriteWireGuardConfigFile(device string) error {
return errors.WithMessage(err, "failed to get config file")
}
filePath := path.Join(s.config.WG.ConfigDirectoryPath, dev.DeviceName+".conf")
if err := ioutil.WriteFile(filePath, cfg, 0644); err != nil {
if err := os.WriteFile(filePath, cfg, 0644); err != nil {
return errors.Wrap(err, "failed to write WireGuard config file")
}
return nil