https://github.com/anoncheg1/micro_file_server
Easy file sharing server (like FTP) with one dependency of Flask and in a single file.
https://github.com/anoncheg1/micro_file_server
filesharing ftpserver http-server webserver
Last synced: about 1 month ago
JSON representation
Easy file sharing server (like FTP) with one dependency of Flask and in a single file.
- Host: GitHub
- URL: https://github.com/anoncheg1/micro_file_server
- Owner: Anoncheg1
- License: other
- Created: 2023-06-23T23:57:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T12:35:33.000Z (11 months ago)
- Last Synced: 2025-08-19T11:38:42.531Z (about 2 months ago)
- Topics: filesharing, ftpserver, http-server, webserver
- Language: Python
- Homepage:
- Size: 170 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Table of Contents
1. [Description](#orgd1e733e)
2. [Features:](#org58f5941)
3. [Dependencies](#orgb5d14b0)
4. [Usage](#org0fa2131)
5. [Default settings](#orgb47cec6)
6. [Screenshot](#orgb47cec7)
7. [Check hash](#orgb47cec5)# Description
Create Web server from current directory.
HTTP and HTTPS server that allow to download and upload files.
Micro autoindex and file hosting server with one Flask framework dependence in single file.
# Features:
Allow to transfer files between systems easily and safely.
- ftp-like design
- ability to upload file
- protection from folder escaping and injecting
- size calculation
- flexible configuration with enironmental variables
- optional basic file type recognition: text, image, audio, video
- easy viewing text files by mime type faking.
- hiding files and directories that starts with '.' dot character.
- HTTPS/TLS/SSL supported with cert and key files or with dynamic "adhoc" key.
- all in a single file: .py or .exe.# Dependencies
Python version >= 3.10
Flask >= 2.3.2 ``` pip install flask ```
cryptography >= 41.0.4 ``` pip install cryptography ``` optionally required for TLS --cert
Lower version may work as well.
# Usage
cd downloads
python micro_file_server/__main__.py --cert=.cert/cert.pem --key=.cert/key.pemor
python -m micro_file_server --host 0.0.0.0 --port 8080
orpython micro_file_server/__main__.py
or
export FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=8080
export FLASK_BASE_DIR='/home/user'
python -m micro_file_serverBuilt-in development web server is secure enough, but you may install production Web server: ``` pip install gunicorn ```
gunicorn micro_file_server.__main__:app --bind 0.0.0.0:8080
or for HTTPS:
gunicorn micro_file_server.__main__:app --bind 0.0.0.0:8080 --certfile=.cert/cert.pem --keyfile=.cert/key.pem
# Defaults, that you can change:
export FLASK_FILENAME_MAX_LENGTH=40
export FLASK_MIMETYPE_RECOGNITION=True
export FLASK_SMALL_TEXT_DO_NOT_DOWNLOAD=True
export FLASK_SMALL_TEXT_ENCODING="utf-8"
export FLASK_FLASK_UPLOADING_ENABLED=True
export FLASK_HIDE_HIDDEN=True
export FLASK_ALLOW_REWRITE=True# Screenshot

# Check hash
MS Windows: ``` certutil -hashfile "micro-file-server.exe" SHA512 ```
at Ubuntu: ``` sha512sum micro-file-server ```
at MacOS: ```shasum -a 512 micro-file-server-macos ```
# Keywords
Filesharing, fileserver, httpserver, microhttp, simplehttp.