diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-02 01:14:34 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-02 01:14:34 -0500 |
| commit | 2d3b4c7fc74b377698cc2f554ae7ceac76bf616b (patch) | |
| tree | 23715c80425a88f5d2f1258f9d2da8d32cea444d | |
| parent | 5f1642deee2d9a717d1a56232254e80db5c32031 (diff) | |
| download | paste-2d3b4c7fc74b377698cc2f554ae7ceac76bf616b.tar.gz paste-2d3b4c7fc74b377698cc2f554ae7ceac76bf616b.tar.xz | |
Remove stale go templates
| -rw-r--r-- | templates/base.tpl | 21 | ||||
| -rw-r--r-- | templates/error.tpl | 11 | ||||
| -rw-r--r-- | templates/index.tpl | 60 | ||||
| -rw-r--r-- | templates/view.tpl | 9 |
4 files changed, 0 insertions, 101 deletions
diff --git a/templates/base.tpl b/templates/base.tpl deleted file mode 100644 index ec1aeb5..0000000 --- a/templates/base.tpl +++ /dev/null @@ -1,21 +0,0 @@ -{{define "base"}} -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <link rel="stylesheet" href="/static/style.css" defer> - <title>{{template "title" .}}</title> -</head> - -<nav> - <a href="/">Home</a> - <div style="display: block; float: right;"> - </div> -</nav> -<body> - -{{template "content" .}} - -</body> -</html> -{{end}} diff --git a/templates/error.tpl b/templates/error.tpl deleted file mode 100644 index 4b36bdb..0000000 --- a/templates/error.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{template "base" .}} - -{{define "title"}}Error {{.Short}}{{end}} - -{{define "content"}} - -<h1>{{.Short}}</h1> - -{{.Long}} - -{{end}} diff --git a/templates/index.tpl b/templates/index.tpl deleted file mode 100644 index 10ede35..0000000 --- a/templates/index.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{template "base" .}} - -{{define "title"}}Simple Pastebin{{end}} - -{{define "content"}} -<h1>Simple pastebin</h1> - -This is a simple pastebin that effectively only has API access. - -Usernames are hard coded into the configuration file. The format is simple: - -<pre><code>Users: - username: - Password: "password" -</code></pre> - -If there are any non empty `Password` fields they will be replaced with the -hash on first run. - - -Run a request to `/login` to receieve a token: - -<pre><code>$ curl -D /dev/fd/2 -d '{"Username": "mitch", "Password": "secret"}' localhost:6130/login -HTTP/1.1 200 OK -Authorization: Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Mjk2MjY4ODMsInN1YiI6Im1pdGNoIn0.8t5IU8WCVWwMozWyufGqFFmKF1mggLI7V8U1tX-u3yllTalbQRgG2PrxPQeVU9pAM6fuapmydXXZYGpehezqDw -Content-Type: application/json -Date: Sat, 21 Aug 2021 22:08:03 GMT -Content-Length: 180 - -{"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Mjk2MjY4ODMsInN1YiI6Im1pdGNoIn0.8t5IU8WCVWwMozWyufGqFFmKF1mggLI7V8U1tX-u3yllTalbQRgG2PrxPQeVU9pAM6fuapmydXXZYGpehezqDw"} -$ -</code></pre> - -To add a paste use `/new`: - -<pre><code>$ export token=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Mjk2MjY4ODMsInN1YiI6Im1pdGNoIn0.8t5IU8WCVWwMozWyufGqFFmKF1mggLI7V8U1tX-u3yllTalbQRgG2PrxPQeVU9pAM6fuapmydXXZYGpehezqDw -$ curl -D /dev/fd/2 -X POST -d ' - { - "Title": "My title!", - "Tags": {"code": null, "c": null}, - "Content": "This is my test content.\n\n\n" - }' -H "Authorization: Bearer $token" localhost:6130/new -HTTP/1.1 200 OK -Content-Type: application/json -Date: Sat, 21 Aug 2021 22:20:53 GMT -Content-Length: 46 - -{"id":"YAv-lFYh9xpnP6ZZ0-Hu_w","status":"ok"} -$ -</code></pre> - -Viewing the json is pretty easy: - -<pre><code>$ curl localhost:6130/view/json/YAv-lFYh9xpnP6ZZ0-Hu_w -{"Id":"YAv-lFYh9xpnP6ZZ0-Hu_w","Title":"My -title!","Tags":{"c":{},"code":{}},"Content":"This is my test content.\n\n\n"} -$ -</code></pre> - -{{end}} diff --git a/templates/view.tpl b/templates/view.tpl deleted file mode 100644 index 76efe57..0000000 --- a/templates/view.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{{template "base" .}} - -{{define "title"}}Paste: {{.Title}}{{end}} - -{{define "content"}} -<h1>Paste: "{{.Title}}"</h1> - -<pre><code>{{.GetContent}}</pre></code> -{{end}} |
