From 6264efc71486b72923621f47b4b8ca793ea51db6 Mon Sep 17 00:00:00 2001 From: Eric Bower Date: Sun, 12 Nov 2023 11:00:09 -0500 Subject: [PATCH 1/3] feat(pastes): set custom expiration and set paste to unlisted --- pastes/html/help.page.tmpl | 33 +++++++++++++- pastes/html/marketing.page.tmpl | 6 ++- pastes/scp_hooks.go | 80 ++++++++++++++++----------------- 3 files changed, 74 insertions(+), 45 deletions(-) diff --git a/pastes/html/help.page.tmpl b/pastes/html/help.page.tmpl index 80853e22..fe7c1adb 100644 --- a/pastes/html/help.page.tmpl +++ b/pastes/html/help.page.tmpl @@ -109,8 +109,8 @@ scp ./delete.txt {{.Site.Domain}}:/

- # - Can I pipe my paste? + # + Can I pipe my paste?

Yes! @@ -120,6 +120,35 @@ scp ./delete.txt {{.Site.Domain}}:/

# if the tty warning annoys you
 echo "foobar" | ssh -T pastes.sh
+ +
+

+ # + Can I set the expiration date to a paste? +

+

+ Yes. The default expiration date for a paste is 90 days. + We do allow the user to set the paste to never expire. + We also allow custom duration + or timestamp. +

+
echo "foobar" | ssh pastes.sh FILENAME expires=false
+
echo "foobar" | ssh pastes.sh FILENAME expires=2023-12-12
+
echo "foobar" | ssh pastes.sh FILENAME expires=1h
+
+ +
+

+ # + Can I have my pastes from my user page? +

+

+ Yes. Unlisted in this context means it does not show up on + your user landing page where we should all of your pastes. + In this case, yes, you can "hide" it using a pipe command. +

+
echo "foobar" | ssh pastes.sh FILENAME hidden=true
+
{{template "marketing-footer" .}} {{end}} diff --git a/pastes/html/marketing.page.tmpl b/pastes/html/marketing.page.tmpl index 4a71c7ab..7d5a3fd5 100644 --- a/pastes/html/marketing.page.tmpl +++ b/pastes/html/marketing.page.tmpl @@ -85,7 +85,9 @@ echo "foobar" | ssh -T pastes.sh

Features