Compare commits

...

18 Commits

Author SHA1 Message Date
6a46581c4f Merge pull request 'add email rotation regarding a limit' (#9) from rotate-email into develop
Reviewed-on: #9
Reviewed-by: wpetit <wpetit@cadoles.com>
2025-03-13 13:37:35 +01:00
0c23304d34 add email rotation regarding a limit 2025-03-13 13:33:51 +01:00
fcb56f9a7f Merge pull request 'render-html' (#8) from render-html into develop
Reviewed-on: #8
2025-03-13 09:37:43 +01:00
7c3e978b3a update package-lock 2025-03-13 09:14:18 +01:00
f777cf6d11 add allowed styles elements to render html 2025-03-13 09:14:10 +01:00
888ff2ec47 chore: generate tag before building docker image 2024-03-21 09:20:58 +01:00
040a9d0e46 feat: migrate project to cadoles org 2024-03-21 09:11:50 +01:00
4d2ca6bd3a chore: docker image release with new tagging scheme 2024-02-27 17:38:04 +01:00
805c873695 chore: update go dependencies 2024-02-27 17:26:32 +01:00
13d3991a10 Merge pull request 'fix(docker): image now builds' (#3) from fix/dockerfile into develop
Reviewed-on: wpetit/fake-smtp#3
2024-02-27 17:19:38 +01:00
4871876bf0 chore: use go run to exec modd 2024-02-27 17:19:16 +01:00
d47b819e1d feat(docker): use go 1.21 2024-02-27 17:14:25 +01:00
f7bff1b697 fix(docker): image now builds
adding non root user execution capabilities
2024-02-27 17:09:30 +01:00
1ce43d2c76 Merge pull request 'build(deps): bump nodejs to 20.x & update node modules' (#4) from upgrade_nodejs into develop
Reviewed-on: wpetit/fake-smtp#4
Reviewed-by: wpetit <wpetit@cadoles.com>
2024-02-27 17:06:16 +01:00
75213ebe6e build(deps): update node version 2024-02-27 15:50:00 +01:00
6a9c2fd13f build(deps): bump nodejs to 20.x & update node modules 2024-02-27 14:26:12 +01:00
19e15d3fe7 Fix docker build recipe 2022-11-22 15:18:28 -06:00
db0a3ac98f Trigger Nuonet mirror sync 2022-03-16 16:58:15 +01:00
34 changed files with 3046 additions and 6140 deletions

View File

@ -5,4 +5,5 @@
/bin /bin
/misc/docker/Dockerfile /misc/docker/Dockerfile
/.env /.env
/.env.dist /.env.dist
/tools

4
.gitignore vendored
View File

@ -3,4 +3,6 @@
/vendor /vendor
/bin /bin
/node_modules /node_modules
/.env /.env
/tools
.mktools/

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
v20.11.1

View File

@ -1,9 +1,20 @@
DOCKER_DATE_TAG := $(shell date +%Y%m%d%H%M) DOCKER_REPOSITORY ?= reg.cadoles.com/cadoles
YQ_VERSION ?= v4.30.4
YQ_BINARY ?= yq_linux_amd64
tools: tools/yq/bin/yq
tools/yq/bin/yq:
mkdir -p tools/yq/bin
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY} -O tools/yq/bin/yq &&\
chmod +x tools/yq/bin/yq
build: build:
CGO_ENABLED=0 go build -v -o bin/fake-smtp ./cmd/fake-smtp CGO_ENABLED=0 go build -v -o bin/fake-smtp ./cmd/fake-smtp
docker-image: docker-image:
git tag -a $(MKT_PROJECT_VERSION) -m "v$(MKT_PROJECT_VERSION)" || exit 0
docker build \ docker build \
--build-arg HTTP_PROXY=$(HTTP_PROXY) \ --build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg HTTPS_PROXY=$(HTTPS_PROXY) \ --build-arg HTTPS_PROXY=$(HTTPS_PROXY) \
@ -21,17 +32,20 @@ docker-run:
--tmpfs /app/data \ --tmpfs /app/data \
fake-smtp:latest fake-smtp:latest
docker-release: docker-release: .mktools
docker tag fake-smtp:latest bornholm/fake-smtp:latest docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION)
docker tag fake-smtp:latest bornholm/fake-smtp:$(DOCKER_DATE_TAG) docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION)
docker login docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest
docker push bornholm/fake-smtp:latest docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest
docker push bornholm/fake-smtp:$(DOCKER_DATE_TAG) docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION)
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION)
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest
docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest
test: test:
go test -v -race ./... go test -v -race ./...
release: dist release: dist tools
@./misc/script/release.sh @./misc/script/release.sh
dist: dist:
@ -41,7 +55,7 @@ tidy:
go mod tidy go mod tidy
watch: watch:
modd go run github.com/cortesi/modd/cmd/modd@v0.8.1
lint: lint:
golangci-lint run --enable-all golangci-lint run --enable-all
@ -55,4 +69,14 @@ clean:
rm -rf vendor rm -rf vendor
rm -rf bin rm -rf bin
.PHONY: mktools
mktools:
rm -rf .mktools
curl -q https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/install.sh | $(SHELL)
.mktools:
$(MAKE) mktools
-include .mktools/*.mk
.PHONY: lint watch build vendor tidy release .PHONY: lint watch build vendor tidy release

View File

@ -11,7 +11,7 @@ Serveur SMTP factice pour le développement avec interface web.
### Avec Docker ### Avec Docker
```bash ```bash
docker run -it --rm -p 8080:8080 -p 2525:2525 bornholm/fake-smtp docker run -it --rm -p 8080:8080 -p 2525:2525 reg.cadoles.com/cadoles/fake-smtp
``` ```
L'interface Web sera accessible à l'adresse http://localhost:8080/. L'interface Web sera accessible à l'adresse http://localhost:8080/.
@ -58,15 +58,15 @@ data:
# Configuration du relais SMTP # Configuration du relais SMTP
relay: relay:
enabled: false # Activer/désactiver le relais SMTP enabled: false # Activer/désactiver le relais SMTP
address: "" # Adresse du serveur au format "host:port" address: "" # Adresse du serveur au format "host:port"
identity: "" # Identité du compte utilisateur, peut être laissé vide identity: "" # Identité du compte utilisateur, peut être laissé vide
username: "" # Identifiant du compte SMTP, non utilisé sur anonymous = true username: "" # Identifiant du compte SMTP, non utilisé sur anonymous = true
password: "" # Mot de passe du compte SMTP, non utilisé sur anonymous = true password: "" # Mot de passe du compte SMTP, non utilisé sur anonymous = true
anonymous: false # Utiliser le mode d'authentification "anonyme" anonymous: false # Utiliser le mode d'authentification "anonyme"
useTLS: false # Utiliser TLS pour se connecter au serveur SMTP useTLS: false # Utiliser TLS pour se connecter au serveur SMTP
insecureSkipVerify: true # Ne pas vérifier le certificat du serveur pour les connexions TLS/STARTTLS insecureSkipVerify: true # Ne pas vérifier le certificat du serveur pour les connexions TLS/STARTTLS
fromOverride: "" # Surcharger l'adresse émetteur des courriels transmis fromOverride: "" # Surcharger l'adresse émetteur des courriels transmis
``` ```
### Variables d'environnement ### Variables d'environnement
@ -75,36 +75,37 @@ La configuration de FakeSMTP peut être personnalisée via des variables d'envir
Les valeurs des variables d'environnement surchargent les valeurs présentes dans le fichier de configuration. Les valeurs des variables d'environnement surchargent les valeurs présentes dans le fichier de configuration.
|Variable|Correspondance dans le fichier de configuration| | Variable | Correspondance dans le fichier de configuration |
|--------|-----------------------------------------------| | ------------------------------------- | ----------------------------------------------- |
|`FAKESMTP_HTTP_ADDRESS`|`http.address`| | `FAKESMTP_HTTP_ADDRESS` | `http.address` |
|`FAKESMTP_HTTP_TEMPLATEDIR`|`http.templateDir`| | `FAKESMTP_HTTP_TEMPLATEDIR` | `http.templateDir` |
|`FAKESMTP_HTTP_PUBLICDIR`|`http.publicDir`| | `FAKESMTP_HTTP_PUBLICDIR` | `http.publicDir` |
|`FAKESMTP_SMTP_ADDRESS`|`smtp.address`| | `FAKESMTP_SMTP_ADDRESS` | `smtp.address` |
|`FAKESMTP_SMTP_USERNAME`|`smtp.username`| | `FAKESMTP_SMTP_USERNAME` | `smtp.username` |
|`FAKESMTP_SMTP_PASSWORD`|`smtp.password`| | `FAKESMTP_SMTP_PASSWORD` | `smtp.password` |
|`FAKESMTP_SMTP_DOMAIN`|`smtp.domain`| | `FAKESMTP_SMTP_DOMAIN` | `smtp.domain` |
|`FAKESMTP_SMTP_READTIMEOUT`|`smtp.readTimeout`| | `FAKESMTP_SMTP_READTIMEOUT` | `smtp.readTimeout` |
|`FAKESMTP_SMTP_WRITETIMEOUT`|`smtp.writeTimeout`| | `FAKESMTP_SMTP_WRITETIMEOUT` | `smtp.writeTimeout` |
|`FAKESMTP_SMTP_MAXMESSAGEBYTES`|`smtp.maxMessageBytes`| | `FAKESMTP_SMTP_MAXMESSAGEBYTES` | `smtp.maxMessageBytes` |
|`FAKESMTP_SMTP_MAXRECIPIENTS`|`smtp.maxRecipients`| | `FAKESMTP_SMTP_MAXRECIPIENTS` | `smtp.maxRecipients` |
|`FAKESMTP_SMTP_ALLOWINSECUREAUTH`|`smtp.allowInsecureAuth`| | `FAKESMTP_SMTP_ALLOWINSECUREAUTH` | `smtp.allowInsecureAuth` |
|`FAKESMTP_SMTP_DEBUG`|`smtp.debug`| | `FAKESMTP_SMTP_DEBUG` | `smtp.debug` |
|`FAKESMTP_DATA_PATH`|`data.path`| | `FAKESMTP_DATA_MAX_EMAIL` | `data.maxEmail` |
|`FAKESMTP_RELAY_ENABLED`|`relay.enabled`| | `FAKESMTP_DATA_PATH` | `data.path` |
|`FAKESMTP_RELAY_ADDRESS`|`relay.address`| | `FAKESMTP_RELAY_ENABLED` | `relay.enabled` |
|`FAKESMTP_RELAY_IDENTITY`|`relay.identity`| | `FAKESMTP_RELAY_ADDRESS` | `relay.address` |
|`FAKESMTP_RELAY_USERNAME`|`relay.username`| | `FAKESMTP_RELAY_IDENTITY` | `relay.identity` |
|`FAKESMTP_RELAY_PASSWORD`|`relay.password`| | `FAKESMTP_RELAY_USERNAME` | `relay.username` |
|`FAKESMTP_RELAY_ANONYMOUS`|`relay.anonymous`| | `FAKESMTP_RELAY_PASSWORD` | `relay.password` |
|`FAKESMTP_RELAY_INSECURE_SKIP_VERIFY`|`relay.insecureSkipVerify`| | `FAKESMTP_RELAY_ANONYMOUS` | `relay.anonymous` |
|`FAKESMTP_RELAY_FROM_OVERRIDE`|`relay.fromOverride`| | `FAKESMTP_RELAY_INSECURE_SKIP_VERIFY` | `relay.insecureSkipVerify` |
| `FAKESMTP_RELAY_FROM_OVERRIDE` | `relay.fromOverride` |
## Démarrer avec les sources ## Démarrer avec les sources
### Dépendances ### Dépendances
- Go 1.13 - Go 1.21
- modd - modd
- make - make
- NodeJS/npm - NodeJS/npm
@ -128,4 +129,4 @@ make release
## Licence ## Licence
AGPL-3.0 AGPL-3.0

View File

@ -3,10 +3,10 @@ package main
import ( import (
"gitlab.com/wpetit/goweb/template/html" "gitlab.com/wpetit/goweb/template/html"
"forge.cadoles.com/wpetit/fake-smtp/internal/command" "forge.cadoles.com/Cadoles/fake-smtp/internal/command"
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"forge.cadoles.com/wpetit/fake-smtp/internal/query" "forge.cadoles.com/Cadoles/fake-smtp/internal/query"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/service" "gitlab.com/wpetit/goweb/service"
"gitlab.com/wpetit/goweb/service/build" "gitlab.com/wpetit/goweb/service/build"
@ -43,6 +43,11 @@ func getServiceContainer(conf *config.Config) (*service.Container, error) {
cqrs.CommandHandlerFunc(command.HandleStoreEmail), cqrs.CommandHandlerFunc(command.HandleStoreEmail),
) )
bus.RegisterCommand(
cqrs.MatchCommandRequest(&command.RotateEmailRequest{}),
cqrs.CommandHandlerFunc(command.HandleRotateEmail),
)
bus.RegisterCommand( bus.RegisterCommand(
cqrs.MatchCommandRequest(&command.ClearInboxRequest{}), cqrs.MatchCommandRequest(&command.ClearInboxRequest{}),
cqrs.CommandHandlerFunc(command.HandleClearInbox), cqrs.CommandHandlerFunc(command.HandleClearInbox),

View File

@ -3,9 +3,9 @@ package main
import ( import (
"net/http" "net/http"
"forge.cadoles.com/wpetit/fake-smtp/internal/route" "forge.cadoles.com/Cadoles/fake-smtp/internal/route"
"github.com/go-chi/chi" "github.com/go-chi/chi/v5"
"github.com/go-chi/chi/middleware" "github.com/go-chi/chi/v5/middleware"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"
"flag" "flag"
@ -14,11 +14,11 @@ import (
"os" "os"
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
//nolint: gochecknoglobals // nolint: gochecknoglobals
var ( var (
configFile = "" configFile = ""
workdir = "" workdir = ""
@ -33,7 +33,7 @@ var (
BuildDate = "unknown" BuildDate = "unknown"
) )
//nolint: gochecknoinits // nolint: gochecknoinits
func init() { func init() {
flag.StringVar(&configFile, "config", configFile, "configuration file") flag.StringVar(&configFile, "config", configFile, "configuration file")
flag.StringVar(&workdir, "workdir", workdir, "working directory") flag.StringVar(&workdir, "workdir", workdir, "working directory")

View File

@ -6,8 +6,8 @@ import (
"log" "log"
"os" "os"
"forge.cadoles.com/wpetit/fake-smtp/internal/command" "forge.cadoles.com/Cadoles/fake-smtp/internal/command"
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"github.com/emersion/go-smtp" "github.com/emersion/go-smtp"
"github.com/jhillyerd/enmime" "github.com/jhillyerd/enmime"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -92,6 +92,18 @@ func (s *Session) Data(r io.Reader) error {
} }
} }
if conf.Data.MaxEmail > 0 {
cmd := &command.RotateEmailRequest{
MaxEmail: conf.Data.MaxEmail,
}
if _, err := bus.Exec(s.ctx, cmd); err != nil {
logger.Error(s.ctx, "could not exec command", logger.E(err))
return errors.Wrapf(err, "could not exec '%T' command", cmd)
}
}
cmd := &command.StoreEmailRequest{ cmd := &command.StoreEmailRequest{
Envelope: env, Envelope: env,
} }

View File

@ -5,6 +5,6 @@
Date de construction: {{ .BuildInfo.BuildDate }} Date de construction: {{ .BuildInfo.BuildDate }}
</p> </p>
<p class="has-text-right is-size-7 has-text-grey"> <p class="has-text-right is-size-7 has-text-grey">
Propulsé par <a target="_blank" href="https://forge.cadoles.com/wpetit/fake-smtp">FakeSMTP</a> et publié sous licence <a href="https://www.gnu.org/licenses/agpl-3.0.txt">AGPL-3.0</a>. Propulsé par <a target="_blank" href="https://forge.cadoles.com/Cadoles/fake-smtp">FakeSMTP</a> et publié sous licence <a href="https://www.gnu.org/licenses/agpl-3.0.txt">AGPL-3.0</a>.
</p> </p>
{{end}} {{end}}

43
go.mod
View File

@ -1,19 +1,52 @@
module forge.cadoles.com/wpetit/fake-smtp module forge.cadoles.com/Cadoles/fake-smtp
go 1.14 go 1.21
require ( require (
github.com/asdine/storm/v3 v3.1.1 github.com/asdine/storm/v3 v3.1.1
github.com/caarlos0/env/v6 v6.2.1 github.com/caarlos0/env/v6 v6.2.1
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21
github.com/emersion/go-smtp v0.12.1 github.com/emersion/go-smtp v0.12.1
github.com/go-chi/chi v4.1.1+incompatible github.com/go-chi/chi/v5 v5.0.12
github.com/jhillyerd/enmime v0.8.0 github.com/jhillyerd/enmime v0.8.0
github.com/microcosm-cc/bluemonday v1.0.2 github.com/microcosm-cc/bluemonday v1.0.26
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
gitlab.com/wpetit/goweb v0.0.0-20200707070104-985ce3eba3c2 gitlab.com/wpetit/goweb v0.0.0-20200707070104-985ce3eba3c2
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 v2.2.8
) )
require (
cdr.dev/slog v1.3.0 // indirect
github.com/alecthomas/chroma v0.7.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/go-chi/chi v4.1.1+incompatible // indirect
github.com/go-playground/locales v0.12.1 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 // indirect
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/jaytaylor/html2text v0.0.0-20190408195923-01ec452cbe43 // indirect
github.com/leodido/go-urn v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/olekukonko/tablewriter v0.0.1 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
go.etcd.io/bbolt v1.3.4 // indirect
go.opencensus.io v0.22.2 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
gopkg.in/go-playground/validator.v9 v9.29.1 // indirect
)
// replace gitlab.com/wpetit/goweb => ../goweb // replace gitlab.com/wpetit/goweb => ../goweb

28
go.sum
View File

@ -36,6 +36,8 @@ github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkx
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/asdine/storm/v3 v3.1.1 h1:5ESJvmcNhQQOFcvpxkIHcZs7mp8Z6XGdBqEoAgf+11g= github.com/asdine/storm/v3 v3.1.1 h1:5ESJvmcNhQQOFcvpxkIHcZs7mp8Z6XGdBqEoAgf+11g=
github.com/asdine/storm/v3 v3.1.1/go.mod h1:LEpXwGt4pIqrE/XcTvCnZHT5MgZCV6Ub9q7yQzOFWr0= github.com/asdine/storm/v3 v3.1.1/go.mod h1:LEpXwGt4pIqrE/XcTvCnZHT5MgZCV6Ub9q7yQzOFWr0=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/caarlos0/env/v6 v6.2.1 h1:/bFpX1dg4TNioJjg7mrQaSrBoQvRfLUHNfXivdFbbEo= github.com/caarlos0/env/v6 v6.2.1 h1:/bFpX1dg4TNioJjg7mrQaSrBoQvRfLUHNfXivdFbbEo=
github.com/caarlos0/env/v6 v6.2.1/go.mod h1:3LpmfcAYCG6gCiSgDLaFR5Km1FRpPwFvBbRcjHar6Sw= github.com/caarlos0/env/v6 v6.2.1/go.mod h1:3LpmfcAYCG6gCiSgDLaFR5Km1FRpPwFvBbRcjHar6Sw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@ -63,6 +65,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/go-chi/chi v4.1.1+incompatible h1:MmTgB0R8Bt/jccxp+t6S/1VGIKdJw5J74CK/c9tTfA4= github.com/go-chi/chi v4.1.1+incompatible h1:MmTgB0R8Bt/jccxp+t6S/1VGIKdJw5J74CK/c9tTfA4=
github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
@ -72,7 +76,6 @@ github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBUjI5YA3iVeaZ9Tb5PxNrrIP1xs= github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBUjI5YA3iVeaZ9Tb5PxNrrIP1xs=
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE=
@ -101,6 +104,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gorilla/csrf v1.6.0/go.mod h1:7tSf8kmjNYr7IWDCYhd3U8Ck34iQ/Yw5CJu7bAkHEGI= github.com/gorilla/csrf v1.6.0/go.mod h1:7tSf8kmjNYr7IWDCYhd3U8Ck34iQ/Yw5CJu7bAkHEGI=
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
@ -131,8 +136,8 @@ github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGe
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E=
github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88= github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
@ -174,8 +179,9 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 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-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -196,7 +202,6 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@ -208,8 +213,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191105084925-a882066a44e0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191105084925-a882066a44e0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 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-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -231,12 +236,15 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

View File

@ -5,8 +5,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"
) )

View File

@ -5,8 +5,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"
) )

View File

@ -10,7 +10,7 @@ import (
"github.com/emersion/go-smtp" "github.com/emersion/go-smtp"
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"github.com/jhillyerd/enmime" "github.com/jhillyerd/enmime"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"

View File

@ -0,0 +1,44 @@
package command
import (
"context"
"forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"github.com/pkg/errors"
"gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container"
)
type RotateEmailRequest struct {
MaxEmail int
}
func HandleRotateEmail(ctx context.Context, cmd cqrs.Command) error {
req, ok := cmd.Request().(*RotateEmailRequest)
if !ok {
return cqrs.ErrUnexpectedRequest
}
ctn, err := container.From(ctx)
if err != nil {
return errors.Wrap(err, "could not retrieve service container")
}
db, err := storm.From(ctn)
if err != nil {
return errors.Wrap(err, "could not retrieve storm service")
}
emailCount, err := db.Select().Count(&model.Email{})
if err != nil {
return errors.Wrap(err, "could not count emails")
}
if emailCount >= req.MaxEmail {
var diff = emailCount - (req.MaxEmail - 1)
db.Select().OrderBy("ID").Limit(diff).Delete(&model.Email{})
}
return nil
}

View File

@ -6,8 +6,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"github.com/jhillyerd/enmime" "github.com/jhillyerd/enmime"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"

View File

@ -51,7 +51,8 @@ type RelayConfig struct {
} }
type DataConfig struct { type DataConfig struct {
Path string `yaml:"path" env:"FAKESMTP_DATA_PATH"` MaxEmail int `yaml:"maxEmail" env:"FAKESMTP_DATA_MAX_EMAIL"`
Path string `yaml:"path" env:"FAKESMTP_DATA_PATH"`
} }
// NewFromFile retrieves the configuration from the given file // NewFromFile retrieves the configuration from the given file
@ -103,7 +104,8 @@ func NewDefault() *Config {
Debug: true, Debug: true,
}, },
Data: DataConfig{ Data: DataConfig{
Path: "fakesmtp.db", MaxEmail: 0,
Path: "fakesmtp.db",
}, },
Relay: RelayConfig{ Relay: RelayConfig{
Enabled: false, Enabled: false,

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"time" "time"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -5,8 +5,8 @@ import (
"strings" "strings"
"time" "time"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
stormdb "github.com/asdine/storm/v3" stormdb "github.com/asdine/storm/v3"
"github.com/asdine/storm/v3/q" "github.com/asdine/storm/v3/q"
"github.com/pkg/errors" "github.com/pkg/errors"

View File

@ -3,8 +3,8 @@ package query
import ( import (
"context" "context"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"

View File

@ -3,8 +3,8 @@ package route
import ( import (
"net/http" "net/http"
"forge.cadoles.com/wpetit/fake-smtp/internal/query" "forge.cadoles.com/Cadoles/fake-smtp/internal/query"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/api" "gitlab.com/wpetit/goweb/api"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"

View File

@ -7,11 +7,11 @@ import (
"github.com/microcosm-cc/bluemonday" "github.com/microcosm-cc/bluemonday"
"forge.cadoles.com/wpetit/fake-smtp/internal/command" "forge.cadoles.com/Cadoles/fake-smtp/internal/command"
"forge.cadoles.com/wpetit/fake-smtp/internal/model" "forge.cadoles.com/Cadoles/fake-smtp/internal/model"
"forge.cadoles.com/wpetit/fake-smtp/internal/query" "forge.cadoles.com/Cadoles/fake-smtp/internal/query"
"forge.cadoles.com/wpetit/fake-smtp/internal/storm" "forge.cadoles.com/Cadoles/fake-smtp/internal/storm"
"github.com/go-chi/chi" "github.com/go-chi/chi/v5"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"
@ -81,6 +81,8 @@ func serveEmailHTMLContent(w http.ResponseWriter, r *http.Request) {
} }
policy := bluemonday.UGCPolicy() policy := bluemonday.UGCPolicy()
policy.AllowAttrs("style", "color", "bgcolor").OnElements("h1", "h2", "h3", "h4", "h5", "h6", "p", "ul", "ol", "li", "a", "br", "strong", "em", "i", "b", "u", "span", "div", "table", "thead", "tbody", "tr", "th", "td", "img")
sanitizedHTML := policy.Sanitize(email.HTML) sanitizedHTML := policy.Sanitize(email.HTML)
w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Type", "text/html")

View File

@ -6,8 +6,8 @@ import (
"strconv" "strconv"
"time" "time"
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"forge.cadoles.com/wpetit/fake-smtp/internal/query" "forge.cadoles.com/Cadoles/fake-smtp/internal/query"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/middleware/container" "gitlab.com/wpetit/goweb/middleware/container"
"gitlab.com/wpetit/goweb/service" "gitlab.com/wpetit/goweb/service"

View File

@ -3,8 +3,8 @@ package route
import ( import (
"net/http" "net/http"
"forge.cadoles.com/wpetit/fake-smtp/internal/command" "forge.cadoles.com/Cadoles/fake-smtp/internal/command"
"forge.cadoles.com/wpetit/fake-smtp/internal/query" "forge.cadoles.com/Cadoles/fake-smtp/internal/query"
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/wpetit/goweb/cqrs" "gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/logger" "gitlab.com/wpetit/goweb/logger"

View File

@ -1,9 +1,9 @@
package route package route
import ( import (
"forge.cadoles.com/wpetit/fake-smtp/internal/config" "forge.cadoles.com/Cadoles/fake-smtp/internal/config"
"github.com/go-chi/chi" "github.com/go-chi/chi/v5"
"gitlab.com/wpetit/goweb/static" "gitlab.com/wpetit/goweb/static"
) )

View File

@ -1,4 +1,4 @@
FROM golang:1.17 AS build FROM reg.cadoles.com/proxy_cache/library/golang:1.21 AS build
ARG HTTP_PROXY= ARG HTTP_PROXY=
ARG HTTPS_PROXY= ARG HTTPS_PROXY=
@ -7,28 +7,26 @@ ARG https_proxy=
RUN apt-get update && apt-get install -y build-essential git bash curl RUN apt-get update && apt-get install -y build-essential git bash curl
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs && apt-get install -y nodejs
COPY . /src COPY . /src
WORKDIR /src WORKDIR /src
RUN cp -f misc/docker/config-patch.yml misc/release/config-patch.yml RUN cp -f misc/docker/config-patch.txt misc/release/config-patch.txt \
&& npm ci \
RUN go get github.com/krishicks/yaml-patch/cmd/yaml-patch
RUN npm install \
&& make vendor \
&& echo "---" > ./misc/release/config-patch.yml \
&& make ARCH_TARGETS=amd64 release && make ARCH_TARGETS=amd64 release
FROM busybox FROM reg.cadoles.com/proxy_cache/library/busybox
RUN adduser -D -h /app fsmtp
COPY --from=build /src/release/fake-smtp-linux-amd64 /app COPY --from=build /src/release/fake-smtp-linux-amd64 /app
RUN chown -R fsmtp:fsmtp /app
EXPOSE 8080 2525
USER fsmtp
WORKDIR /app WORKDIR /app
RUN mkdir -p /app
CMD ["bin/fake-smtp", "--config", "config.yml"] CMD ["bin/fake-smtp", "--config", "config.yml"]

View File

@ -0,0 +1 @@
.smtp.debug = false

View File

@ -1,4 +0,0 @@
---
- op: replace
path: /smtp/debug
value: false

View File

@ -0,0 +1,3 @@
.data.path = "/var/lib/fake-smtp/data.db"
.smtp.address = "127.0.0.1:2525"
.smtp.debug = false

View File

@ -1,10 +0,0 @@
---
- op: replace
path: /data/path
value: /var/lib/fake-smtp/data.db
- op: replace
path: /smtp/address
value: 127.0.0.1:2525
- op: replace
path: /smtp/debug
value: false

View File

@ -73,13 +73,17 @@ function dump_default_conf {
local command=$1 local command=$1
local os=$2 local os=$2
local arch=$3 local arch=$3
local tmp_conf=$(mktemp)
local patched_conf=$(mktemp) local patched_conf=$(mktemp)
go run "$PROJECT_DIR/cmd/$command" -dump-config > "$tmp_conf" go run "$PROJECT_DIR/cmd/$command" -dump-config > "$patched_conf"
cat "$tmp_conf" | yaml-patch -o misc/release/config-patch.yml > "$patched_conf"
while IFS= read -r yq_cmd; do
echo "patching configuration with '$yq_cmd'..."
tools/yq/bin/yq -i "$yq_cmd" "$patched_conf"
done < misc/release/config-patch.txt
copy "$command" $os $arch "$patched_conf" "config.yml" copy "$command" $os $arch "$patched_conf" "config.yml"
rm -f "$tmp_conf" "$patched_conf" rm -f "$patched_conf"
} }
function compress { function compress {

8761
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,21 +11,21 @@
"author": "William Petit <wpetit@cadoles.com>", "author": "William Petit <wpetit@cadoles.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.2.0", "@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.2.1", "@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/preset-env": "^7.2.0", "@babel/preset-env": "^7.23.9",
"babel-loader": "^8.0.4", "babel-loader": "^9.1.3",
"bulma": "^0.8.2", "bulma": "^0.9.4",
"bulma-switch": "^2.0.0", "bulma-switch": "^2.0.4",
"css-loader": "^3.5.2", "css-loader": "^6.10.0",
"file-loader": "^6.0.0", "file-loader": "^6.2.0",
"mini-css-extract-plugin": "^0.9.0", "mini-css-extract-plugin": "^2.8.0",
"node-sass": "^4.14.1", "node-sass": "^9.0.0",
"resolve-url-loader": "^3.0.0", "resolve-url-loader": "^5.0.0",
"sass-loader": "^8.0.2", "sass-loader": "^14.1.1",
"stimulus": "^1.1.0", "stimulus": "^3.2.2",
"style-loader": "^1.1.4", "style-loader": "^3.3.4",
"webpack": "^4.25.0", "webpack": "^5.90.3",
"webpack-cli": "^3.1.2" "webpack-cli": "^5.1.4"
} }
} }

View File

@ -64,8 +64,8 @@ module.exports = {
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: "/css/[name].css", filename: "./css/[name].css",
chunkFilename: "/css/[id].css" chunkFilename: "./css/[id].css"
}) })
] ]
} }