mirror of
https://github.com/r4sas/PBinCLI
synced 2025-01-26 06:24:36 +00:00
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
05c1938aa6
commit
0e61d05c9f
124
README.md
124
README.md
@ -8,66 +8,138 @@ PBinCLI
|
|||||||
PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3.
|
PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3.
|
||||||
|
|
||||||
Installing
|
Installing
|
||||||
-----
|
=====
|
||||||
|
|
||||||
|
Installation inside `virtualenv`:
|
||||||
```bash
|
```bash
|
||||||
virtualenv --python=python3 venv
|
python3 -m virtualenv --python=python3 venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install pbincli
|
pip install pbincli
|
||||||
```
|
```
|
||||||
|
|
||||||
Usage
|
Installation to system with pip3:
|
||||||
-----
|
```bash
|
||||||
|
pip3 install pbincli
|
||||||
|
```
|
||||||
|
|
||||||
|
*Note: if you used installation with `virtualenv`, don't forget to activate it before usage: call `. /path/to/venv/bin/activate` in terminal*
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
=====
|
||||||
|
|
||||||
By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default.
|
By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default.
|
||||||
|
|
||||||
You can create config file with variables `server` and `proxy` in `~/.config/pbincli/pbincli.conf` to use different settings.
|
You can create config file to use different settings.
|
||||||
|
|
||||||
Example contents:
|
Configuration file is searched in `~/.config/pbincli/pbincli.conf`, `%APPDATA%/pbincli/pbincli.conf` (Windows) and `~/Library/Application Support/pbincli/pbincli.conf` (MacOS)
|
||||||
|
|
||||||
|
Example contents
|
||||||
|
-----
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
server=https://paste.i2pd.xyz/
|
server=https://paste.i2pd.xyz/
|
||||||
proxy=http://127.0.0.1:3128
|
proxy=http://127.0.0.1:3128
|
||||||
```
|
```
|
||||||
|
|
||||||
Run inside `venv` command:
|
All possible options for configuration file
|
||||||
|
-----
|
||||||
|
|
||||||
|
| Option | Default | Possible value |
|
||||||
|
|--------|---------|---------|
|
||||||
|
server | https://paste.i2pd.xyz/ | Domain ending with slash |
|
||||||
|
mirrors | None | Domains separated with comma, like `http://privatebin.ygg/,http://privatebin.i2p/` |
|
||||||
|
proxy | None | Proxy address starting with scheme `http://` or `socks5://` |
|
||||||
|
short | False | True / False |
|
||||||
|
short_api | None | `tinyurl`, `clckru`, `isgd`, `vgd`, `cuttly`, `yourls`, `custom` |
|
||||||
|
short_url | None | Domain name of shortener service for `yourls`, or sortener URL (with required parameters) for `custom` |
|
||||||
|
short_user | None | Used only in `yourls` |
|
||||||
|
short_pass | None | Used only in `yourls` |
|
||||||
|
short_token | None | Used only in `yourls` |
|
||||||
|
no_check_certificate | False | True / False |
|
||||||
|
no_insecure_warning | False | True / False |
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Tool available by command `pbincli`, help for every command can be called with `-h` option:
|
||||||
```bash
|
```bash
|
||||||
pbincli send --text "Hello!"
|
pbincli {send|get|delete} -h
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use stdin input to read text for paste:
|
Sending
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Sending text:
|
||||||
|
```bash
|
||||||
|
pbincli send -t "Hello! This is test paste!"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use stdin input to read text for paste:
|
||||||
```bash
|
```bash
|
||||||
pbincli send - <<EOF
|
pbincli send - <<EOF
|
||||||
Hello! This is test paste!
|
Hello! This is test paste!
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
It will send string `Hello! This is test paste!` to PrivateBin.
|
* Sending file with text in paste:
|
||||||
|
|
||||||
To send file use `--file` or `-f` with filename. Example:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pbincli send -c "My document" -f info.pdf
|
pbincli send -f info.pdf -t "I'm sending my document."
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Sending only file without any text:
|
||||||
|
```bash
|
||||||
|
pbincli send -q -f info.pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
__*Note*__: It is possible to set-up paste parameters such as burning after reading, expiritaion time, formatting, enabling discussions, and changing compression algorithm. Please refer to `pbincli send -h` output for more information.
|
||||||
|
|
||||||
|
Receiving
|
||||||
|
-----
|
||||||
|
|
||||||
To retrieve paste from server, use `get` command with paste info.
|
To retrieve paste from server, use `get` command with paste info.
|
||||||
|
|
||||||
It must be formated like `pasteID#passphrase`. Example:
|
It must be formated like `pasteID#Passphrase` or use full URL to paste. Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pbincli get 49eeb1326cfa9491#vfeortoVWaYeJlviDdhxQBtj5e0I2kArpynrtu/tnGs=
|
pbincli get xxx#yyy ### receive paste xxx from https://paste.i2pd.xyz/ by default
|
||||||
```
|
pbincli get https://example.com/?xxx#yyy ### receive paste xxx from https://example.com/
|
||||||
More info you can find by typing
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pbincli [-h] {send, get, delete}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO
|
Deletion
|
||||||
----
|
-----
|
||||||
Write a more complete usage documentation.
|
|
||||||
|
To delete paste from server, use `delete` command with required `-p` and `-t` options:
|
||||||
|
```bash
|
||||||
|
pbincli delete -p xxx -t deletetoken
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need to delete paste on different server that configured, use `-s` option with instance URL.
|
||||||
|
|
||||||
|
Additional examples
|
||||||
|
=====
|
||||||
|
|
||||||
|
Here you can find additional examples.
|
||||||
|
|
||||||
|
Usage with service available inside I2P
|
||||||
|
-----
|
||||||
|
|
||||||
|
Change settings to use server `http://privatebin.i2p/` and proxy `http://127.0.0.1:4444`. Here's example for configuration file:
|
||||||
|
```ini
|
||||||
|
server=http://privatebin.i2p/
|
||||||
|
proxy=http://127.0.0.1:4444
|
||||||
|
```
|
||||||
|
|
||||||
|
Using tool with aliases
|
||||||
|
-----
|
||||||
|
|
||||||
|
Example of alias to send paste from `stdin` direclty to I2P service:
|
||||||
|
```bash
|
||||||
|
alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"
|
||||||
|
```
|
||||||
|
|
||||||
|
Call it by running `pastei2p` in terminal.
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
=====
|
||||||
|
|
||||||
This project is licensed under the MIT license, which can be found in the file
|
This project is licensed under the MIT license, which can be found in the file
|
||||||
[LICENSE](https://github.com/r4sas/PBinCLI/blob/master/LICENSE) in the root of the project source code.
|
[LICENSE](https://github.com/r4sas/PBinCLI/blob/master/LICENSE) in the root of the project source code.
|
||||||
|
272
README.rst
272
README.rst
@ -1,91 +1,181 @@
|
|||||||
|
|
||||||
|
|
||||||
.. image:: https://img.shields.io/github/license/r4sas/PBinCLI.svg
|
.. image:: https://img.shields.io/github/license/r4sas/PBinCLI.svg
|
||||||
:target: https://github.com/r4sas/PBinCLI/blob/master/LICENSE
|
:target: https://github.com/r4sas/PBinCLI/blob/master/LICENSE
|
||||||
:alt: GitHub license
|
:alt: GitHub license
|
||||||
|
|
||||||
|
|
||||||
.. image:: https://img.shields.io/github/tag/r4sas/PBinCLI.svg
|
.. image:: https://img.shields.io/github/tag/r4sas/PBinCLI.svg
|
||||||
:target: https://github.com/r4sas/PBinCLI/tags/
|
:target: https://github.com/r4sas/PBinCLI/tags/
|
||||||
:alt: GitHub tag
|
:alt: GitHub tag
|
||||||
|
|
||||||
|
|
||||||
.. image:: https://app.codacy.com/project/badge/Grade/4f24f43356a84621bbd9078c4b3f1b70
|
.. image:: https://app.codacy.com/project/badge/Grade/4f24f43356a84621bbd9078c4b3f1b70
|
||||||
:target: https://www.codacy.com/gh/r4sas/PBinCLI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=r4sas/PBinCLI&utm_campaign=Badge_Grade
|
:target: https://www.codacy.com/gh/r4sas/PBinCLI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=r4sas/PBinCLI&utm_campaign=Badge_Grade
|
||||||
:alt: Codacy Badge
|
:alt: Codacy Badge
|
||||||
|
|
||||||
|
|
||||||
PBinCLI
|
PBinCLI
|
||||||
=======
|
=======
|
||||||
|
|
||||||
PBinCLI is command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written on Python 3.
|
PBinCLI is command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written on Python 3.
|
||||||
|
|
||||||
Installing
|
Installing
|
||||||
----------
|
==========
|
||||||
|
|
||||||
.. code-block:: bash
|
Installation inside ``virtualenv``\ :
|
||||||
|
|
||||||
virtualenv --python=python3 venv
|
.. code-block:: bash
|
||||||
. venv/bin/activate
|
|
||||||
pip install pbincli
|
python3 -m virtualenv --python=python3 venv
|
||||||
|
. venv/bin/activate
|
||||||
Usage
|
pip install pbincli
|
||||||
-----
|
|
||||||
|
Installation to system with pip3:
|
||||||
By default pbincli configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy used by default.
|
|
||||||
|
.. code-block:: bash
|
||||||
You can create config file with variables ``server`` and ``proxy`` in ``~/.config/pbincli/pbincli.conf`` to use different settings.
|
|
||||||
|
pip3 install pbincli
|
||||||
Example contents:
|
|
||||||
|
*Note: if you used installation with ``virtualenv``\ , don't forget to activate it before usage: call ``. /path/to/venv/bin/activate`` in terminal*
|
||||||
.. code-block:: ini
|
|
||||||
|
Configuration
|
||||||
server=https://paste.i2pd.xyz/
|
=============
|
||||||
proxy=http://127.0.0.1:3128
|
|
||||||
|
By default pbincli configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy used by default.
|
||||||
Run inside ``venv`` command:
|
|
||||||
|
You can create config file to use different settings.
|
||||||
.. code-block:: bash
|
|
||||||
|
Configuration file is searched in ``~/.config/pbincli/pbincli.conf``\ , ``%APPDATA%/pbincli/pbincli.conf`` (Windows) and ``~/Library/Application Support/pbincli/pbincli.conf`` (MacOS)
|
||||||
pbincli send --text "Hello!"
|
|
||||||
|
Example contents
|
||||||
Or use stdin input to read text for paste:
|
----------------
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: ini
|
||||||
|
|
||||||
pbincli send - <<EOF
|
server=https://paste.i2pd.xyz/
|
||||||
Hello! This is test paste!
|
proxy=http://127.0.0.1:3128
|
||||||
EOF
|
|
||||||
|
All possible options for configuration file
|
||||||
It will send string ``Hello! This is test paste!`` to PrivateBin.
|
-------------------------------------------
|
||||||
|
|
||||||
To send file use ``--file`` or ``-f`` with filename. Example:
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
.. code-block:: bash
|
|
||||||
|
* - Option
|
||||||
pbincli send -c "My document" -f info.pdf
|
- Default
|
||||||
|
- Possible value
|
||||||
To retrieve paste from server, use ``get`` command with paste info.
|
* -
|
||||||
|
|
||||||
It must be formated like ``pasteID#passphrase``. Example:
|
|
||||||
|
server | https://paste.i2pd.xyz/ | Domain ending with slash |
|
||||||
.. code-block:: bash
|
mirrors | None | Domains separated with comma, like ``http://privatebin.ygg/,http://privatebin.i2p/`` |
|
||||||
|
proxy | None | Proxy address starting with scheme ``http://`` or ``socks5://`` |
|
||||||
pbincli get 49eeb1326cfa9491#vfeortoVWaYeJlviDdhxQBtj5e0I2kArpynrtu/tnGs=
|
short | False | True / False |
|
||||||
|
short_api | None | ``tinyurl``\ , ``clckru``\ , ``isgd``\ , ``vgd``\ , ``cuttly``\ , ``yourls``\ , ``custom`` |
|
||||||
More info you can find by typing
|
short_url | None | Domain name of shortener service for ``yourls``\ , or sortener URL (with required parameters) for ``custom`` |
|
||||||
|
short_user | None | Used only in ``yourls`` |
|
||||||
.. code-block:: bash
|
short_pass | None | Used only in ``yourls`` |
|
||||||
|
short_token | None | Used only in ``yourls`` |
|
||||||
pbincli [-h] {send, get, delete}
|
no_check_certificate | False | True / False |
|
||||||
|
no_insecure_warning | False | True / False |
|
||||||
TODO
|
|
||||||
----
|
Usage
|
||||||
|
=====
|
||||||
Write a more complete usage documentation.
|
|
||||||
|
Tool available by command ``pbincli``\ , help for every command can be called with ``-h`` option:
|
||||||
License
|
|
||||||
-------
|
.. code-block:: bash
|
||||||
|
|
||||||
This project is licensed under the MIT license, which can be found in the file
|
pbincli {send|get|delete} -h
|
||||||
`LICENSE <https://github.com/r4sas/PBinCLI/blob/master/LICENSE>`_ in the root of the project source code.
|
|
||||||
|
Sending
|
||||||
|
-------
|
||||||
|
|
||||||
|
|
||||||
|
*
|
||||||
|
Sending text:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli send -t "Hello! This is test paste!"
|
||||||
|
|
||||||
|
*
|
||||||
|
Use stdin input to read text for paste:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli send - <<EOF
|
||||||
|
Hello! This is test paste!
|
||||||
|
EOF
|
||||||
|
|
||||||
|
*
|
||||||
|
Sending file with text in paste:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli send -f info.pdf -t "I'm sending my document."
|
||||||
|
|
||||||
|
*
|
||||||
|
Sending only file without any text:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli send -q -f info.pdf
|
||||||
|
|
||||||
|
**\ *Note*\ **\ : It is possible to set-up paste parameters such as burning after reading, expiritaion time, formatting, enabling discussions, and changing compression algorithm. Please refer to ``pbincli send -h`` output for more information.
|
||||||
|
|
||||||
|
Receiving
|
||||||
|
---------
|
||||||
|
|
||||||
|
To retrieve paste from server, use ``get`` command with paste info.
|
||||||
|
|
||||||
|
It must be formated like ``pasteID#Passphrase`` or use full URL to paste. Example:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli get xxx#yyy ### receive paste xxx from https://paste.i2pd.xyz/ by default
|
||||||
|
pbincli get https://example.com/?xxx#yyy ### receive paste xxx from https://example.com/
|
||||||
|
|
||||||
|
Deletion
|
||||||
|
--------
|
||||||
|
|
||||||
|
To delete paste from server, use ``delete`` command with required ``-p`` and ``-t`` options:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pbincli delete -p xxx -t deletetoken
|
||||||
|
|
||||||
|
If you need to delete paste on different server that configured, use ``-s`` option with instance URL.
|
||||||
|
|
||||||
|
Additional examples
|
||||||
|
===================
|
||||||
|
|
||||||
|
Here you can find additional examples.
|
||||||
|
|
||||||
|
Usage with service available inside I2P
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Change settings to use server ``http://privatebin.i2p/`` and proxy ``http://127.0.0.1:4444``. Here's example for configuration file:
|
||||||
|
|
||||||
|
.. code-block:: ini
|
||||||
|
|
||||||
|
server=http://privatebin.i2p/
|
||||||
|
proxy=http://127.0.0.1:4444
|
||||||
|
|
||||||
|
Using tool with aliases
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Example of alias to send paste from ``stdin`` direclty to I2P service:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"
|
||||||
|
|
||||||
|
Call it by running ``pastei2p`` in terminal.
|
||||||
|
|
||||||
|
License
|
||||||
|
=======
|
||||||
|
|
||||||
|
This project is licensed under the MIT license, which can be found in the file
|
||||||
|
`LICENSE <https://github.com/r4sas/PBinCLI/blob/master/LICENSE>`_ in the root of the project source code.
|
||||||
|
@ -107,6 +107,7 @@ def main():
|
|||||||
'server': 'https://paste.i2pd.xyz/',
|
'server': 'https://paste.i2pd.xyz/',
|
||||||
'mirrors': None, # real example for paste.i2pd.xyz: 'http://privatebin.ygg/,http://privatebin.i2p/'
|
'mirrors': None, # real example for paste.i2pd.xyz: 'http://privatebin.ygg/,http://privatebin.i2p/'
|
||||||
'proxy': None,
|
'proxy': None,
|
||||||
|
'short': False,
|
||||||
'short_api': None,
|
'short_api': None,
|
||||||
'short_url': None,
|
'short_url': None,
|
||||||
'short_user': None,
|
'short_user': None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user