From f0b07ac9c17a394d94b41535b1e4b29a6917813f Mon Sep 17 00:00:00 2001 From: "Dominik V. Salonen" Date: Mon, 18 Jan 2016 09:07:35 +0100 Subject: [PATCH] Edited some pages and cleaned conf.py sample --- conf.py.sample | 12 ++++++++++-- static/style.css | 2 +- templates/about.html | 13 ++++++++----- templates/upload.html | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/conf.py.sample b/conf.py.sample index 85ade3a..59dddd2 100644 --- a/conf.py.sample +++ b/conf.py.sample @@ -1,17 +1,24 @@ # Create an empty config dict config = dict() + ## # # Main server configuration # ## + config["HOST"] = "127.0.0.1" -# This string will be used in file URLs that are returned -config["DOMAIN"] = "example.com" + +# This string will be used in file URLs that are returned, you will need to include http:// or https:// +config["DOMAIN"] = "http://example.com" config["PORT"] = 8282 + +# Disable this for production use config["DEBUG"] = True + # Extended debug will add extra debug output that's not normally provided by flask config["EXTENDED_DEBUG"] = False + # Single user authentication, leave blank to disable authentication config["KEY"] = "" @@ -19,6 +26,7 @@ config["KEY"] = "" config["UPLOAD_FOLDER"] = './data' config["ALLOW_ALL_FILES"] = True config["ALLOWED_EXTENSIONS"] = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) + # If this is set to true, old files will be deleted. TIME is how far behind (in seconds) the last accessed time can be before files get deleted config["DELETE_FILES"] = True config["TIME"] = 30 diff --git a/static/style.css b/static/style.css index f6cc678..7ef70da 100644 --- a/static/style.css +++ b/static/style.css @@ -50,7 +50,7 @@ body { .links { font-size: 0; - margin-top: 20px; + margin-top: 5px; text-align: center; list-style: none; } diff --git a/templates/about.html b/templates/about.html index e54d9e3..b834360 100644 --- a/templates/about.html +++ b/templates/about.html @@ -2,19 +2,22 @@ {% block body %}

- Temporary storage + Access-based storage

- {{ page.title }} is now a temporary storage service. + {{ page.title }} is a service that keeps files stored depending on their popularity.

- I've shifted from permanent storage to temporary storage. The main reason being that about 93% of files uploaded to the old site were never accessed again after the first week. + File storage times are one week from when they were last accessed. Or one week since they were uploaded if they're never accessed.

- Now hold your horses - We don't delete files one week after upload. We delete them one week after they were last accessed. + Meaning that if you upload a file on December 10th and someone accesses that file on the 13th, we won't delete the file until the 20th. If someone also fetched the file on the 17th, your file will stay until December 25th.

- Meaning that if you upload a file on December 10th and someone accesses that file on the 13th. Then we won't delete the file until the 20th. If someone then visits the file on the 17th, the counter resets again and your file will stay until December 25th. + In a similar fashion; if you upload a file on December 3rd and send it to someone, then the file is never accessed again. It will be deleted on the 10th. +

+

+ Even though I personally only do it to limit the server costs and keep the site running fast. Many users refer to this as a form of "Security Through Obscurity" since file URLs are whatever the user first uploaded and they will die at unpredictable times. Making it harder to brute-force file links

diff --git a/templates/upload.html b/templates/upload.html index 7cd18e4..8613d04 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -3,7 +3,6 @@

QuadFile

-

This is temporary storage, check the about page for details

@@ -13,6 +12,7 @@

+

This storage is not always permanent, check the about page for details