diff --git a/.dockerignore b/.dockerignore index e4adc91..356433f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,5 @@ /bin /misc/docker/Dockerfile /.env -/.env.dist \ No newline at end of file +/.env.dist +/tools \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2a576f4..ddcc7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /vendor /bin /node_modules -/.env \ No newline at end of file +/.env +/tools \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..158c006 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.16.0 diff --git a/Makefile b/Makefile index 9c222f3..8d1422f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,14 @@ -DOCKER_DATE_TAG := $(shell date +%Y%m%d%H%M) +DOCKER_DATE_TAG := $(shell date --utc +%Y.%-m.%-d%-H%-M) + +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: CGO_ENABLED=0 go build -v -o bin/fake-smtp ./cmd/fake-smtp @@ -31,7 +41,7 @@ docker-release: test: go test -v -race ./... -release: dist +release: dist tools @./misc/script/release.sh dist: diff --git a/cmd/fake-smtp/template/blocks/base.html.tmpl b/cmd/fake-smtp/template/blocks/base.html.tmpl index 343bd13..c9f6ff9 100644 --- a/cmd/fake-smtp/template/blocks/base.html.tmpl +++ b/cmd/fake-smtp/template/blocks/base.html.tmpl @@ -6,10 +6,10 @@ {{block "title" . -}}{{- end}} {{- block "head_style" . -}} - + {{end}} {{- block "head_script" . -}} - + {{end}} diff --git a/cmd/fake-smtp/template/blocks/header.html.tmpl b/cmd/fake-smtp/template/blocks/header.html.tmpl index f5dd99a..ae95018 100644 --- a/cmd/fake-smtp/template/blocks/header.html.tmpl +++ b/cmd/fake-smtp/template/blocks/header.html.tmpl @@ -2,7 +2,7 @@

- + {{if or .Emails .Email}} 📬 {{else}} diff --git a/cmd/fake-smtp/template/layouts/email.html.tmpl b/cmd/fake-smtp/template/layouts/email.html.tmpl index 43dfdb9..cdae08e 100644 --- a/cmd/fake-smtp/template/layouts/email.html.tmpl +++ b/cmd/fake-smtp/template/layouts/email.html.tmpl @@ -2,9 +2,9 @@ {{define "header_buttons"}} {{end}} @@ -24,8 +24,9 @@

Attachments ({{len .Email.Attachments}})

@@ -44,7 +45,7 @@ data-controller="iframe" data-action="load->iframe#onLoad" style="width:100%;{{if not .Email.HTML}}display:none;{{end}}" - src="{{ .Email.ID }}/html"> + src="{{ .BaseURL }}/emails/{{ .Email.ID }}/html">
{{ .Email.Text }}
diff --git a/cmd/fake-smtp/template/layouts/inbox.html.tmpl b/cmd/fake-smtp/template/layouts/inbox.html.tmpl index 4e4a3e9..6264eea 100644 --- a/cmd/fake-smtp/template/layouts/inbox.html.tmpl +++ b/cmd/fake-smtp/template/layouts/inbox.html.tmpl @@ -2,7 +2,7 @@ {{define "header_buttons"}}