diff --git a/.gitignore b/.gitignore index f2a277b..8981fc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .*.swp .idea/ build +.ropeproject/ diff --git a/Pipfile b/Pipfile index d8026a3..c9e13e7 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,8 @@ name = "pypi" [packages] sphinx = "*" GitPython = "*" +certifi = "*" +requests = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index fa55f10..eca8acd 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "417eb38160355888d7facf1e7b8f6c471a896147223b34b89d9944597a758c96" + "sha256": "1666cbe0230e5956dfa4b61f4811218f730e7937181a37ab44b32f0270d3bd11" }, "pipfile-spec": 6, "requires": { @@ -35,6 +35,7 @@ "sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c", "sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a" ], + "index": "pypi", "version": "==2018.10.15" }, "chardet": { @@ -57,7 +58,6 @@ "sha256:83361131a1836661a155172932a13c08bda2db3674e4caa32368aa6eb02f38c2", "sha256:e3a0141c5f2a3f635c7209d56c496ebe1ad35da82fe4d3ec4aaa36278d70648a" ], - "markers": "python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*' and python_version >= '2.7'", "version": "==2.0.5" }, "gitpython": { @@ -66,7 +66,6 @@ "sha256:8237dc5bfd6f1366abeee5624111b9d6879393d84745a507de0fda86043b65a8" ], "index": "pypi", - "markers": "python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*' and python_version >= '2.7'", "version": "==2.1.11" }, "idna": { @@ -81,7 +80,6 @@ "sha256:3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", "sha256:f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5" ], - "markers": "python_version != '3.2.*' and python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.3.*' and python_version >= '2.7'", "version": "==1.1.0" }, "jinja2": { @@ -102,7 +100,6 @@ "sha256:0886227f54515e592aaa2e5a553332c73962917f2831f1b0f9b9f4380a4b9807", "sha256:f95a1e147590f204328170981833854229bb2912ac3d5f89e2a8ccd2834800c9" ], - "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.6'", "version": "==18.0" }, "pygments": { @@ -117,7 +114,6 @@ "sha256:bc6c7146b91af3f567cf6daeaec360bc07d45ffec4cf5353f4d7a208ce7ca30a", "sha256:d29593d8ebe7b57d6967b62494f8c72b03ac0262b1eed63826c6f788b3606401" ], - "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.6'", "version": "==2.2.2" }, "pytz": { @@ -132,7 +128,7 @@ "sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c", "sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279" ], - "markers": "python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*' and python_version < '4' and python_version >= '2.7'", + "index": "pypi", "version": "==2.20.0" }, "six": { @@ -147,7 +143,6 @@ "sha256:0555a7bf4df71d1ef4218e4807bbf9b201f910174e6e08af2e138d4e517b4dde", "sha256:29a9ffa0497e7f2be94ca0ed1ca1aa3cd4cf25a1f6b4f5f87f74b46ed91d609a" ], - "markers": "python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*' and python_version >= '2.7'", "version": "==2.0.5" }, "snowballstemmer": { @@ -170,16 +165,14 @@ "sha256:68ca7ff70785cbe1e7bccc71a48b5b6d965d79ca50629606c7861a21b206d9dd", "sha256:9de47f375baf1ea07cdb3436ff39d7a9c76042c10a769c52353ec46e4e8fc3b9" ], - "markers": "python_version != '3.1.*' and python_version != '3.0.*' and python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.2.*'", "version": "==1.1.0" }, "urllib3": { "hashes": [ - "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", - "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" + "sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae", + "sha256:8819bba37a02d143296a4d032373c4dd4aca11f6d4c9973335ca75f9c8475f59" ], - "markers": "python_version != '3.1.*' and python_version != '3.0.*' and python_version < '4' and python_version != '3.3.*' and python_version != '3.2.*' and python_version >= '2.6'", - "version": "==1.23" + "version": "==1.24" } }, "develop": {} diff --git a/cacert.pem b/cacert.pem new file mode 100644 index 0000000..51cbcb5 --- /dev/null +++ b/cacert.pem @@ -0,0 +1,83 @@ +-----BEGIN CERTIFICATE----- +MIIHWTCCBUGgAwIBAgIDCkGKMA0GCSqGSIb3DQEBCwUAMHkxEDAOBgNVBAoTB1Jv +b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ +Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y +dEBjYWNlcnQub3JnMB4XDTExMDUyMzE3NDgwMloXDTIxMDUyMDE3NDgwMlowVDEU +MBIGA1UEChMLQ0FjZXJ0IEluYy4xHjAcBgNVBAsTFWh0dHA6Ly93d3cuQ0FjZXJ0 +Lm9yZzEcMBoGA1UEAxMTQ0FjZXJ0IENsYXNzIDMgUm9vdDCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBAKtJNRFIfNImflOUz0Op3SjXQiqL84d4GVh8D57a +iX3h++tykA10oZZkq5+gJJlz2uJVdscXe/UErEa4w75/ZI0QbCTzYZzA8pD6Ueb1 +aQFjww9W4kpCz+JEjCUoqMV5CX1GuYrz6fM0KQhF5Byfy5QEHIGoFLOYZcRD7E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nRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF +CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum +GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk +zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW +omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD +-----END CERTIFICATE----- diff --git a/source/_static/.keep b/source/_static/.keep new file mode 100644 index 0000000..e69de29 diff --git a/source/building.rst b/source/building.rst new file mode 100644 index 0000000..f07f72d --- /dev/null +++ b/source/building.rst @@ -0,0 +1,81 @@ +========================== +Building the documentation +========================== + +This documentation is maintained as a set of ReStructuredText documents and +uses `Sphinx `_ to build HTML formatted +representations of the documents. + +Getting the documentation source +-------------------------------- + +The documentation is available from the git repository cacert-codedocs on +git.cacert.org. You can browse the `repository +`_ via gitweb. + +You can clone the repository anonymously by executing:: + + git clone git://git.cacert.org/cacert-codedocs.git + +If you want to contribute to the documentation please ask git-admin@cacert.org +to setup a user in the group git-doc on git.cacert.org for you. You will have +to provide an SSH public key (either RSA with at least 2048 Bits modulus or an +ECDSA or ED25519 key with similar strength) with your request. + +If you have a user in the git-doc group you can clone the repository by +executing:: + + git clone ssh://@git.cacert.org/var/cache/git/cacert-codedocs.git + +.. note:: replace ```` with your actual username + +Building with Sphinx +-------------------- + +To build this documentation you need a Python 3 installation. To isolate the +documentation build from your system Python 3 packages using a virtual +environment is recommended. Management of the virtual environment can be done +with pipenv as described below. + +Python 3 installation instructions can be found on the `Python website`_. + +.. _Python website: https://www.python.org/ + +.. topic:: Building the documentation on a Debian system + + The following example shows how to build the documentation on a Debian system: + + .. code-block:: bash + + # Install required operating system packages + sudo apt-get install python3 python3-pip make + # install pipenv + python3 -m pip install -U pip pipenv + # use pipenv to install require dependencies into a virtual environment + pipenv install + # Build the documentation + pipenv run make html + + .. note:: + + The above commands should be run from the root directory of a git clone + of the cacert-codedocs git repository. The result of the :program:`make` + exection will be available in the :file:`build/html/` directory + directory. + +Continuous integration +---------------------- + +If changes are pushed to the cacert-codedocs git repository on git.cacert.org +a `Jenkins Job `_ is +automatically triggered. If the documentation is built successfully it can be +viewed in the `docs/_build/html directory of the Job's workspace +`_. You may +open `index.html +`_ +to browse the documentation (there are some JavaScript and SVG glitches due to +Content-Security-Policy settings). + +If the documentation build is successful the result is pushed to a webserver +document root on :doc:`infradocs:systems/webstatic` and is publicly available at +https://codedocs.cacert.org/. diff --git a/source/conf.py b/source/conf.py index a80f538..f3750f4 100644 --- a/source/conf.py +++ b/source/conf.py @@ -14,10 +14,26 @@ # from datetime import datetime import os +import certifi +import requests # import sys # sys.path.insert(0, os.path.abspath('.')) from git import repo +from docutils import nodes, utils + +try: + print('Checking connection to infradocs.cacert.org') + requests.head('https://infradocs.cacert.org/') + print('Connection to infradocs.cacert.org OK') +except requests.exceptions.SSLError as err: + print('SSL Error. Adding CAcert certificates to Certifi store...') + cafile = certifi.where() + with open(os.path.join( + os.path.dirname(__file__), '..', 'cacert.pem'), 'rb') as infile: + cacertca = infile.read() + with open(cafile, 'ab') as outfile: + outfile.write(cacertca) # -- Project information ----------------------------------------------------- @@ -29,10 +45,8 @@ author = 'CAcert development team' version = '0.1' # The full version, including alpha/beta/rc tags release = "{}-git:{} built:{}".format( - version, - repo.Repo('..').git.describe('--always', '--dirty'), - datetime.utcnow().replace(microsecond=0)) - + version, repo.Repo('..').git.describe('--always', '--dirty'), + datetime.utcnow().replace(microsecond=0)) # -- General configuration --------------------------------------------------- @@ -197,7 +211,7 @@ epub_exclude_files = ['search.html'] # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/': None} +intersphinx_mapping = {'infradocs': ('https://infradocs.cacert.org', None)} # -- Options for todo extension ---------------------------------------------- diff --git a/source/index.rst b/source/index.rst index bb39a6d..e1abc94 100644 --- a/source/index.rst +++ b/source/index.rst @@ -3,8 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to CAcert code documentation -==================================== +CAcert code documentation +========================= This is a work in progress documentation of the CAcert web application source code at https://git.cacert.org/gitweb/?p=cacert.git. @@ -17,6 +17,8 @@ reimplementation. :maxdepth: 2 :caption: Contents: + building + Filesystem structure --------------------