2019-10-11 10:11:42 +03:00
2018-11-18 09:42:41 +02:00
2018-12-03 17:07:31 +02:00
2018-07-01 21:26:59 +03:00
2018-01-27 10:23:41 +02:00
2018-11-18 09:42:41 +02:00

FLEES

A small file sharing website.

The name comes from mispronouncing "files" very badly.

installation

configuration

  • generate and manage shares with code/flees-manager.py
  • configure service with data/config.json
    • Change your app_secret_key !!
    • Change your public_url
    • Change your timezone
    • uid = user id for new files
    • workers = parallel processes (i.e. one upload reserves a process)
    • timeout = timeout for processes, single upload might take a long time!
    • max_zip_size = zipping a share with more data is not allowed
  • configure bind host and port in .env
  • proxy with nginx, match bind port, body size and timeout to your needs:
location /flees/ {
         proxy_pass http://localhost:8136/;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Scheme $scheme;
         proxy_set_header X-Script-Name /flees;
         client_max_body_size 8G;
         client_body_timeout 3600s;
    }
  • change website colors in code/static/css/colors.css

  • Check flees-manager.py rest command to get direct links to various actions

custom notifier

  • Add a notifier module, and refer to it in the config with: "notifier": "python-path-to-file:class-name" ex.: "notifier": "notifier:Notifier"
  • The class must have method def notify(self, message)

Check the notifier.py.template for clues. Flees will send notification on upload and download events, with a Dict like this:

{
        "recipient": "share recipient",
        "share": "name",
        "filename": "file_path",
        "operation": "direct_download",
        "environment": [env for request, including IP addresses etc]
}

Operation is one of download, direct_download, zip_download, or upload

Passwords

  • shares.json stores hashed version of password.
  • Additionally, it may store plain text password, if users so wish.
  • Internally, Flees only compares the hashes of passwords
  • Tokens are secret strings that allow login/upload/download with direct links. You can have many tokens for single share.
  • Direct download token is (password hash + filename) hashed
    • Changing password for share, changes all the direct download tokens!

Routes

  • @app.route("/") Display the list of public shares, or the ones logged in to
  • @app.route('/authenticate/', methods=['GET','POST']) Query the password for the share
  • @app.route('/upload//', methods=['POST']) Upload a file from command line
  • @app.route('/upload', methods=['POST']) Upload file from the browser
  • @app.route('/upload_join//', methods=['POST']) Commence joining of a splitted upload file
  • @app.route('/paste//', methods=['POST']) Upload a string from command line
  • @app.route('/paste', methods=['POST']) Upload a string from the browser
  • @app.route('/editor', methods=['POST','GET']) Open text editor.
  • @app.route('/files//', methods=['GET']) Return plain text list of files in the share
  • @app.route('/list//', methods=['GET']) List share contents for the browser
  • @app.route('/list/', methods=['GET']) List share contents for the browser
  • @app.route('/logout/', methods=['GET']) Logout from share. Only for browser.
  • @app.route('/ls//', methods=['GET']) List share contents for the console client
  • @app.route('/direct///', methods=['GET']) Download a file using the filename token (if direct download enabled)
  • @app.route('/download///', methods=['GET']) Download a file using the share token
  • @app.route('/download_gui//', methods=['GET']) Download a file with a browser
  • @app.route('/zip//', methods=['GET']) Download the whole share as a zip file using share token
  • @app.route('/zip/', methods=['GET']) Download the whole share as a zip file using browser
  • @app.route('/script/upload//', methods=['GET']) Get a bash script that uploads multiple files. Folders are uploaded as .tar.gz
  • @app.route('/script/download//', methods=['GET']) Get a bash script that downloads all the files in a share.
  • @app.route('/script/direct//', methods=['GET']) Get a bash script that downloads all the files in a share using direct filename tokens.
  • @app.route('/script/upload_split//', methods=['GET']) Get a python script that uploads multiple files and folders. The script splits files to smaller chunks, to prevent timeouts. Folders are uploaded as .tar
  • @app.route('/script/client//', methods=['GET']) Get a python script that is a console client for downloading and uploading files.
Description
No description provided
Readme 259 KiB
Languages
Python 68.3%
JavaScript 10.7%
Shell 10.1%
HTML 6.4%
CSS 4.1%
Other 0.4%