No description
Find a file
Kumi e76d05caf9
Enhance FicheServer robustness and add form UI
Refactored FicheServer to streamline setter methods, improving type annotations for clarity. Adjusted code formatting and string quoting for consistency across the board, promoting adherence to PEP 8 guidelines. Enhanced `generate_slug` method to recursively resolve file naming conflicts and extended its functionality to use custom inputs. Introduced a form interface to the PyFiche Lines HTML template, allowing easy uploading of pastes through the web UI. This commit improves code maintainability and provides a more user-friendly way for submitting content to the server.

Resolves issue with slug regeneration and implements feature request for web-based content submission.
2024-02-04 08:56:35 +01:00
src/pyfiche Enhance FicheServer robustness and add form UI 2024-02-04 08:56:35 +01:00
.gitignore Configure server args from env vars and update .gitignore 2024-01-23 10:20:41 +01:00
Dockerfile Added Docker setup for pyfiche services 2024-01-22 09:18:32 +01:00
LICENSE Add PyFiche pastebin service with servers and configs 2024-01-21 21:38:17 +01:00
pyproject.toml Add PyFiche pastebin service with servers and configs 2024-01-21 21:38:17 +01:00
README.md Add max paste size option to PyFiche README 2024-01-22 08:46:13 +01:00
supervisord.conf Added Docker setup for pyfiche services 2024-01-22 09:18:32 +01:00

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, which this time around also allows you to upload files using POST requests. 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. 🤷‍♀️

Additionally, PyFiche also supports the -M option, which allows you to specify a maximum paste size in bytes. The default is 5 MiB.

Use -h to see all options.

Uploading files

$ nc <server> <port> < <file>

Recup Server

$ source venv/bin/activate
$ pyfiche-recup # try --help for options

Downloading files

Pipe the ID of an uploaded file to nc:

$ echo <id> | nc <server> <port> > <file>

Lines Server

$ source venv/bin/activate
$ pyfiche-lines # try --help for options

Viewing pastes in a browser

Go to http://<server>:<port>/<id>.

Downloading raw pastes

$ curl http://<server>:<port>/<id>/raw

Uploading pastes

$ curl -X POST -d '<paste content>' http://<server>:<port>

Or use a file:

$ curl -X POST -d @<file> http://<server>:<port>

License

PyFiche is licensed under the MIT license. See the LICENSE file for more information.