From 2d3b4c7fc74b377698cc2f554ae7ceac76bf616b Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Mon, 2 Jan 2023 01:14:34 -0500 Subject: Remove stale go templates --- templates/base.tpl | 21 ------------------- templates/error.tpl | 11 ---------- templates/index.tpl | 60 ----------------------------------------------------- templates/view.tpl | 9 -------- 4 files changed, 101 deletions(-) delete mode 100644 templates/base.tpl delete mode 100644 templates/error.tpl delete mode 100644 templates/index.tpl delete mode 100644 templates/view.tpl 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"}} - - - - - - {{template "title" .}} - - - - - -{{template "content" .}} - - - -{{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"}} - -

{{.Short}}

- -{{.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"}} -

Simple pastebin

- -This is a simple pastebin that effectively only has API access. - -Usernames are hard coded into the configuration file. The format is simple: - -
Users:
-  username:
-    Password: "password"
-
- -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: - -
$ 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"}
-$ 
-
- -To add a paste use `/new`: - -
$ 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"}
-$ 
-
- -Viewing the json is pretty easy: - -
$ 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"}
-$ 
-
- -{{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"}} -

Paste: "{{.Title}}"

- -
{{.GetContent}}
-{{end}} -- cgit v1.2.3