diff --git a/README.md b/README.md index f230e18..55538a5 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,5 @@ Environmental variables: - `SHORTEN_HOST` - hostname - `SHORTEN_BIND` - bind address (default: `127.0.0.1:4488`) -- `POSTGRES_URI` - lib/pq connection string (see [here](https://pkg.go.dev/github.com/lib/pq#section-documentation)) \ No newline at end of file +- `SHORTEN_MAIL` - optional email for support/abuse reports +- `POSTGRES_URI` - lib/pq connection string (see [here](https://pkg.go.dev/github.com/lib/pq#section-documentation)) diff --git a/index.html b/index.html index 54c8191..35f4676 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,7 @@ height: calc(100vh - 32px); justify-content: center; align-items: center; + font-family: sans-serif; } form { display: flex; @@ -31,10 +32,15 @@ font-size: 30px; } a { - font-family: sans-serif; color: #dddddd; text-decoration: none; } + footer { + width: 100vw; + position: absolute; + bottom: 10px; + text-align: center; + } @@ -45,5 +51,8 @@ {{ end }} +{{ if .mail }} + +{{ end }} diff --git a/main.go b/main.go index f0af4c2..2c645c8 100644 --- a/main.go +++ b/main.go @@ -195,6 +195,7 @@ func (h *Handler) GetCode(url string, ip string) (string, error) { func Render(wr http.ResponseWriter, data map[string]string) { wr.Header().Set("Content-Type", "text/html") data["host"] = os.Getenv("SHORTEN_HOST") + data["mail"] = os.Getenv("SHORTEN_MAIL") err := tmpl.Execute(wr, data) if err != nil { log.Println("error writing template:", err)