feat: init
[skip ci]
This commit is contained in:
commit
0d6c010cce
55 changed files with 4216 additions and 0 deletions
2
docs/.gitignore
vendored
Normal file
2
docs/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
_stubs/
|
||||
_tree/
|
||||
17
docs/ARCHITECTURE.rst
Normal file
17
docs/ARCHITECTURE.rst
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Architecture
|
||||
============
|
||||
|
||||
.. only:: not readme
|
||||
|
||||
.. uml:: architecture.uml
|
||||
|
||||
|
||||
|
||||
Programming Paradigm
|
||||
--------------------
|
||||
|
||||
This python package is mainly authored according to a functional programming
|
||||
paradigm, however, strictly adhering to said seemed ignorant, since not all
|
||||
objects in Python are immutable anyway. Modification of mutable input objects
|
||||
are therefore not regarded as side-effects per se, due to the contractual nature
|
||||
of a function's parameter signature.
|
||||
21
docs/CONTRIBUTING.rst
Normal file
21
docs/CONTRIBUTING.rst
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Contribution Guidelines
|
||||
=======================
|
||||
|
||||
TO-DO test
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
You need the following tools to be installed:
|
||||
|
||||
* Python (> ver. 3.7)
|
||||
* Python *pip* module
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ git clone git@bitbucket.org:victorykit/ezcfn.git
|
||||
$ cd ezcfn
|
||||
$ python3 -m pipenv install -d
|
||||
$ python3 -m pipenv run tox -e test
|
||||
$ python3 -m pipenv run tox -e build
|
||||
$ python3 -m pipenv run tox -e build-docs
|
||||
61
docs/README.rst
Normal file
61
docs/README.rst
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
httpaste
|
||||
========
|
||||
|
||||
.. only:: readme
|
||||
|
||||

