From 991f62d9d739af39d5c4737c6d490b6bcee70f92 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:13:04 +0000 Subject: [PATCH] Updated pylint badge --- README.md | 16 +++---- docs/source/conf.py | 11 +++-- docs/source/index.rst | 62 +++++++------------------- docs/source/modules.rst | 7 --- docs/source/pki-playground.rst | 7 --- pki-playground.py => pki_playground.py | 0 6 files changed, 31 insertions(+), 72 deletions(-) delete mode 100644 docs/source/modules.rst delete mode 100644 docs/source/pki-playground.rst rename pki-playground.py => pki_playground.py (100%) diff --git a/README.md b/README.md index e98f08d..8b3eec8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -![pylint](https://NAMESPACE.gitlab.io/pyling.svg) +![pylint](https://img.shields.io/badge/pylint-9.86-yellow?logo=python&logoColor=white) # PKI-Playground README.md ## Introduction This is the documentation for a Python 3 script that is used to generate self-signed certificates. -The script is named `pki-playground.py`, and this documentation explains its usage and functionality. +The script is named `pki_playground.py`, and this documentation explains its usage and functionality. ## Usage -To use `pki-playground.py`, you can run it from the command line as follows. +To use `pki_playground.py`, you can run it from the command line as follows. ### Unlocking the repository The ./pkis directory in this repository is locked by default via git-crypt. @@ -16,7 +16,7 @@ The key for the git-crypt is by default encrypted with AES-256 algorithm. To get access this repository type as follows: ```shell sudo apt-get update && apt-get install git-crypt -sudo python3 pki-playground.py --unlock KEY +sudo python3 pki_playground.py --unlock KEY ``` This command will decrypt the shipped with this repository git-crypt key and @@ -25,7 +25,7 @@ unlock the pkis/ directory. ### Initialing the PKI After this, you need to initialize the PKI toolchain by entering the following command: ```shell -sudo python3 pki-playground.py --pki-init PKI_NAME +sudo python3 pki_playground.py --pki-init PKI_NAME ``` This will initialize the root CA/CN with the provided name. @@ -34,7 +34,7 @@ This will initialize the root CA/CN with the provided name. To create the server certificates, you need to explicitly specify the root certificates(PKI) name as follows: ```shell -sudo python3 pki-playground.py --create-server-cert PKI_NAME DOMAIN_NAME +sudo python3 pki_playground.py --create-server-cert PKI_NAME DOMAIN_NAME ``` This will create the server certificates that are based on the PKI with the provided name. @@ -44,7 +44,7 @@ After that, you need to create the so-called deployment, which is a docker-compo the text, that will be temoparily added to the /etc/hosts file. To do this, type as follows: ```shell -sudo python3 pki-playground.py --create-deployment DEPLOYMENT_NAME HTTPS_PORT PKI_NAME DOMAIN_NAME +sudo python3 pki_playground.py --create-deployment DEPLOYMENT_NAME HTTPS_PORT PKI_NAME DOMAIN_NAME ``` This will initialise the deployments/DEPLOYMENT_NAME directory in the root of the repository, @@ -52,5 +52,5 @@ and create docker-compose.yaml and the host_additions files. To execute the deployment proceed with the following commands: ```shell -sudo python3 pki-playground.py --start-deployment DEPLOYMENT_NAME +sudo python3 pki_playground.py --start-deployment DEPLOYMENT_NAME ``` diff --git a/docs/source/conf.py b/docs/source/conf.py index b3733e3..e84988e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,6 +6,11 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import os +import sys + +sys.path.append(os.path.abspath('../..')) + project = 'Pki-Playground' copyright = '2023, DD' author = 'DD' @@ -14,15 +19,15 @@ # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = [] +extensions = ['sphinx.ext.autodoc', 'm2r'] templates_path = ['_templates'] exclude_patterns = [] - +# source_suffix = '.rst' +source_suffix = ['.rst', '.md'] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = 'alabaster' -html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst index d1587c2..6886025 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,60 +1,28 @@ PKI-Playground Documentation ============================== + .. toctree:: - :maxdepth: 2 - :caption: Contents: - - pki-playground + :maxdepth: 2 + :caption: Contents: + -.. automodule:: pki-playground +APP main +=================== +.. automodule:: pki_playground :members: :undoc-members: :show-inheritance: -Introduction ------------- - -This is the documentation for a Python 3 script that is used to generate self-signed certificates. The script is named `pki-playground.py`, and this documentation explains its usage and functionality. - -Usage ------ - -To use `pki-playground.py`, you can run it from the command line as follows. - -First of all you need to unlock the repository, to get access to the generated files: - - sudo apt-get update && apt-get install git-crypt - sudo python3 pki-playground.py --unlock KEY - -This command will decrypt the shipped with this repository git-crypt key and -unlock the pkis/ directory. - -After this, you need to initialize the PKI toolchain by entering the following command: - - sudo python3 pki-playground.py --pki-init PKI_NAME - -This will initialize the root CA/CN with the provided PKI_NAME. - -To create the server certificates, you need to explicitly specify the root -certificates(PKI) name as follows: - - sudo python3 pki-playground.py --create-server-cert PKI_NAME DOMAIN_NAME - -This will create the server certificates that are based on the PKI with the provided name. - -After that, you need to create the so-called deployment, which is a docker-compose file and -the text, that will be temoparily added to the /etc/hosts file. -To do this, type as follows: - - sudo python3 pki-playground.py --create-deployment DEPLOYMENT_NAME HTTPS_PORT PKI_NAME DOMAIN_NAME -This will initialise the deployments/DEPLOYMENT_NAME directory in the root of the repository, -and create docker-compose.yaml and the host_additions files. +Tutorial +-------- +.. mdinclude:: ../../README.md -To execute the deployment proceed with the following commands: - sudo python3 pki-playground.py --start-deployment DEPLOYMENT_NAME +Indices and tables +================== -This will initialize the deployment. After that you can locate to the https://DOMAIN_NAME:HTTPS_PORT -and enjoy the secured connection made by the self-signed certificates. +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/modules.rst b/docs/source/modules.rst deleted file mode 100644 index 6ba0ddc..0000000 --- a/docs/source/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -pki-playground -============== - -.. toctree:: - :maxdepth: 4 - - pki-playground diff --git a/docs/source/pki-playground.rst b/docs/source/pki-playground.rst deleted file mode 100644 index 2854638..0000000 --- a/docs/source/pki-playground.rst +++ /dev/null @@ -1,7 +0,0 @@ -pki\-playground module -====================== - -.. automodule:: pki-playground - :members: - :undoc-members: - :show-inheritance: diff --git a/pki-playground.py b/pki_playground.py similarity index 100% rename from pki-playground.py rename to pki_playground.py