summaryrefslogtreecommitdiffstats
path: root/templates/wormhole.html.template
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-10-05 18:00:06 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-10-05 18:00:06 -0700
commitd89b325294201d95498ae9d08f102e12ac2f2876 (patch)
treeffe65e33d0d01e811a5323d5e40c47564ccb8f2d /templates/wormhole.html.template
parent624985afaaa8b94e4d9685bcdc935d467f9e7060 (diff)
downloadroseh.moe-d89b325294201d95498ae9d08f102e12ac2f2876.tar.zst
Implement a "magic wormhole" file-sharing solution
Diffstat (limited to 'templates/wormhole.html.template')
-rw-r--r--templates/wormhole.html.template19
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/wormhole.html.template b/templates/wormhole.html.template
new file mode 100644
index 0000000..4d67a98
--- /dev/null
+++ b/templates/wormhole.html.template
@@ -0,0 +1,19 @@
+{{define "head"}}
+ <script src="/static/htmx.min.js"></script>
+ <script src="/static/htmx-ext-sse.js"></script>
+ <title>Wormhole</title>
+{{end}}
+
+<div
+ hx-ext="sse"
+ sse-connect="/wormhole/{{.Hole}}/ready">
+ <form
+ hx-post="/wormhole/{{.Hole}}"
+ hx-trigger="sse:ready"
+ enctype="multipart/form-data">
+ <label for="file-input">1. Choose file</label>
+ <input id="file-input" type="file" name="file">
+ </form>
+</div>
+
+<p>2. Visit this URL <a href="{{.Self}}/wormhole/{{.Hole}}">{{.Self}}/wormhole/{{.Hole}}</a></p>