A Python API client for managing DNS records via Strato's DNS service.
Project description
strato-acme
This repository contains
- Python API for acccess to DNS system for a domain hosted at strato.de
- Docker container for ready-to-go usage
Setup
Create strato-acme-config.json:
{
"location": "de", // Supports de and nl
"credentials": {
"username": "<username>",
"password": "<password>"
}
}
Make sure to make this file only readable for the user in the container:
sudo chmod 0400 strato-acme-config.json
Two-Factor Authentification
To be able to authenticate two-factor, device name and TOTP secret must be entered into the JSON. If it is not used, it can either be empty strings or the entries can be removed completely (see above).
{
"location": "de",
"credentials": {
"username": "<username>",
"password": "<password>",
"totp_secret": "<secret>",
"totp_devicename": "<devicename>"
}
}
Usage
Python API
When the package strato-dns-api is installed you can run it via
python3 -m strato_dns_api --config strato-acme-config.json get-records --domain example.com
This will return the current CNAME/TXT records available on this domain. For more commands, see the CLI help.
Docker
The repository also contains a ready-to-go docker container/image that wraps the acme.sh script and the python API for access to strato DNS. This allows for automatic certificate generation/renewals with wildcard support on domains hosted at Strato.
To build the image locally, run ./docker/build.sh --load to build the image for all supported platforms in the current version and load it into your local docker images
Requirements
- You need to create directory
configand place a file calledstrato-acme-config.jsoninside which is filled with your strato API config (see above)
This config folder should be mapped into the container under/strato-acme/configand will also then contain the acme.sh settings - You need to create a directory or a docker volume which should be mounted under
/strato-acme/certsto be able to persist and share certificates with other containers (e.g. traefik) - If you also want to persist logs, mount a folder under
/strato-acme/logs
For a reference, see docker-compose.yml
Create certificates
When the container is running in the background (e.g. via docker compose up -d ...) use the following command to trigger certificate generation:
docker exec strato_acme create-new-wildcard-cert.sh --domain <YOUR_DOMAIN> --email <YOUR_EMAIL> [optional acme.sh options]
This will then try to generate a wildcard certificate for <YOUR_DOMAIN> and *.<YOUR_DOMAIN>.
If generation was successfull, there will also be a cron job created to automatically renew the certificate before expiration (see official acme.sh docs).
If generation failed or you want to test, it is recommended to use the --staging option, so you dont get blocked by the rate limits of LE.
docker exec strato_acme create-new-wildcard-cert.sh --domain <YOUR_DOMAIN> --email <YOUR_EMAIL> --staging
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strato_dns_api-0.5.2.tar.gz.
File metadata
- Download URL: strato_dns_api-0.5.2.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d9161b9dc459d7ddaa4c4a21ab39de8ac2d8aa629644ea93a97d7689609d0d9
|
|
| MD5 |
b853f1f99d8d01f462a7f9b321005e3e
|
|
| BLAKE2b-256 |
4ff89b2d964bfef75ec45eb7084cc18e1c4defb2c94b086249c4636bcd89a994
|
Provenance
The following attestation bundles were made for strato_dns_api-0.5.2.tar.gz:
Publisher:
release.yml on Slinred/strato-acme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strato_dns_api-0.5.2.tar.gz -
Subject digest:
2d9161b9dc459d7ddaa4c4a21ab39de8ac2d8aa629644ea93a97d7689609d0d9 - Sigstore transparency entry: 1004407075
- Sigstore integration time:
-
Permalink:
Slinred/strato-acme@fd09ada1dd2e5102fb78d5dc0f2a177b81d91a3d -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/Slinred
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fd09ada1dd2e5102fb78d5dc0f2a177b81d91a3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file strato_dns_api-0.5.2-py3-none-any.whl.
File metadata
- Download URL: strato_dns_api-0.5.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f19baf47c02de5f219ce4b347371b85580cc16ba399a627dcd36d19ab4dc0707
|
|
| MD5 |
2e6ba664d1e15225be9cb6f6dda429bb
|
|
| BLAKE2b-256 |
8a07104f947b01ee601b45759a3f70580a9bde1e0f7be03edd36d63a76db00cd
|
Provenance
The following attestation bundles were made for strato_dns_api-0.5.2-py3-none-any.whl:
Publisher:
release.yml on Slinred/strato-acme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strato_dns_api-0.5.2-py3-none-any.whl -
Subject digest:
f19baf47c02de5f219ce4b347371b85580cc16ba399a627dcd36d19ab4dc0707 - Sigstore transparency entry: 1004407081
- Sigstore integration time:
-
Permalink:
Slinred/strato-acme@fd09ada1dd2e5102fb78d5dc0f2a177b81d91a3d -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/Slinred
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fd09ada1dd2e5102fb78d5dc0f2a177b81d91a3d -
Trigger Event:
push
-
Statement type: