No description
Kumi
bf60f75769
Introduced the ability to handle file uploads via POST requests with necessary validations and directory management. Added security checks on both POST and GET methods which now verify client IP against allowlist and banlist. Implemented redirection after successful file upload, with a generated slug as the file identifier. Refactored the 'do_POST' method, incorporating checks on request path and 'Content-Length' header, rejecting inappropriate requests swiftly. Created the upload functionality that reads the content and writes it to the designated data directory, using a new, unique slug for each file. Also added logging for requests, aiding in monitoring and debugging. These enhancements create a more functional and secure system, laying the groundwork for future improvements and feature integrations. |
||
---|---|---|
src/pyfiche | ||
.gitignore | ||
LICENSE | ||
pyproject.toml | ||
README.md |
PyFiche
PyFiche is a simple pastebin optimized for the command line, written in Python and heavily inspired by fiche, or rather a shameless translation. It has no dependencies outside the Python standard library.
It also comes with a re-implementation of Lines, the HTTP server that comes with Fiche. Additionally, PyFiche also comes with a simple TCP server, Recup, to download pastes through netcat without using HTTP(S), in the same way you upload them.
Installation
Dependencies
- Python 3 (tested with 3.11)
Local Installation
$ python -m venv venv
$ source venv/bin/activate
$ pip install -U git+https://kumig.it/PrivateCoffee/pyfiche.git
Usage
Fiche Server
$ source venv/bin/activate
$ pyfiche-server # try --help for options
With the exception of the -u
option, all arguments of the original Fiche
should work as expected. -u
is not implemented because, well, just use the
right user in the first place. 🤷♀️
Recup Server
$ source venv/bin/activate
$ pyfiche-recup # try --help for options
Lines Server
$ source venv/bin/activate
$ pyfiche-lines # try --help for options
License
PyFiche is licensed under the MIT license. See the LICENSE file for more information.