microfileserver Code
small HTTP server for everyday sharing. micro-file-server
Brought to you by:
vitaliy01
File | Date | Author | Commit |
---|---|---|---|
.cert | 2024-01-27 |
![]() |
[b48277] 1) hide hidden files 2) HTTPS instruction and c... |
.github | 2024-01-30 |
![]() |
[04815b] add help to -h argument |
micro_file_server | 2024-01-30 |
![]() |
[6ff5f8] pylint, Bandit, mypy |
tests | 2023-06-25 |
![]() |
[1ae5b7] refactor and add pytest |
.gitignore | 2023-06-24 |
![]() |
[4ab3a4] init |
LICENSE | 2023-06-24 |
![]() |
[4ab3a4] init |
README.md | 2024-01-30 |
![]() |
[e93aad] replace screenshot and now version v0.1.1 |
Screenshot.png | 2024-01-30 |
![]() |
[e93aad] replace screenshot and now version v0.1.1 |
pyproject.toml | 2024-01-30 |
![]() |
[e93aad] replace screenshot and now version v0.1.1 |
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.
Allow to transfer files between systems easily and safely.
Python version >= 3.10
Flask >= 2.3.2 pip install flask
Lower version may work as well.
export FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=8080
export FLASK_BASE_DIR='/home/user'
python -m micro_file_server
or
python -m micro_file_server --host 0.0.0.0 --port 8080
or
python micro_file_server/__main__.py
or for HTTPS:
python micro_file_server/__main__.py --cert=.cert/cert.pem --key=.cert/key.pem
Built-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
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
certutil -hashfile "micro-file-server.exe" SHA512
Filesharing, fileserver, httpserver, microhttp, simplehttp.