Skip to main content

PyPI GitHub Workflow Status Discord Documentation License

bin-server

Un outil pour héberger des snippets de code et les partager via une URL.

Installation

Le service nécessite une version de Python supérieure ou égale à Python 3.7 et un accès à un serveur Redis. Les archives sont hébergés sur Pypi, vous pouvez installer la dernière version stable via pip :

$ pip install rtd-bin-server

Une fois installé, le module bin devient accessible et peut être directement lancé via la ligne de commande.

$ python -m bin

Par défaut, le service ne traite qu'un client à la fois, écoute à l'adresse localhost:8012 et se connecte à la base de donnée Redis sur localhost:6379/0. Changer la configuration par défaut se fait au moyen d'un fichier dotenv. Le fichier sera automatiquement détecté s'il est nommé .env et qu'il se trouve soit au niveau des sources, soit au niveau du répertoire courant (celui depuis lequel est lancé la commande). Une alternative est de renseigner le fichier de configuration à utiliser via l'option --rtdbin-config.

$ python -m bin --rtdbin-config /chemin/vers/fichier/.env

La configuration complète par défaut est reprise ci-dessous :

RTDBIN_HOST=localhost
RTDBIN_PORT=8012
RTDBIN_MAXSIZE=16kiB
RTDBIN_DEFAULT_LANGUAGE=text
RTDBIN_DEFAULT_MAXUSAGE=0
RTDBIN_DEFAULT_LIFETIME=0
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
REDIS_USERNAME=

Par défaut, le service utilise le serveur web wsgiref disponible dans la bibliothèque standard de Python pour traiter les requêtes. Ce serveur est propice dans un environnement de développement ou lorsque le volume d'utilisateur est réduit. Pour de meilleures performances, un serveur tiers compatible wsgi peut être utilisé à la place.

$ pip install gunicorn
$ gunicorn bin:app

Des fichiers de configuration d'exemples pour nginx, systemd et gunicorn sont disponibles dans le wiki.

Contribution

Le développement de bin se fait principalement via la communauté Discord Read The Docs dans le canal #bin.

Les sources peuvent être récupérées via Git et le service peut être installé dans un environnement virtuel dédié.

$ git clone https://github.com/readthedocs-fr/bin.git rtdbin
$ cd rtdbin
$ python -m venv
$ venv/bin/pip install -r requirements.txt
$ venv/bin/pip install -e .

Une fois installé, vous pouvez vous assurer que le système est correctement opérationnel en lançant la suite de tests unitaires et en vérifiant que le serveur démarre correctement.

$ venv/bin/python -m unittest
$ venv/bin/python -m bin &
$ curl http://localhost:8012/health
$ kill %%

Les contributions se font sur des branches dédiées, les branches sont nommées en commençant par quelques mots-clés suivis d'un identifiant de l'utilisateur. Les commits sont le plus petit dénominateur de version, sont correctement documentés au moyen d'un message de commit reprenant au minimum un contexte expliquant la nécessité des modifications.

$ git checkout main
$ git pull origin main
$ git checkout -b redo-readme-juc
$ git commit <<EOF
doc: redo readme

The readme is the first document users read when they learn
about the project, the file is by default shown in the project root
page in github.

The document is very important yet the current one is not very
good. The new documents are more straight to the point.
EOF
$ git push fork redo-readme-juc

Metadata

Release files for rtd-bin-server 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rtd-bin-server 1.4.1
File Size Uploaded Provenance Actions
rtd_bin_server-1.4.1.tar.gz 19.9 kB Without provenance Details for rtd_bin_server-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rtd-bin-server 1.4.1
File Interpreter ABI Platform Actions
rtd_bin_server-1.4.1-py3-none-any.whl Python 3 none any Details for rtd_bin_server-1.4.1-py3-none-any.whl

Total release size: 24.0 kB

Release files / rtd_bin_server-1.4.1.tar.gz

Download URL rtd_bin_server-1.4.1.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
42fc8dd6924d589bd137bd07c47f1c9e3887ba0c4a0ef45e74e11a956b292aa5
BLAKE2b-256 checksum
How to use checksums
aae266e3ad39c12718540341246f9063463666a75e0ed34f941eeb3443c2a3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / rtd_bin_server-1.4.1-py3-none-any.whl

Download URL rtd_bin_server-1.4.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e2ce480d92b31e186a99ab24b93d5364f52831c8e60ec5330fda4f25aab7874
BLAKE2b-256 checksum
How to use checksums
3d005428b9afef811888b5cf63655d3382942c83277bea71110364a04ef9f60b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for rtd-bin-server 1.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page