From 653544ef0ce63b5b8603d5206df866216cc6e03b Mon Sep 17 00:00:00 2001 From: "Heath E. Lord" Date: Thu, 11 Jan 2024 16:03:15 -0500 Subject: [PATCH 1/6] Changes to make building more flexible --- Dockerfile | 48 +++++++++++++++++++++++++---------- Makefile | 74 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 100 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e23f2f..a6da9b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,39 @@ -# copy build result to a centos base image to match other -# crunchy containers -FROM centos:7 -RUN mkdir /app -ADD ./pg_tileserv /app/ -ADD ./assets /app/assets +ARG GOLANG_VERSION +ARG TARGETARCH +ARG VERSION +ARG BASE_REGISTRY +ARG BASE_IMAGE +ARG PLATFORM +FROM --platform=${PLATFORM} golang:${GOLANG_VERSION}-alpine AS builder +LABEL stage=tileservbuilder +ARG TARGETARCH ARG VERSION -LABEL vendor="Crunchy Data" \ - url="https://crunchydata.com" \ - release="${VERSION}" \ - org.opencontainers.image.vendor="Crunchy Data" \ - os.version="7.7" +WORKDIR /app +COPY . ./ + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -v -ldflags "-s -w -X main.programVersion=${VERSION}" + +FROM --platform=${TARGETARCH} ${BASE_REGISTRY}/${BASE_IMAGE} AS inherited + +COPY --from=builder /app/pg_tileserv /app/ +COPY --from=builder /app/assets /app/assets + +VOLUME ["/config"] + +USER 1001 +EXPOSE 7800 + +WORKDIR /app +ENTRYPOINT ["/app/pg_tileserv"] +CMD [] + +FROM --platform=${PLATFORM} ${BASE_REGISTRY}/${BASE_IMAGE} AS local + +RUN mkdir /app +ADD ./pg_tileserv /app/ +ADD ./assets /app/assets VOLUME ["/config"] @@ -23,10 +45,10 @@ ENTRYPOINT ["/app/pg_tileserv"] CMD [] # To build -# make APPVERSION=1.0.2 clean build build-docker +# make APPVERSION=1.0.2 clean local-docker # To build using binaries from golang docker image -# make APPVERSION=1.0.2 clean bin-docker build-docker +# make APPVERSION=1.0.2 clean docker # To run # docker run -dt -e DATABASE_URL=postgres://user:pass@host/dbname -p 7800:7800 pramsey/pg_tileserv:1.0.2 diff --git a/Makefile b/Makefile index c36d39f..f7b4048 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,40 @@ +##VARIABLES - +## APPVERSION - Variable to set the version label +## GOVERSION - Defaults to 1.21.6 but can be overriden, uses alpine go container as base +## PROGRAM - Name of binary, pg_tileserv +## CONTAINER - prefix and name of the generated container +## CONFIG - config file to be used +## DATE - Date String used as alternate tag for generated containers +## BASE_REGISTRY - This is the registry to pull the base image from +## BASE_IMAGE - The base image to use for the final container +## TARGETARCH - The architecture the resulting image is based on and the binary is compiled for +## IMAGE_TAG - The container and tag to be applied to the container APPVERSION := latest -GOVERSION := 1.21 +GOVERSION := 1.21.6 PROGRAM := pg_tileserv CONFIG := config/$(PROGRAM).toml CONTAINER := pramsey/$(PROGRAM) DATE := $(shell date +%Y%m%d) +BASE_REGISTRY := registry.access.redhat.com +BASE_IMAGE := ubi8-micro +SYSTEMARCH = $(shell uname -i) + +ifeq ($(SYSTEMARCH), x86_64) +TARGETARCH := amd64 +PLATFORM=amd64 +else +TARGETARCH := arm64 +PLATFORM=arm64 +endif + +IMAGE_TAG = $(CONTAINER):$(APPVERSION)-$(TARGETARCH) RM = /bin/rm CP = /bin/cp MKDIR = /bin/mkdir -.PHONY: bin-docker build-docker build check clean docs install release test uninstall +.PHONY: bin-docker bin-for-docker docker build check clean docs install local-docker release test uninstall .DEFAULT_GOAL := help @@ -25,21 +49,51 @@ clean: ## This will clean all local build artifacts $(info Cleaning project...) @rm -f $(PROGRAM) @rm -rf docs/* - docker image prune --force + @docker image inspect $(CONTAINER):$(APPVERSION) >/dev/null 2>&1 && docker rmi -f $(CONTAINER):$(APPVERSION) $(CONTAINER):$(DATE) || echo -n "" docs: ## Generate docs @rm -rf docs/* && cd hugo && hugo && cd .. -build: $(GOFILES) ## Build a local binary using APPVERSION parameter or CI as default +build: $(PROGRAM) ## Build a local binary using APPVERSION parameter + +$(PROGRAM): $(GOFILES) go build -v -ldflags "-s -w -X main.programVersion=$(APPVERSION)" bin-docker: ## Build a local binary based off of a golang base docker image sudo docker run --rm -v "$(PWD)":/usr/src/myapp:z -w /usr/src/myapp golang:$(GOVERSION) make APPVERSION=$(APPVERSION) build -build-docker: $(PROGRAM) Dockerfile ## Generate a CentOS 7 container with APPVERSION tag, using binary from current environment - docker build -f Dockerfile --build-arg VERSION=$(APPVERSION) -t $(CONTAINER):$(APPVERSION) -t $(CONTAINER):$(DATE) . +bin-for-docker: $(GOFILES) ##Build a local binary using APPVERSION parameter or CI as default (to be used in docker image) +# to be used in docker the built binary needs the CGO_ENABLED=0 option + CGO_ENABLED=0 go build -v -ldflags "-s -w -X github.com/CrunchyData/pg_featureserv/conf.setVersion=$(APPVERSION)" + +docker-build: Dockerfile + docker build -f Dockerfile \ + --target $(BUILDTYPE) \ + --build-arg VERSION=$(APPVERSION) \ + --build-arg GOLANG_VERSION=$(GOVERSION) \ + --build-arg TARGETARCH=$(TARGETARCH) \ + --build-arg PLATFORM=$(PLATFORM) \ + --build-arg BASE_REGISTRY=$(BASE_REGISTRY) \ + --build-arg BASE_IMAGE=$(BASE_IMAGE) \ + --label vendor="Crunchy Data" \ + --label url="https://crunchydata.com" \ + --label release="${APPVERSION}" \ + --label org.opencontainers.image.vendor="Crunchy Data" \ + --label os.version="7.7" \ + -t $(IMAGE_TAG) -t $(CONTAINER):$(DATE) . + docker image prune --filter label=stage=tileservbuilder -f + +set-local: + $(eval BUILDTYPE = local) -release: clean docs build build-docker ## Generate the docs, a local build, and then uses the local build to generate a CentOS 7 container +set-inherited: + $(eval BUILDTYPE = inherited) + +local-docker: bin-for-docker Dockerfile set-local docker-build ## Generate a BASE_IMAGE container with APPVERSION tag, using a locally built binary + +docker: Dockerfile set-inherited docker-build ## Generate a BASE_IMAGE container with APPVERSION tag, using a binary built in an alpine golang build container + +release: clean docs $(PROGRAM) local-docker ## Generate the docs, a local build, and then uses the local build to generate a BASE_IMAGE container test: ## Run the tests locally go test -v @@ -47,7 +101,7 @@ test: ## Run the tests locally $(CONFIG): $(CONFIG).example sed 's/# AssetsPath/AssetsPath/' $< > $@ -install: $(PROGRAM) docs $(CONFIG) ## This will install the program locally +install: $(PROGRAM) docs $(CONFIG) ## This will install the program locally $(MKDIR) -p $(DESTDIR)/usr/bin $(MKDIR) -p $(DESTDIR)/usr/share/$(PROGRAM) $(MKDIR) -p $(DESTDIR)/etc @@ -64,6 +118,8 @@ uninstall: ## This will uninstall the program from your local system help: ## Prints this help message @echo "" @echo "" - @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/:.*##/:/' + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | fgrep -v : | sed -e 's/\\$$//' | sed -e 's/.*##//' + @echo "" + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | fgrep : | sed -e 's/\\$$//' | sed -e 's/:.*##/:/' @echo "" @echo "" From 0002b293f3a36105bd2f57815ef545ed4f427112 Mon Sep 17 00:00:00 2001 From: "Heath E. Lord" Date: Fri, 12 Jan 2024 09:52:22 -0500 Subject: [PATCH 2/6] Clean up and renaming of targets --- Dockerfile | 8 +++---- Makefile | 62 +++++++++++++++++++++++++++++------------------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6da9b0..662302a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ARG VERSION ARG BASE_REGISTRY ARG BASE_IMAGE ARG PLATFORM -FROM --platform=${PLATFORM} golang:${GOLANG_VERSION}-alpine AS builder +FROM --platform=${PLATFORM} docker.io/library/golang:${GOLANG_VERSION}-alpine AS builder LABEL stage=tileservbuilder ARG TARGETARCH @@ -15,7 +15,7 @@ COPY . ./ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -v -ldflags "-s -w -X main.programVersion=${VERSION}" -FROM --platform=${TARGETARCH} ${BASE_REGISTRY}/${BASE_IMAGE} AS inherited +FROM --platform=${TARGETARCH} ${BASE_REGISTRY}/${BASE_IMAGE} AS multi-stage COPY --from=builder /app/pg_tileserv /app/ COPY --from=builder /app/assets /app/assets @@ -45,10 +45,10 @@ ENTRYPOINT ["/app/pg_tileserv"] CMD [] # To build -# make APPVERSION=1.0.2 clean local-docker +# make APPVERSION=1.0.2 clean docker # To build using binaries from golang docker image -# make APPVERSION=1.0.2 clean docker +# make APPVERSION=1.0.2 clean multi-stage-docker # To run # docker run -dt -e DATABASE_URL=postgres://user:pass@host/dbname -p 7800:7800 pramsey/pg_tileserv:1.0.2 diff --git a/Makefile b/Makefile index f7b4048..533c3c4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -##VARIABLES - +##AVAILABLE BUILD OPTIONS - ## APPVERSION - Variable to set the version label ## GOVERSION - Defaults to 1.21.6 but can be overriden, uses alpine go container as base ## PROGRAM - Name of binary, pg_tileserv @@ -10,31 +10,31 @@ ## TARGETARCH - The architecture the resulting image is based on and the binary is compiled for ## IMAGE_TAG - The container and tag to be applied to the container -APPVERSION := latest -GOVERSION := 1.21.6 -PROGRAM := pg_tileserv -CONFIG := config/$(PROGRAM).toml -CONTAINER := pramsey/$(PROGRAM) -DATE := $(shell date +%Y%m%d) -BASE_REGISTRY := registry.access.redhat.com -BASE_IMAGE := ubi8-micro +APPVERSION ?= latest +GOVERSION ?= 1.21.6 +PROGRAM ?= pg_tileserv +CONFIG ?= config/$(PROGRAM).toml +CONTAINER ?= pramsey/$(PROGRAM) +DATE ?= $(shell date +%Y%m%d) +BASE_REGISTRY ?= registry.access.redhat.com +BASE_IMAGE ?= ubi8-micro SYSTEMARCH = $(shell uname -i) ifeq ($(SYSTEMARCH), x86_64) -TARGETARCH := amd64 +TARGETARCH ?= amd64 PLATFORM=amd64 else -TARGETARCH := arm64 +TARGETARCH ?= arm64 PLATFORM=arm64 endif -IMAGE_TAG = $(CONTAINER):$(APPVERSION)-$(TARGETARCH) +IMAGE_TAG ?= $(CONTAINER):$(APPVERSION)-$(TARGETARCH) RM = /bin/rm CP = /bin/cp MKDIR = /bin/mkdir -.PHONY: bin-docker bin-for-docker docker build check clean docs install local-docker release test uninstall +.PHONY: bin-docker bin-for-docker build build-docker check clean common-build docker docs install multi-stage-docker release set-local set-multi-stage test uninstall .DEFAULT_GOAL := help @@ -42,31 +42,31 @@ GOFILES := $(wildcard *.go) all: $(PROGRAM) -check: ## This checks the current version of Go installed locally +check: ## This checks the current version of Go installed locally @go version -clean: ## This will clean all local build artifacts +clean: ## This will clean all local build artifacts $(info Cleaning project...) @rm -f $(PROGRAM) @rm -rf docs/* @docker image inspect $(CONTAINER):$(APPVERSION) >/dev/null 2>&1 && docker rmi -f $(CONTAINER):$(APPVERSION) $(CONTAINER):$(DATE) || echo -n "" -docs: ## Generate docs +docs: ## Generate docs @rm -rf docs/* && cd hugo && hugo && cd .. -build: $(PROGRAM) ## Build a local binary using APPVERSION parameter +build: $(PROGRAM) ## Build a local binary using APPVERSION parameter $(PROGRAM): $(GOFILES) go build -v -ldflags "-s -w -X main.programVersion=$(APPVERSION)" -bin-docker: ## Build a local binary based off of a golang base docker image +bin-docker: ## Build a local binary based off of a golang base docker image sudo docker run --rm -v "$(PWD)":/usr/src/myapp:z -w /usr/src/myapp golang:$(GOVERSION) make APPVERSION=$(APPVERSION) build -bin-for-docker: $(GOFILES) ##Build a local binary using APPVERSION parameter or CI as default (to be used in docker image) +bin-for-docker: $(GOFILES) ## Build a local binary using APPVERSION parameter or CI as default (to be used in docker image) # to be used in docker the built binary needs the CGO_ENABLED=0 option CGO_ENABLED=0 go build -v -ldflags "-s -w -X github.com/CrunchyData/pg_featureserv/conf.setVersion=$(APPVERSION)" -docker-build: Dockerfile +build-common: Dockerfile docker build -f Dockerfile \ --target $(BUILDTYPE) \ --build-arg VERSION=$(APPVERSION) \ @@ -86,22 +86,25 @@ docker-build: Dockerfile set-local: $(eval BUILDTYPE = local) -set-inherited: - $(eval BUILDTYPE = inherited) +set-multi-stage: + $(eval BUILDTYPE = multi-stage) -local-docker: bin-for-docker Dockerfile set-local docker-build ## Generate a BASE_IMAGE container with APPVERSION tag, using a locally built binary +# This is just an alias to keep the existing targets available +docker-build: docker -docker: Dockerfile set-inherited docker-build ## Generate a BASE_IMAGE container with APPVERSION tag, using a binary built in an alpine golang build container +docker: bin-for-docker Dockerfile set-local build-common ## Generate a BASE_IMAGE container with APPVERSION tag, using a locally built binary -release: clean docs $(PROGRAM) local-docker ## Generate the docs, a local build, and then uses the local build to generate a BASE_IMAGE container +multi-stage-docker: Dockerfile set-multi-stage build-common ## Generate a BASE_IMAGE container with APPVERSION tag, using a binary built in an alpine golang build container -test: ## Run the tests locally +release: clean docs $(PROGRAM) local-docker ## Generate the docs, a local build, and then uses the local build to generate a BASE_IMAGE container + +test: ## Run the tests locally go test -v $(CONFIG): $(CONFIG).example sed 's/# AssetsPath/AssetsPath/' $< > $@ -install: $(PROGRAM) docs $(CONFIG) ## This will install the program locally +install: $(PROGRAM) docs $(CONFIG) ## This will install the program locally $(MKDIR) -p $(DESTDIR)/usr/bin $(MKDIR) -p $(DESTDIR)/usr/share/$(PROGRAM) $(MKDIR) -p $(DESTDIR)/etc @@ -110,16 +113,17 @@ install: $(PROGRAM) docs $(CONFIG) ## This will install the program locall $(CP) -r assets $(DESTDIR)/usr/share/$(PROGRAM)/assets $(CP) -r docs $(DESTDIR)/usr/share/$(PROGRAM)/docs -uninstall: ## This will uninstall the program from your local system +uninstall: ## This will uninstall the program from your local system $(RM) $(DESTDIR)/usr/bin/$(PROGRAM) $(RM) $(DESTDIR)/etc/$(PROGRAM).toml $(RM) -r $(DESTDIR)/usr/share/$(PROGRAM) -help: ## Prints this help message +help: ## Prints this help message @echo "" @echo "" @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | fgrep -v : | sed -e 's/\\$$//' | sed -e 's/.*##//' @echo "" + @echo "BUILD TARGETS:" @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | fgrep : | sed -e 's/\\$$//' | sed -e 's/:.*##/:/' @echo "" @echo "" From 52c33655a7cb7cea6d3818832aa7779c9f4d7b7f Mon Sep 17 00:00:00 2001 From: "Heath E. Lord" Date: Fri, 12 Jan 2024 11:15:43 -0500 Subject: [PATCH 3/6] Don't have docker target rely on PROGRAM anymore as it builds its own binary --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 533c3c4..aa36065 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ docker: bin-for-docker Dockerfile set-local build-common ## Generate multi-stage-docker: Dockerfile set-multi-stage build-common ## Generate a BASE_IMAGE container with APPVERSION tag, using a binary built in an alpine golang build container -release: clean docs $(PROGRAM) local-docker ## Generate the docs, a local build, and then uses the local build to generate a BASE_IMAGE container +release: clean docs docker ## Generate the docs, a local build, and then uses the local build to generate a BASE_IMAGE container test: ## Run the tests locally go test -v From 47903f95424f820cb7ba0fbf3fd9836d7b4aac92 Mon Sep 17 00:00:00 2001 From: David Youatt Date: Thu, 18 Jan 2024 11:45:29 -0800 Subject: [PATCH 4/6] Update Crunchy copyright notices to include 2024 (#204) * Update Copyright notices to include 2023 * update crunchy copyright ranges to include 2024 --- LICENSE.md | 2 +- cql/cql.go | 2 +- cql/cql_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 8ce5664..8d57ad6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2017 - 2023 Crunchy Data Solutions, Inc. + Copyright 2017 - 2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cql/cql.go b/cql/cql.go index dd931ee..c0c0082 100644 --- a/cql/cql.go +++ b/cql/cql.go @@ -1,7 +1,7 @@ package cql /* - Copyright 2019 - 2023 Crunchy Data Solutions, Inc. + Copyright 2019 - 2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cql/cql_test.go b/cql/cql_test.go index e0e1ca9..b7af915 100644 --- a/cql/cql_test.go +++ b/cql/cql_test.go @@ -1,7 +1,7 @@ package cql /* - Copyright 2019 - 2023 Crunchy Data Solutions, Inc. + Copyright 2019 - 2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From de1f096f2ec5c99b1d6c69b15b651cab73d11ff0 Mon Sep 17 00:00:00 2001 From: Melinda Minch Date: Thu, 18 Jan 2024 12:34:56 -0800 Subject: [PATCH 5/6] Configurable and very basic health check endpoint (#203) * Test show/hide preview functionality * Simple health check endpoint and tests --------- Co-authored-by: Eldan Goldenberg --- README.md | 4 +++ main.go | 16 +++++++++ main_test.go | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ util_test.go | 2 +- 4 files changed, 115 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index badd6a1..a1b4cf0 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,10 @@ After start-up you can connect to the server and explore the published tables an To disable the web interface, supply the run time flag `--no-preview` +## Health Check Endpoint + +In order to run the server in an orchestrated environment, like Docker, it can be useful to have a health check endpoint. This is `/health` by default, and returns a `200 OK` if the server is responding to requests. To use a custom URL for the health check endpoint, supply the run time flag `-e` and your path. This setting will respect the base path setting, so if you choose a base path of `/example` and a health check endpoint of `/foo`, your health check URL becomes `/example/foo`. + ## Layers List A list of layers is available in JSON at: diff --git a/main.go b/main.go index 808b96a..11f4ee5 100644 --- a/main.go +++ b/main.go @@ -100,6 +100,8 @@ func init() { viper.SetDefault("CoordinateSystem.Ymin", -20037508.3427892) viper.SetDefault("CoordinateSystem.Xmax", 20037508.3427892) viper.SetDefault("CoordinateSystem.Ymax", 20037508.3427892) + + viper.SetDefault("HealthEndpoint", "/health") } func main() { @@ -110,6 +112,7 @@ func main() { flagHelpOn := getopt.BoolLong("help", 'h', "display help output") flagVersionOn := getopt.BoolLong("version", 'v', "display version number") flagHidePreview := getopt.BoolLong("no-preview", 'n', "hide web interface") + flagHealthEndpoint := getopt.StringLong("health", 'e', "", "desired path to health endpoint, e.g. \"/health\"") getopt.Parse() if *flagHelpOn { @@ -145,6 +148,10 @@ func main() { viper.Set("ShowPreview", false) } + if *flagHealthEndpoint != "" { + viper.Set("HealthEndpoint", *flagHealthEndpoint) + } + // Report our status log.Infof("%s %s", programName, programVersion) log.Info("Run with --help parameter for commandline options") @@ -391,6 +398,13 @@ func requestTiles(w http.ResponseWriter, r *http.Request) error { return nil } +// A simple health check endpoint +func healthCheck(w http.ResponseWriter, r *http.Request) error { + w.WriteHeader(http.StatusOK) + w.Write([]byte("200 OK")) + return nil +} + /******************************************************************************/ // tileAppError is an optional error structure functions can return @@ -488,6 +502,8 @@ func tileRouter() *mux.Router { if viper.GetBool("EnableMetrics") { r.Handle("/metrics", promhttp.Handler()) } + + r.Handle(viper.GetString("HealthEndpoint"), tileAppHandler(healthCheck)).Methods(http.MethodGet) return r } diff --git a/main_test.go b/main_test.go index 59b3f7d..37c5d60 100644 --- a/main_test.go +++ b/main_test.go @@ -2,6 +2,7 @@ package main import ( "context" + "fmt" "net/http" "net/http/httptest" "os" @@ -27,6 +28,7 @@ func TestMain(m *testing.M) { sql := "CREATE EXTENSION IF NOT EXISTS postgis" _, err = db.Exec(context.Background(), sql) if err != nil { + fmt.Printf("Error creating extension: %s", err) os.Exit(1) } @@ -67,6 +69,98 @@ func TestBasePath(t *testing.T) { response := httptest.NewRecorder() r.ServeHTTP(response, request) assert.Equal(t, 200, response.Code, "OK response is expected") + + request, _ = http.NewRequest("GET", "/test/health", nil) + response = httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") } + // cleanup + viper.Set("BasePath", "/") +} + +// Test that the preview endpoints are hidden or shown according to the config +func TestShowPreview(t *testing.T) { + viper.Set("ShowPreview", true) + r := tileRouter() + request, _ := http.NewRequest("GET", "/index.json", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") + request, _ = http.NewRequest("GET", "/index.html", nil) + response = httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") +} + +// the current default behavior is to show the preview +func TestShowPreviewDefault(t *testing.T) { + r := tileRouter() + request, _ := http.NewRequest("GET", "/index.json", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") + request, _ = http.NewRequest("GET", "/index.html", nil) + response = httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") +} + +func TestHidePreview(t *testing.T) { + viper.Set("ShowPreview", false) + r := tileRouter() + request, _ := http.NewRequest("GET", "/index.json", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 404, response.Code, "Not Found response is expected") + request, _ = http.NewRequest("GET", "/index.html", nil) + response = httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 404, response.Code, "Not Found response is expected") + + // cleanup + viper.Set("ShowPreview", true) +} + +// Test that the health endpoint gives a 200 if the server is running +func TestHealth(t *testing.T) { + r := tileRouter() + request, _ := http.NewRequest("GET", "/health", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") + assert.Equal(t, "200 OK", string(response.Result().Status), "Response status should say ok") +} + +func TestHealthCustomUrl(t *testing.T) { + viper.Set("HealthEndpoint", "/testHealthABC") + r := tileRouter() + request, _ := http.NewRequest("GET", "/health", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 404, response.Code, "Not Found response is expected") + request, _ = http.NewRequest("GET", "/testHealthABC", nil) + response = httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") + assert.Equal(t, "200 OK", string(response.Result().Status), "Response status should say ok") + + // cleanup + viper.Set("HealthEndpoint", "/health") +} + +func TestHealthCustomUrlWithBasePath(t *testing.T) { + viper.Set("BasePath", "/foo") + viper.Set("HealthEndpoint", "/bar") + r := tileRouter() + request, _ := http.NewRequest("GET", "/foo/bar", nil) + response := httptest.NewRecorder() + r.ServeHTTP(response, request) + assert.Equal(t, 200, response.Code, "OK response is expected") + assert.Equal(t, "200 OK", string(response.Result().Status), "Response status should say ok") + + // cleanup + viper.Set("HealthEndpoint", "/health") + viper.Set("BasePath", "/") } diff --git a/util_test.go b/util_test.go index 1807158..0b39375 100644 --- a/util_test.go +++ b/util_test.go @@ -48,7 +48,7 @@ func TestMetrics(t *testing.T) { viper.Set("EnableMetrics", true) r := tileRouter() - request, _ := http.NewRequest("GET", "/test/metrics", nil) + request, _ := http.NewRequest("GET", "/metrics", nil) response := httptest.NewRecorder() r.ServeHTTP(response, request) assert.Equal(t, 200, response.Code, "OK response is expected") From 7afb9c56007ec3263beca111d06bee3bf2b792f4 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Thu, 18 Jan 2024 12:49:46 -0800 Subject: [PATCH 6/6] Bump version of crypto to 0.17, closes #199 --- go.mod | 14 ++------------ go.sum | 42 +++++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 7444847..a445404 100644 --- a/go.mod +++ b/go.mod @@ -24,11 +24,8 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/dgrijalva/jwt-go v3.2.1-0.20180308231308-06ea1031745c+incompatible // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.1.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.1 // indirect @@ -40,12 +37,10 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle v1.3.0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect - github.com/pelletier/go-toml v1.2.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect @@ -56,20 +51,15 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/image v0.14.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7f207b7..5f93102 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -68,7 +69,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.1-0.20180308231308-06ea1031745c+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -77,6 +77,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -85,8 +87,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -113,7 +115,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -126,6 +127,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -177,6 +180,7 @@ github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= @@ -211,18 +215,22 @@ github.com/jackc/puddle v1.3.0 h1:eHK/5clGOatcjX3oWGBO/MpxpbHzSwud5EWTSCI+MX0= github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -231,8 +239,6 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -243,11 +249,10 @@ github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/I github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/pborman/getopt/v2 v2.1.0 h1:eNfR+r+dWLdWmV8g5OlpyrTYHkhVNxHBdN2cCrJmOEA= github.com/pborman/getopt/v2 v2.1.0/go.mod h1:4NtW75ny4eBw9fO1bhtNdYTlZKYX5/tBLtsOpwKIKd0= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -263,6 +268,8 @@ github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGy github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -272,6 +279,7 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -284,7 +292,6 @@ github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= @@ -350,8 +357,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -366,7 +373,6 @@ golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8 golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -424,7 +430,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -492,8 +497,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -554,7 +559,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -563,7 +567,6 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -573,7 +576,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -663,16 +665,18 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=