Skip to main content

Simple local-files server with security on top!

Project description

tdwnsv3

Github

pypi

Coverage

wakatime

Visitors

Code-style

Access your files on the web.

Web interface sample

Independencies

  • Flask

  • cryptography

  • appdirs

Features

  • Simple commandline interface for launch

  • Web interface with multiple themes

  • Highly secured

  • Multiple device and browser compatible

  • Fully customized web interface - css

  • Upload and download files

Installation

  • Choose your suit from the following ways:
  1. From pip
$ pip install tdwnsv3
  1. From source
$ pip install git+https://github.com/Simatwa/tdwnsv3.git
  1. Cloning repo and install
git clone https://github.com/Simatwa/tdwnsv3.git

cd tdwnsv3

sudo bash install.sh

Usage

Either of the following ways will get you ready at the terminal environment

  1. Package level

$ python -m tdwnsv3

  1. $ tdwnsv3

By default, the server fires up with the following configurations:

Command Default
host False
port 8000
no-sort False
theme 3
upload False
encrypt False
session False

Note This is just a shallow display of the default configurations.

wsgi

Since Flask server runs at development environment, you may need to run the program on a server such as Nginx for efficiency.

from tdwnsv3.tdwnsv3 import app



if __name__ == "__main__":

    app.run()

The wsgi.py script can be interfaced with wsgi such as uwsgi to run behind a server .

  • For instance intergrating with uwsgi as stated in docs :



$ uwsgi --http=0.0.0.0:8080 -w wsgi:app



  • Run tdwnsv3 -h to view more configuration info as shown.



usage: tdwnsv3 [-h] [-v] [-d DIR] [-a ALLOW] [-r RESTRICT] [-w WHITELIST]

               [-b BLACKLIST] [-t SPLIT] [-s 1 to 10] [-l 1 to 5] [-o LOG]

               [-ho HOME] [-st STATIC] [-up RECEIVE] [-se SESSION] [-th [1-3]]

               [-cs CSS] [-upp UPLOAD_PATH] [-upe UPLOAD_EXTENSION]

               [-ups UPLOAD_SIZE] [-upl upload_limit] [--upload-multiple]

               [--disable-aggressive] [--display-hidden] [--host] [--no-sort]

               [--view] [--strict] [--preload] [--upload] [--save-css]

               [--no-cache] [--encrypt] [--debug]

               [port]



Simple local-files server with security as main priority!



positional arguments:

  port                  Port to be used for hosting files



optional arguments:

  -h, --help            show this help message and exit

  -v, --version         show program's version number and exit

  -d DIR, --dir DIR     Directory to be hosted

  -a ALLOW, --allow ALLOW

                        Host only certain entries

  -r RESTRICT, --restrict RESTRICT

                        Hide entries from being viewed

  -w WHITELIST, --whitelist WHITELIST

                        IP(s) to be excluded from restrictions - default :

                        None

  -b BLACKLIST, --brownlist BLACKLIST

                        IP(s) to be imposed the restrictions - default : all

  -t SPLIT, --split SPLIT

                        Separator for the entries allowed/restricted - default

                        [,]

  -s 1 to 10, --secure 1 to 10

                        Level of security on contents

  -l 1 to 5, --level 1 to 5

                        Logging level

  -o LOG, --log LOG     Filepath to log to

  -ho HOME, --home HOME

                        Home host subdomain path

  -st STATIC, --static STATIC

                        Static host subdomain path

  -up RECEIVE, --receive RECEIVE

                        Upload host subdomain path

  -se SESSION, --session SESSION

                        Maximum session time per user - (mins)

  -th [1-3], --theme [1-3]

                        Theme for displaying contents

  -cs CSS, --css CSS    Customize webpage with the CSS in path

  -upp UPLOAD_PATH, --upload-path UPLOAD_PATH

                        Path for saving uploaded files

  -upe UPLOAD_EXTENSION, --upload-extension UPLOAD_EXTENSION

                        Extensions of files to be uploaded

  -ups UPLOAD_SIZE, --upload-size UPLOAD_SIZE

                        Maximum file size to be uploaded - [MB]

  -upl upload_limit, --upload-limit-person upload_limit

                        Maximum files to be uploaded per IP

  --upload-multiple     Allow users to upload more than one file at a time.

  --disable-aggressive  Not to - Filter all entries with the restricted

                        keywords +

  --display-hidden      Show hidden files and directories

  --host                Host the files on the LAN

  --no-sort             Disable prettifying the display of contents

  --view                Files can be seen but can't be downloaded

  --strict              Only allow whitelisted & brownlisted IPs to access

                        server!

  --preload             Load videos before clicked

  --upload              Allow users to upload files

  --save-css            Saves the css data in path for future use

  --no-cache            Use currently passed parameters not previously saved;

                        content-caching disabled

  --encrypt             Encrypt URIs on the webpage

  --debug               Debug the web application in UI mode



Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdwnsv3-1.8.9.tar.gz (30.5 kB view details)

Uploaded Source

Built Distributions

tdwnsv3-1.8.9-py3.11.egg (115.4 kB view details)

Uploaded Source

tdwnsv3-1.8.9-py3.9.egg (95.4 kB view details)

Uploaded Source

tdwnsv3-1.8.9-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file tdwnsv3-1.8.9.tar.gz.

File metadata

  • Download URL: tdwnsv3-1.8.9.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for tdwnsv3-1.8.9.tar.gz
Algorithm Hash digest
SHA256 8031d300788546ed67a903374553edfa8bf762e124eacddd14a32ce222f69683
MD5 7e8e75eee4f30d5e9578ec3170b93188
BLAKE2b-256 40ef8563ac85d0b9cb413fb507b53bbd68a19e305714f76af762caa6583d354a

See more details on using hashes here.

File details

Details for the file tdwnsv3-1.8.9-py3.11.egg.

File metadata

  • Download URL: tdwnsv3-1.8.9-py3.11.egg
  • Upload date:
  • Size: 115.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for tdwnsv3-1.8.9-py3.11.egg
Algorithm Hash digest
SHA256 be075f7dfb4ccdfa3ed1f8640c995bc3aadf714749ba914abcdab2a7374f3998
MD5 d8c21ffbbca6f91582f1f69f77d9abf7
BLAKE2b-256 5de393ec1d4f8360de959c06b95ecd9f3cbae8752d5854134ad2f5e615d1bdd8

See more details on using hashes here.

File details

Details for the file tdwnsv3-1.8.9-py3.9.egg.

File metadata

  • Download URL: tdwnsv3-1.8.9-py3.9.egg
  • Upload date:
  • Size: 95.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for tdwnsv3-1.8.9-py3.9.egg
Algorithm Hash digest
SHA256 9c060c00eab3ffc4d138732d8256db217ce00696c77093b595d2d9d690a286ff
MD5 9d71d4a7b8b3af579afcc611270b524b
BLAKE2b-256 6f432ddbdde502a92736d1e0dcec7b8b74a3df98824a58144fffce20669e4a3b

See more details on using hashes here.

File details

Details for the file tdwnsv3-1.8.9-py3-none-any.whl.

File metadata

  • Download URL: tdwnsv3-1.8.9-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for tdwnsv3-1.8.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6c447c79a4d986366fec29c474a2fccdf5143f5edd4b888b26d945ab0dc087d5
MD5 21e3b535cc0fbd1c6f6fdb01a2b002c1
BLAKE2b-256 267c422ac143dbe64befb03daa52cfd83189830c1ba52996e0be3343287fd27d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page