Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 0814b72

Browse files
Variable ACME account email (#61)
* work * add variable to .env.example * Update docs/local_setup.md Co-authored-by: Rick Lambrechts <[email protected]> --------- Co-authored-by: Rick Lambrechts <[email protected]>
1 parent 604fbb0 commit 0814b72

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
YUBIKEY_PIN="123456"
22
ACME_SERVER_DIRECTORY_URL="https://acme.proeftuin.uzi-online.irealisatie.nl/directory"
3-
OIDC_PROVIDER_BASE_URL="https://proeftuin.uzi-online.irealisatie.nl"
3+
OIDC_PROVIDER_BASE_URL="https://proeftuin.uzi-online.irealisatie.nl"
4+
ACME_ACCOUNT_EMAIL="[email protected]"

app/appacme.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
from os import getenv
12
from app.acme_directory_configuration import ACMEDirectoryConfiguration
23
from .acme import Acme
34

45

56
class ACME:
7+
_DEFAULT_ACME_ACCOUNT_EMAIL = "[email protected]"
8+
69
nonce = None
710
jwt_token = ""
811
client = None
@@ -32,7 +35,12 @@ def __init__(
3235
Create an account. As per acme standard an email needs
3336
to be provided.
3437
"""
35-
areq = {"termsOfServiceAgreed": True, "contact": ["mailto:[email protected]"]}
38+
account_email: str = getenv("ACME_ACCOUNT_EMAIL", self._DEFAULT_ACME_ACCOUNT_EMAIL)
39+
40+
areq = {
41+
"termsOfServiceAgreed": True,
42+
"contact": [f"mailto:{account_email}"],
43+
}
3644
self.client.account_request(areq)
3745

3846
def order(self, keynum):

docs/local_setup.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# Local setup
2+
23
First clone this repository and checkout the desired branch. You can then follow this document to set up and run the application.
34

45
```bash
56
git clone [email protected]:minvws/nl-uzipoc-yubisign.git
67
```
8+
79
## Requirements
10+
811
This application requires the [`yubico-piv-tool`](https://developers.yubico.com/yubico-piv-tool/) installed on your computer and therefor the `libykcs11` library. The `yubico-piv-tool` needs to be available in your system path. Next to that, the [`ykman`](https://developers.yubico.com/yubikey-manager/Releases/) CLI is also required in your path. make sure you have the following tools:
912

1013
- **`python3.13`**: Make sure the executable is also accessible from your local terminal.
1114
- **`git`**: To update the application when needed.
1215

13-
This application should be used with the [Yubikey 5C NFC]( https://www.yubico.com/nl/product/yubikey-5-series/yubikey-5c-nfc/).
16+
This application should be used with the [Yubikey 5C NFC](https://www.yubico.com/nl/product/yubikey-5-series/yubikey-5c-nfc/).
1417

1518
#### Windows specific
19+
1620
> When installing Python on Windows, make sure to add `python.exe` to your PATH and disable path length limit during the installation.
1721
1822
> The PIV tool can be installed via [this link](https://developers.yubico.com/yubico-piv-tool/Releases/).
@@ -33,6 +37,7 @@ First, verify if the Python version was set to `3.13`
3337
```bash
3438
python --version
3539
```
40+
3641
Then to create an isolated environment where we can install the Python requirements in, use the below command to use the `venv` package.
3742

3843
```bash
@@ -59,11 +64,12 @@ pip install -r requirements.in
5964

6065
There are a few environmnent variables which need to be configured via the `.env` file. For this, copy and rename the `.env.example` file and fill in the corresponding values. See the table underneath for the examples.
6166

62-
| Variable | Default value | Type |
63-
| :-------------------------: | :------------------------------------------------------------: | :---: |
67+
| Variable | Default value | Type |
68+
| :-------------------------: | :----------------------------------------------------------: | :---: |
6469
| `ACME_SERVER_DIRECTORY_URL` | `"https://acme.proeftuin.uzi-online.rdobeheer.nl/directory"` | `str` |
65-
| `YUBIKEY_PIN` | `"123456"` | `str` |
66-
| `OIDC_PROVIDER_BASE_URL` | `"https://proeftuin.uzi-online.irealisatie.nl"` | `str` |
70+
| `YUBIKEY_PIN` | `"123456"` | `str` |
71+
| `ACME_ACCOUNT_EMAIL` | `"[email protected]"` | `str` |
72+
| `OIDC_PROVIDER_BASE_URL` | `"https://proeftuin.uzi-online.irealisatie.nl"` | `str` |
6773

6874
The `ACME_SERVER_DIRECTORY_URL` should be set to the the directory URL of the ACME server. For example, this can be `http://localhost:8080/acme/directory` when working with the local ACME server developed by iRealisatie.
6975

@@ -88,6 +94,7 @@ This screen allows you to select a YubiKey. Select yours and click continue.
8894
![alt text](image-1.png)
8995

9096
#### 2.3 Creating the RSA keys
97+
9198
This step creates the RSA keys on the selected Yubikey. In here, tick the checkbox and click continue.
9299
![](./image-2.png)
93100

0 commit comments

Comments
 (0)