From 5478639ff245e16bec18fa6e5313703816d65cf4 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Sat, 8 Oct 2022 16:01:56 +0200 Subject: Planning things out --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ send-refresh.sh | 5 ++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..130b5f3 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# send + +I refuse to use WeTransfer or FileMail or any of that stuff. +The idea of using a third party service to do something so stupidly simple as to transfer files is insulting. +And, because nobody I work with is going to set up an FTP server for me to drop files into, +and managing an FTP server with a bunch of different accounts for each client sounds like a hassle, +I'm doing this instead. + +Writing my own version of these services, so I can host it myself. + +# NOTE: + +This is not finished software, don't use it. + +# Planning + +I need a dir where I put a bunch of zip files. +Probably the home directory of a new user named "send" +Each filename will get md5sum'ed, and that will become the link. + + send.sparkburst.net/f38eba6dbbe1965bc4869621d5a6fed3/test.zip + +Is this amazing for security? No, you could brute force this to find the files, but honestly, who cares? +Any production important for security and leaks to be a concern will have a dedicated DIT, and this won't be needed. +Maybe I could salt it... Hmmm... A thought for later. + +To generate the webpage, all I need is three pices of HTML to cat together. + +1. Header and down to an opening

+2. Title of File +3. <\h1> and on to half of the Download and down the rest of the page. + +Just cat those together, and you've got a download page. +Save that at + + send.sparkburst.net/f38eba6dbbe1965bc4869621d5a6fed3/index.html + +And tadaa! Download page done. + +Maybe I'll grab the style.css that is already in use for the rest of https://sparkburst.net/ diff --git a/send-refresh.sh b/send-refresh.sh index d57647f..371b596 100644 --- a/send-refresh.sh +++ b/send-refresh.sh @@ -1,8 +1,7 @@ #!/bin/bash -# Recursively delete directories by age (14 days) -find /path/to/base/dir/* -type d -ctime +14 -exec rm -rf {} \; - +# Recursively delete directories by age (14 days), and only exactly at the depth of the base directory +find /path/to/base/dir/* -type d -mindepth 1 -maxdepth 1 -ctime +14 -exec rm -rf {} \; -- cgit v1.2.1