Upgrade dependencies, refers to #119

This commit is contained in:
Quentin McGaw
2020-11-25 14:27:04 +00:00
parent b775798b65
commit 701ae125bf
7 changed files with 12 additions and 12 deletions

View File

@@ -65,7 +65,6 @@ ENV \
# Other # Other
LOG_ENCODING=console \ LOG_ENCODING=console \
LOG_LEVEL=info \ LOG_LEVEL=info \
NODE_ID=-1 \
GOTIFY_URL= \ GOTIFY_URL= \
GOTIFY_TOKEN= \ GOTIFY_TOKEN= \
TZ= TZ=

View File

@@ -251,7 +251,6 @@ DonDominio:
| `BACKUP_DIRECTORY` | `/updater/data` | Directory to write backup zip files to if `BACKUP_PERIOD` is not `0`. | `BACKUP_DIRECTORY` | `/updater/data` | Directory to write backup zip files to if `BACKUP_PERIOD` is not `0`.
| `LOG_ENCODING` | `console` | Format of logging, `json` or `console` | | `LOG_ENCODING` | `console` | Format of logging, `json` or `console` |
| `LOG_LEVEL` | `info` | Level of logging, `info`, `warning` or `error` | | `LOG_LEVEL` | `info` | Level of logging, `info`, `warning` or `error` |
| `NODE_ID` | `-1` | Node ID (for distributed systems), can be any integer |
| `GOTIFY_URL` | | (optional) HTTP(s) URL to your Gotify server | | `GOTIFY_URL` | | (optional) HTTP(s) URL to your Gotify server |
| `GOTIFY_TOKEN` | | (optional) Token to access your Gotify server | | `GOTIFY_TOKEN` | | (optional) Token to access your Gotify server |
| `TZ` | | Timezone to have accurate times, i.e. `America/Montreal` | | `TZ` | | Timezone to have accurate times, i.e. `America/Montreal` |

View File

@@ -41,7 +41,7 @@ type allParams struct {
ipv6Method models.IPMethod ipv6Method models.IPMethod
dir string dir string
dataDir string dataDir string
listeningPort string listeningPort uint16
rootURL string rootURL string
backupPeriod time.Duration backupPeriod time.Duration
backupDirectory string backupDirectory string
@@ -150,7 +150,8 @@ func _main(ctx context.Context, timeNow func() time.Time) int {
serverErrors := make(chan []error) serverErrors := make(chan []error)
go func() { go func() {
serverErrors <- server.RunServers(ctx, serverErrors <- server.RunServers(ctx,
server.Settings{Name: "production", Addr: "0.0.0.0:" + p.listeningPort, Handler: productionHandlerFunc}, server.Settings{
Name: "production", Addr: fmt.Sprintf("0.0.0.0:%d", p.listeningPort), Handler: productionHandlerFunc},
server.Settings{Name: "healthcheck", Addr: "127.0.0.1:9999", Handler: healthcheckHandlerFunc}, server.Settings{Name: "healthcheck", Addr: "127.0.0.1:9999", Handler: healthcheckHandlerFunc},
) )
}() }()

View File

@@ -27,7 +27,6 @@ services:
# Other # Other
- LOG_ENCODING=console - LOG_ENCODING=console
- LOG_LEVEL=info - LOG_LEVEL=info
- NODE_ID=-1 # -1 to disable
- GOTIFY_URL= - GOTIFY_URL=
- GOTIFY_TOKEN= - GOTIFY_TOKEN=
restart: always restart: always

4
go.mod
View File

@@ -4,8 +4,8 @@ go 1.15
require ( require (
github.com/golang/mock v1.4.4 github.com/golang/mock v1.4.4
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.2
github.com/kyokomi/emoji v2.2.4+incompatible github.com/kyokomi/emoji v2.2.4+incompatible
github.com/qdm12/golibs v0.0.0-20201025160742-64d5ce9ce547 github.com/qdm12/golibs v0.0.0-20201104030322-31e88ae3c5bf
github.com/stretchr/testify v1.6.1 github.com/stretchr/testify v1.6.1
) )

6
go.sum
View File

@@ -47,6 +47,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gotify/go-api-client/v2 v2.0.4 h1:0w8skCr8aLBDKaQDg31LKKHUGF7rt7zdRpR+6cqIAlE= github.com/gotify/go-api-client/v2 v2.0.4 h1:0w8skCr8aLBDKaQDg31LKKHUGF7rt7zdRpR+6cqIAlE=
github.com/gotify/go-api-client/v2 v2.0.4/go.mod h1:VKiah/UK20bXsr0JObE1eBVLW44zbBouzjuri9iwjFU= github.com/gotify/go-api-client/v2 v2.0.4/go.mod h1:VKiah/UK20bXsr0JObE1eBVLW44zbBouzjuri9iwjFU=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
@@ -76,8 +78,8 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/qdm12/golibs v0.0.0-20201025160742-64d5ce9ce547 h1:mRUb4ytoylYxc72qTTLsLJwvDMx3Vz/oxN4zQRxef54= github.com/qdm12/golibs v0.0.0-20201104030322-31e88ae3c5bf h1:CRRZZqv0SELF12+8WuGPCJHCYsrWnLVcd6CBzCSY70o=
github.com/qdm12/golibs v0.0.0-20201025160742-64d5ce9ce547/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc= github.com/qdm12/golibs v0.0.0-20201104030322-31e88ae3c5bf/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

View File

@@ -34,7 +34,7 @@ type Reader interface {
GetDataDir(currentDir string) (string, error) GetDataDir(currentDir string) (string, error)
// Web UI // Web UI
GetListeningPort() (listeningPort, warning string, err error) GetListeningPort() (listeningPort uint16, warning string, err error)
GetRootURL() (rootURL string, err error) GetRootURL() (rootURL string, err error)
// Backup // Backup
@@ -72,8 +72,8 @@ func (r *reader) GetDataDir(currentDir string) (string, error) {
return r.envParams.GetEnv("DATADIR", libparams.Default(currentDir+"/data")) return r.envParams.GetEnv("DATADIR", libparams.Default(currentDir+"/data"))
} }
func (r *reader) GetListeningPort() (listeningPort, warning string, err error) { func (r *reader) GetListeningPort() (listeningPort uint16, warning string, err error) {
return r.envParams.GetListeningPort() return r.envParams.GetListeningPort("LISTENING_PORT")
} }
func (r *reader) GetLoggerConfig() (encoding logging.Encoding, level logging.Level, err error) { func (r *reader) GetLoggerConfig() (encoding logging.Encoding, level logging.Level, err error) {