Repo with a simple http server with auth to serve my email.
Author: b (git@mail.blmayer.dev)
Date: Tue Aug 15 16:13:28 2023 -0300
Added web file
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2156535 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: deploy + +deploy: $(wildcard www/*.*) + scp $^ zero:inbox.dovel.email/ + +deploy-web: $(wildcard cmd/web/*.go) + GOARCH=arm GOARM=6 go build $^ + scp main zero:dovel-web + ssh zero "mv dovel-web .local/bin" + +deploy-certs: fullchain.pem privkey.pem + scp fullchain.pem zero:certs/inbox.dovel.email-fullchain.pem + scp privkey.pem zero:certs/inbox.dovel.email-privkey.pem
diff --git a/www/assets/apple-touch-icon.png b/www/assets/apple-touch-icon.png new file mode 100644 index 0000000..13b9018 Binary files /dev/null and b/www/assets/apple-touch-icon.png differ
diff --git a/www/assets/favicon.ico b/www/assets/favicon.ico new file mode 100644 index 0000000..2e1f8df Binary files /dev/null and b/www/assets/favicon.ico differ
diff --git a/www/assets/icon.png b/www/assets/icon.png new file mode 100644 index 0000000..2798922 Binary files /dev/null and b/www/assets/icon.png differ
diff --git a/www/assets/logo.png b/www/assets/logo.png new file mode 100644 index 0000000..de112e2 Binary files /dev/null and b/www/assets/logo.png differ
diff --git a/www/assets/manifest.json b/www/assets/manifest.json
new file mode 100644
index 0000000..59ade4c
--- /dev/null
+++ b/www/assets/manifest.json
@@ -0,0 +1,15 @@
+{
+ "short_name": "dovel",
+ "name": "Dovel",
+ "icons": [
+ {
+ "src": "/assets/icon.png",
+ "type": "image/png",
+ "purpose": "maskable",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": "../index.html",
+ "background_color": "#FFF",
+ "display": "standalone"
+}
diff --git a/www/compose.html b/www/compose.html
new file mode 100644
index 0000000..09bf97e
--- /dev/null
+++ b/www/compose.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+{{template "head.html"}}
+ </head>
+ <body>
+<b>composing</b><br>
+<br>
+<form action=/out method=post enctype=multipart/form-data>
+ <table>
+ <tr>
+ <td style="padding-left: 0"><label for="from">From: </label></td>
+ <td><input style="width:100%" name=from {{if .Query.inbox}}value="{{.Query.Get "inbox" }}"{{end}}></td>
+ </tr>
+ <tr>
+ <td style="padding-left: 0"><label>To: </label></td>
+ <td><input style="width:100%" name=to {{if .Query.to}}value="{{.Query.Get "to"}}"{{end}}></td>
+ </tr>
+ <tr>
+ <td style="padding-left: 0"><label>CC: </label></td>
+ <td><input style="width:100%" name=cc></td>
+ </tr>
+ <tr>
+ <td style="padding-left: 0"><label>CCo: </label></td>
+ <td><input style="width:100%" name=cco></td>
+ </tr>
+ <tr>
+ <td style="padding-left: 0"><label>Subject: </label></td>
+ <td><input style="width:100%" name=subject {{if .Query.subj}}value="{{.Query.Get "subj"}}"{{end}}></td>
+ </tr>
+ <tr>
+ <td colspan=2><textarea style="width:100%" name=body rows="7" cols="50" placeholder="Body:"></textarea></td>
+ </tr>
+ <tr>
+ <td colspan=2><label>Attachments: </label><input type=file name=files multiple></td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <details>
+ <summary><label>Encrypt? </label><input name=encrypt type=checkbox></summary>
+ Override OpenPGP key (optional):<br>
+ <textarea style="width:100%" name=key rows="7" cols="50" placeholder="Begin OpenGPG key..."></textarea>
+ </details>
+ </td>
+ </tr>
+ </table>
+ <input type=submit value=send>
+</form>
+ </body>
+</html>
diff --git a/www/head.html b/www/head.html
new file mode 100644
index 0000000..9f1a941
--- /dev/null
+++ b/www/head.html
@@ -0,0 +1,6 @@
+<title>dovel</title>
+<link rel=icon href=/assets/favicon.ico>
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<meta name="color-scheme" content="light dark"/>
+<style> body { max-width: 600px; padding: 0 15px; margin: 40px auto; font-family: sans-serif; } table { width: 100%; } a { color: #888 } small { float: right; } input, textarea { color: #888; font-family: monospace; } input { border: none; border-bottom: 1px solid #888; } input[type="submit"] { text-decoration: underline; cursor: pointer; color: #888; } pre { white-space: pre-wrap; } </style>
+
diff --git a/www/inboxes.html b/www/inboxes.html
new file mode 100644
index 0000000..86065d4
--- /dev/null
+++ b/www/inboxes.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>dovel</title>
+ <link rel=icon href=/assets/favicon.ico>
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+ <meta name="color-scheme" content="light dark"/>
+ <style> body { max-width: 600px; padding: 0 15px; margin: 40px auto; font-family: sans-serif; } table { width: 100%; } a { color: #888 } small { float: right; } input, textarea { color: #888; font-family: monospace; } input { border: none; border-bottom: 1px solid #888; } input[type="submit"] { text-decoration: underline; cursor: pointer; color: #888; } pre { white-space: pre-wrap; } </style>
+ <link rel="manifest" href="/assets/manifest.json">
+ <link rel="apple-touch-icon" sizes="200x200" href="/logo.png">
+</head>
+<body>
+
+<a href="index.html">index</a> 
+
+{{$format := "02 Jan 2006 15:04:05"}}
+{{range .}}
+<p>
+ <a href="{{.Title}}/index.html">{{.Title}}</a>
+ <small>{{.LastMod.Format $format}}</small>
+</p>
+{{end}}
+</body>
+</html>
diff --git a/www/index.html b/www/index.html
new file mode 100644
index 0000000..7165304
--- /dev/null
+++ b/www/index.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>dovel</title>
+ <link rel=icon href=/assets/favicon.ico>
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+ <meta name="color-scheme" content="light dark"/>
+ <style> body { max-width: 600px; padding: 0 15px; margin: 40px auto; font-family: sans-serif; } table { width: 100%; } a { color: #888 } small { float: right; } input, textarea { color: #888; font-family: monospace; } input { border: none; border-bottom: 1px solid #888; } input[type="submit"] { text-decoration: underline; cursor: pointer; color: #888; } pre { white-space: pre-wrap; } </style>
+ <link rel="manifest" href="/assets/manifest.json">
+ <link rel="apple-touch-icon" sizes="200x200" href="/logo.png">
+</head>
+<body>
+ <center>
+<pre>
+_________ ______
+______ /________ _________ /
+_ __ /_ __ \_ | / / _ \_ /
+/ /_/ / / /_/ /_ |/ // __/ /
+\__,_/ \____/_____/ \___//_/
+
+</pre>
+ </center>
+<a href=compose.html>compose</a> 
+<a href=logout.html>logout</a>
+
+{{$format := "02 Jan 2006 15:04:05"}}
+{{range .}}
+<p>
+ <a href="{{.Title}}/index.html">{{.Title}}</a>
+ <small>{{.LastMod.Format $format}}</small>
+</p>
+{{end}}
+</body>
+</html>
diff --git a/www/mail.html b/www/mail.html
new file mode 100644
index 0000000..82c794c
--- /dev/null
+++ b/www/mail.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+<title>dovel</title>
+<link rel=icon href=/assets/favicon.ico>
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<meta name="color-scheme" content="light dark"/>
+<style> body { max-width: 600px; padding: 0 15px; margin: 40px auto; font-family: sans-serif; } table { width: 100%; } a { color: #888 } small { float: right; } input, textarea { color: #888; font-family: monospace; } input { border: none; border-bottom: 1px solid #888; } input[type="submit"] { text-decoration: underline; cursor: pointer; color: #888; } pre { white-space: pre-wrap; } </style>
+ </head>
+ <body>
+ <p>
+ <details>
+ <summary>
+ From: {{.From}}<br>
+ To: {{index .To 0}}<br>
+ Date: {{.Date.Format "Mon, 02 Jan 2006 15:04:05 MST"}}<br>
+ {{if .Cc}}Cc: .Cc{{end}}
+ </summary>
+ <ul>
+ {{range $k, $vs := .Headers}}
+ <li>{{$k}}: {{$vs}}</li>
+ {{end}}
+ </ul>
+ </details>
+ {{if .Attachments}}
+ Attachments:
+ <ul>
+ {{range .Attachments}}
+ <li>
+ <a href="data:{{.ContentType}};base64,{{.Data}}" download="{{.Name}}">{{.Name}}</a>
+ </li>
+ {{end}}
+ </ul>
+ {{end}}
+ {{if .Body}}
+ <pre>{{.Body}}</pre>
+ {{end}}
+ </p>
+ </body>
+</html>
diff --git a/www/mails.html b/www/mails.html
new file mode 100644
index 0000000..2ad9d1f
--- /dev/null
+++ b/www/mails.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>dovel</title>
+ <link rel=icon href=/assets/favicon.ico>
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
+ <meta name="color-scheme" content="light dark"/>
+ <style> body { max-width: 600px; padding: 0 15px; margin: 40px auto; font-family: sans-serif; } table { width: 100%; } a { color: #888 } small { float: right; } input, textarea { color: #888; font-family: monospace; } input { border: none; border-bottom: 1px solid #888; } input[type="submit"] { text-decoration: underline; cursor: pointer; color: #888; } pre { white-space: pre-wrap; } </style>
+ <link rel="manifest" href="/assets/manifest.json">
+ <link rel="apple-touch-icon" sizes="200x200" href="/logo.png">
+</head>
+<body>
+
+<a href="/index.html">index</a> 
+
+{{$format := "02 Jan 2006 15:04:05"}}
+{{range .}}
+<p>
+ <a href="{{.Title}}">{{.Title}}</a>
+ <small>{{.LastMod.Format $format}}</small>
+</p>
+{{end}}
+</body>
+</html>
diff --git a/www/style.html b/www/style.html new file mode 100644 index 0000000..e69de29