|
||||
|
||||
.. only:: not readme
|
||||
|
||||
.. image:: _assets/images/dog-gf2faaf3f6_1920.png
|
||||
|
||||
Simple and safe pasting over HTTP.
|
||||
|
||||
httpaste is a pastebin application for easily pasting and retrieving data over HTTP from shell environments and web browsers. It is inspired by sprunge.us and ix.io, but focuses on extendability and advanced security.
|
||||
|
||||
public and private pastes are supported. In any case, httpaste provides full anonymity, with each paste being stored encrypted.
|
||||
|
||||
Why
|
||||
---
|
||||
|
||||
As a user: Sometimes we say and write stupid things. Things so stupid, that
|
||||
others may even be offended. Others being so offended, that they wish to take
|
||||
legal actions against you. Legal actions which infringe upon your rights for
|
||||
privacy. Who is the others? Well, it's the
|
||||
|
||||
Public pastes: Only people you share the paste id with are able to view the paste. Public pastes aren't indexed publicly, so Public pastes are encrypted with their paste id and the paste id is only
|
||||
stored as a hash. Therefore the httpaste application hoster is unable to view any pastes, unless he maliciously logs any of the HTTP requests.
|
||||
|
||||
|
||||
.. include:: guide/get-started.rst
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The documentation can be found under `<https://victorykit.bitbucket.io/taskdog/>`_.
|
||||
|
||||
|
||||
Licensing
|
||||
---------
|
||||
|
||||
Copyright (C) 2021 Tiara Rodney (victoryk.it)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: More Information
|
||||
|
||||
ARCHITECTURE
|
||||
CONTRIBUTING
|
||||
BIN
docs/_assets/images/Data Flow.png
Normal file
BIN
docs/_assets/images/Data Flow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
BIN
docs/_assets/images/dog-gf2faaf3f6_1920.png
Normal file
BIN
docs/_assets/images/dog-gf2faaf3f6_1920.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
42
docs/_templates/autosummary/module.rst
vendored
Normal file
42
docs/_templates/autosummary/module.rst
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{{ fullname | escape | underline }}
|
||||
|
||||
.. rubric:: Description
|
||||
|
||||
.. automodule:: {{ fullname }}
|
||||
:special-members:
|
||||
|
||||
.. currentmodule:: {{ fullname }}
|
||||
|
||||
{% if modules %}
|
||||
.. rubric:: Modules
|
||||
|
||||
.. autosummary::
|
||||
:toctree: .
|
||||
:recursive:
|
||||
{% for module in modules %}
|
||||
{{ module }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if classes %}
|
||||
.. rubric:: Classes
|
||||
|
||||
.. autosummary::
|
||||
:toctree: .
|
||||
{% for class in classes %}
|
||||
{{ class }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if functions %}
|
||||
.. rubric:: Functions
|
||||
|
||||
.. autosummary::
|
||||
:toctree: .
|
||||
{% for function in functions %}
|
||||
{{ function }}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
BIN
docs/architecture.png
Normal file
BIN
docs/architecture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
7
docs/architecture.uml
Normal file
7
docs/architecture.uml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@startuml
|
||||
Alice -> Bob: Authentication Request
|
||||
Bob --> Alice: Authentication Response
|
||||
|
||||
Alice -> Bob: Another authentication Request
|
||||
Alice <-- Bob: Another authentication Response
|
||||
@enduml
|
||||
61
docs/conf.py
Normal file
61
docs/conf.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
|
||||
# -- Project information -------------------------------------------------------
|
||||
|
||||
project = 'httpaste'
|
||||
copyright = '2022 - Tiara Rodney (victoryk.it)'
|
||||
author = 'Tiara Rodney <t.rodney@victoryk.it'
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = '1b'
|
||||
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx_rtd_theme',
|
||||
'sphinxcontrib.plantuml',
|
||||
'sphinxarg.ext',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx_autodoc_typehints'
|
||||
]
|
||||
|
||||
templates_path = ['_templates']
|
||||
|
||||
exclude_patterns = [
|
||||
'_build',
|
||||
'_templates'
|
||||
'Thumbs.db',
|
||||
'.DS_Store',
|
||||
'.gitignore',
|
||||
]
|
||||
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
#html_static_path = ['_static']
|
||||
|
||||
|
||||
# -- Options for autodoc & autosummary -----------------------------------------
|
||||
|
||||
|
||||
autosummary_generate = True
|
||||
|
||||
autosummary_mock_imports = [
|
||||
'httpaste.cgi',
|
||||
'httpaste.wsgi',
|
||||
'httpaste.fcgi'
|
||||
]
|
||||
|
||||
if tags.has('readme'):
|
||||
autosummary_generate = False
|
||||
master_doc = 'README'
|
||||
exclude_patterns.append('index.rst')
|
||||
exclude_patterns.append('_stubs')
|
||||
exclude_patterns.append('guide')
|
||||
17
docs/guide/advanced-usage.rst
Normal file
17
docs/guide/advanced-usage.rst
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Advanced Usage
|
||||
==============
|
||||
|
||||
Binary Pastes
|
||||
-------------
|
||||
|
||||
httpaste supports encoding. Encode your data as Base64, Base85, Base32, or
|
||||
Base16 and provide an encoding specifier.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cat my.pdf | base64 | curl "http://localhost:8080/paste/public?encoding=base64"
|
||||
http://localhost:8080/paste/public/5Rt3E3n6
|
||||
|
||||
When getting pastes, you may provide a MIME type, if a client deduces the encoding by looking at the HTTP 'Content-Type' header.
|
||||
|
||||
$ curl "https://p.victoryk.it/paste/public/5Rt3E3n6?mime=application/pdf"
|
||||
17
docs/guide/backend.rst
Normal file
17
docs/guide/backend.rst
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Backend
|
||||
=======
|
||||
|
||||
Binary Pastes
|
||||
-------------
|
||||
|
||||
httpaste supports encoding. Encode your data as Base64, Base85, Base32, or
|
||||
Base16 and provide an encoding specifier.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cat my.pdf | base64 | curl "http://localhost:8080/paste/public?encoding=base64"
|
||||
http://localhost:8080/paste/public/5Rt3E3n6
|
||||
|
||||
When getting pastes, you may provide a MIME type, if a client deduces the encoding by looking at the HTTP 'Content-Type' header.
|
||||
|
||||
$ curl "https://p.victoryk.it/paste/public/5Rt3E3n6?mime=application/pdf"
|
||||
2
docs/guide/cli.rstas
Normal file
2
docs/guide/cli.rstas
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Get Started
|
||||
===========
|
||||
70
docs/guide/get-started.rst
Normal file
70
docs/guide/get-started.rst
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
Get Started
|
||||
===========
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ python3 -m pip install httpaste-victorykit
|
||||
$ httpaste --help
|
||||
|
||||
Create configuration
|
||||
--------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ httpaste default-config --dump myconfig.ini
|
||||
|
||||
Run a local test server
|
||||
-----------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ httpaste standalone --config myconfig.ini --port 8080
|
||||
* Serving Flask app 'httpaste' (lazy loading)
|
||||
* Environment: production
|
||||
WARNING: This is a development server. Do not use it in a production deployment.
|
||||
Use a production WSGI server instead.
|
||||
* Debug mode: off
|
||||
* Running on all addresses.
|
||||
WARNING: This is a development server. Do not use it in a production deployment.
|
||||
* Running on http://localhost:8080/ (Press CTRL+C to quit)
|
||||
|
||||
Publish a Private Paste
|
||||
-----------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ echo 'My first private paste' | curl -F 'data=<-' \
|
||||
-u myusername:mypassword \
|
||||
http://localhost:8080/paste/private
|
||||
http://localhost:8080/paste/private/UALUA9
|
||||
|
||||
.. note::
|
||||
If the user does not exist, they will be created upon authentication.
|
||||
|
||||
Retrieve a Private Paste
|
||||
------------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ curl -u myusername:mypassword http://localhost:8080/paste/private/UALUA9
|
||||
My first private paste
|
||||
|
||||
Publish a Public Paste
|
||||
-----------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ echo 'My first public paste' | curl -F 'data=<-' \
|
||||
http://localhost:8080/paste/public
|
||||
http://localhost:8080/paste/public/X4L39J
|
||||
|
||||
Retrieve a Public Paste
|
||||
------------------------
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ curl http://localhost:8080/paste/public/X4L39J
|
||||
My first public paste
|
||||
16
docs/index.rst
Normal file
16
docs/index.rst
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
.. include:: README.rst
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Contents:
|
||||
|
||||
guide/get-started
|
||||
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
Loading…
Add table
Add a link
Reference in a new issue