From e4d8286535b45cbe3d80b87cde19ebc40cc4d78f Mon Sep 17 00:00:00 2001 From: Karan Sharma Date: Wed, 29 Dec 2021 11:42:04 +0530 Subject: [PATCH 1/3] feat: Add timezone config in app container Adds `tzdata` in the `Dockerfile` of the app so that user can pass a `TZ` env variable to the container to configure their timezone information. --- Dockerfile | 2 +- docker-compose.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9077201c..fe95f307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk --no-cache add ca-certificates +RUN apk --no-cache add ca-certificates tzdata WORKDIR /listmonk COPY listmonk . COPY config.toml.sample config.toml diff --git a/docker-compose.yml b/docker-compose.yml index 8f09d3a1..2a22c431 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,8 @@ x-app-defaults: &app-defaults - "9000:9000" networks: - listmonk + environment: + - TZ=Etc/UTC x-db-defaults: &db-defaults image: postgres:13 From c003aec9c997c4697479b12da2b1adedf039234e Mon Sep 17 00:00:00 2001 From: Rohan Date: Wed, 29 Dec 2021 15:13:23 +0530 Subject: [PATCH 2/3] feat: switch from s3 POST to s3 put This commit switches simples3 from issuing a POST to a PUT. Ref #617 --- go.mod | 2 +- go.sum | 4 ++-- internal/media/providers/s3/s3.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e14ef013..fa9d7910 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pelletier/go-toml v1.9.4 // indirect - github.com/rhnvrm/simples3 v0.7.0 + github.com/rhnvrm/simples3 v0.8.0 github.com/spf13/cast v1.4.1 // indirect github.com/spf13/pflag v1.0.5 github.com/yuin/goldmark v1.4.1 diff --git a/go.sum b/go.sum index 4977c5ba..5d1801ce 100644 --- a/go.sum +++ b/go.sum @@ -142,8 +142,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= -github.com/rhnvrm/simples3 v0.7.0 h1:KSEuKw0eGC5vltLW8ChLvjko+aUr0HbGet+bZHdwfMo= -github.com/rhnvrm/simples3 v0.7.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rhnvrm/simples3 v0.8.0 h1:SAjJtsqObltKkejIGl3WgyySq2xdrfwZWXi6njFluuA= +github.com/rhnvrm/simples3 v0.8.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= diff --git a/internal/media/providers/s3/s3.go b/internal/media/providers/s3/s3.go index 12ee5971..42b5bb35 100644 --- a/internal/media/providers/s3/s3.go +++ b/internal/media/providers/s3/s3.go @@ -76,7 +76,7 @@ func (c *Client) Put(name string, cType string, file io.ReadSeeker) (string, err } // Upload. - if _, err := c.s3.FileUpload(p); err != nil { + if _, err := c.s3.FilePut(p); err != nil { return "", err } return name, nil From 73e6668d20620b1038822d41d636380ab5e98af0 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Tue, 4 Jan 2022 09:12:15 +0100 Subject: [PATCH 3/3] Add AutoHeadingID option to Markdown parser --- models/models.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/models.go b/models/models.go index a9f3f65b..40b93096 100644 --- a/models/models.go +++ b/models/models.go @@ -15,6 +15,7 @@ import ( "github.com/jmoiron/sqlx/types" "github.com/lib/pq" "github.com/yuin/goldmark" + "github.com/yuin/goldmark/parser" "github.com/yuin/goldmark/extension" "github.com/yuin/goldmark/renderer/html" null "gopkg.in/volatiletech/null.v6" @@ -261,6 +262,9 @@ type Bounce struct { // markdown is a global instance of Markdown parser and renderer. var markdown = goldmark.New( + goldmark.WithParserOptions( + parser.WithAutoHeadingID(), + ), goldmark.WithRendererOptions( html.WithXHTML(), html.WithUnsafe(),