blck

ephemeral pastebin/url shortener
git clone https://git.parazyd.org/blck
Log | Files | Refs | README | LICENSE

commit 680e1d45a08b7347dcbafed73a5dc66fc690b688
parent f0df513684d99c3acb8c070e8fbb45b9bf7a402c
Author: parazyd <parazyd@dyne.org>
Date:   Sat, 10 Mar 2018 13:11:26 +0100

make being ephemeral opt-out.

Diffstat:
Mblck.py | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/blck.py b/blck.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# copyleft (c) 2017 - parazyd -# see LICENSE file for details +# copyleft (c) 2017-2018 parazyd +# see LICENSE file for copyright and license details. """ main blck module """ @@ -11,7 +11,10 @@ import string import flask +# configure blck's behavior here PASTEBIN = False +EPHEMERAL = True + APP = flask.Flask(__name__) @@ -30,7 +33,8 @@ def urlget(urlshort): try: with open('uris/' + urlshort, 'r') as paste: realurl = paste.readline() - os.remove('uris/' + urlshort) + if EPHEMERAL: + os.remove('uris/' + urlshort) except FileNotFoundError: return "could not find paste\n"