From e9709e54eefd46f1d37df5c484df7c6fdacaea7c Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Thu, 9 Dec 2021 20:51:07 +0530 Subject: [PATCH] Upgrade `labstack/echo` webserver to major version v4. - echo is now on v4 with major changes including a few breaking changes - bind() behaviour is now strict. JSON / form etc. unmarshalling of request data need appropriate `json`, `form` tags. Missing tags for the public subscription page is added in this commit. - This also closes #602. --- cmd/admin.go | 2 +- cmd/bounce.go | 2 +- cmd/campaigns.go | 2 +- cmd/handlers.go | 4 ++-- cmd/i18n.go | 2 +- cmd/import.go | 2 +- cmd/init.go | 2 +- cmd/lists.go | 2 +- cmd/media.go | 2 +- cmd/public.go | 2 +- cmd/settings.go | 2 +- cmd/subscribers.go | 2 +- cmd/templates.go | 2 +- frontend/src/views/Dashboard.vue | 2 +- go.mod | 16 +++++-------- go.sum | 40 ++++++++++++++++++++------------ models/models.go | 4 ++-- 17 files changed, 48 insertions(+), 42 deletions(-) diff --git a/cmd/admin.go b/cmd/admin.go index 618ae19..2736ff9 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -8,7 +8,7 @@ import ( "time" "github.com/jmoiron/sqlx/types" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type serverConfig struct { diff --git a/cmd/bounce.go b/cmd/bounce.go index ef638f7..2ce6179 100644 --- a/cmd/bounce.go +++ b/cmd/bounce.go @@ -9,7 +9,7 @@ import ( "time" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/lib/pq" ) diff --git a/cmd/campaigns.go b/cmd/campaigns.go index 81dc516..1bbfad3 100644 --- a/cmd/campaigns.go +++ b/cmd/campaigns.go @@ -16,7 +16,7 @@ import ( "github.com/gofrs/uuid" "github.com/jmoiron/sqlx" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/lib/pq" null "gopkg.in/volatiletech/null.v6" ) diff --git a/cmd/handlers.go b/cmd/handlers.go index d505deb..2cd7fa9 100644 --- a/cmd/handlers.go +++ b/cmd/handlers.go @@ -8,8 +8,8 @@ import ( "regexp" "strconv" - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" ) const ( diff --git a/cmd/i18n.go b/cmd/i18n.go index fc963d1..8b9dc74 100644 --- a/cmd/i18n.go +++ b/cmd/i18n.go @@ -8,7 +8,7 @@ import ( "github.com/knadh/listmonk/internal/i18n" "github.com/knadh/stuffbin" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type i18nLang struct { diff --git a/cmd/import.go b/cmd/import.go index a3fcf83..9663c77 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -9,7 +9,7 @@ import ( "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) // handleImportSubscribers handles the uploading and bulk importing of diff --git a/cmd/init.go b/cmd/init.go index 0596f04..8cd6d40 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -35,7 +35,7 @@ import ( "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/models" "github.com/knadh/stuffbin" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" flag "github.com/spf13/pflag" ) diff --git a/cmd/lists.go b/cmd/lists.go index 9fb957b..842d105 100644 --- a/cmd/lists.go +++ b/cmd/lists.go @@ -9,7 +9,7 @@ import ( "github.com/knadh/listmonk/models" "github.com/lib/pq" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type listsWrap struct { diff --git a/cmd/media.go b/cmd/media.go index b1c61bc..16b81a5 100644 --- a/cmd/media.go +++ b/cmd/media.go @@ -10,7 +10,7 @@ import ( "github.com/disintegration/imaging" "github.com/gofrs/uuid" "github.com/knadh/listmonk/internal/media" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) const ( diff --git a/cmd/public.go b/cmd/public.go index 09a2092..0a871c2 100644 --- a/cmd/public.go +++ b/cmd/public.go @@ -16,7 +16,7 @@ import ( "github.com/knadh/listmonk/internal/messenger" "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/lib/pq" ) diff --git a/cmd/settings.go b/cmd/settings.go index d7b5c81..323a09f 100644 --- a/cmd/settings.go +++ b/cmd/settings.go @@ -10,7 +10,7 @@ import ( "github.com/gofrs/uuid" "github.com/jmoiron/sqlx/types" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) type settings struct { diff --git a/cmd/subscribers.go b/cmd/subscribers.go index ccb95b9..4e25a9b 100644 --- a/cmd/subscribers.go +++ b/cmd/subscribers.go @@ -15,7 +15,7 @@ import ( "github.com/gofrs/uuid" "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" "github.com/lib/pq" ) diff --git a/cmd/templates.go b/cmd/templates.go index 8d5235c..111168f 100644 --- a/cmd/templates.go +++ b/cmd/templates.go @@ -8,7 +8,7 @@ import ( "strconv" "github.com/knadh/listmonk/models" - "github.com/labstack/echo" + "github.com/labstack/echo/v4" ) const ( diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index c15c9c3..d84068a 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -60,7 +60,7 @@