Skip to content
Snippets Groups Projects
Commit 5c3323a3 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

L2SS-2063: Add certificate documentation

parent fef103f9
No related branches found
No related tags found
2 merge requests!3L2SS-2063: Add certificate documentation,!2L2SS-2063: Add certificate documentation
Pipeline #101163 passed with warnings
Pipeline: Cryptocoryne

#101164

    # Cryptocoryne
    # Stingray
    ![Build status](git@git.astron.nl:lofar2.0/cryptocoryne/badges/main/pipeline.svg)
    ![Test coverage](git@git.astron.nl:lofar2.0/cryptocoryne/badges/main/coverage.svg)
    ![Build status](git.astron.nl/lofar2.0/cryptocoryne/badges/main/pipeline.svg)
    ![Test coverage](git.astron.nl/lofar2.0/cryptocoryne/badges/main/coverage.svg)
    <!-- ![Latest release](https://git.astron.nl/templates/python-package/badges/main/release.svg) -->
    An example repository of an CI/CD pipeline for building, testing and publishing a python package.
    Cryptocoryne registeres and renews certificates for the lofar.net domain based on consul service registrations.
    ## Installation
    ```
    pip install .
    ```
    ## Usage
    ```python
    from lofar-cryptocoryne import cool_module
    cool_module.greeter() # prints "Hello World"
    Cryptocoryne runs periodically on the central nomad cluster.
    Every 5 minutes, cryptocoryne queries all services registered within consul that have the tag `cert`.
    Then the certificate `<service_name>.lofar.net` is registered or renewed (if needed) and stored in the LOFAR vault.
    Services then have the option to retrieve the certificates from the vault using nomads job templating:
    ```hcl
    template {
    data = <<EOH
    {{with secret "lets-encrypt/certificates/<service_name>.lofar.net" -}}
    {{.Data.data.cert }}
    {{.Data.data.chain -}}
    {{end}}
    EOH
    destination = "${NOMAD_SECRETS_DIR}/fullchain.cer"
    }
    template {
    data = <<EOH
    {{with secret "lets-encrypt/certificates/<service_name>.lofar.net" -}}
    {{.Data.data.key -}}
    {{end}}
    EOH
    destination = "${NOMAD_SECRETS_DIR}/key.key"
    }
    ```
    ## Contributing
    To contribute, please create a feature branch and a "Draft" merge request.
    ......@@ -29,7 +50,7 @@ changes is done through `tox`.
    ```pip install tox```
    With tox the same jobs as run on the CI/CD pipeline can be ran. These
    With tox the same jobs as run on the CI/CD pipeline can be run. These
    include unit tests and linting.
    ```tox```
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment