Crates.io | transip |
lib.rs | transip |
version | 0.4.0 |
source | src |
created_at | 2023-10-20 14:27:49.611593 |
updated_at | 2024-07-20 18:44:53.464632 |
description | Call functions on the Transip Api Endpoint |
homepage | |
repository | https://github.com/paulusminus/transip |
max_upload_size | |
id | 1009037 |
size | 126,177 |
This library crate can be used for calling functions on the Transip Api
endpoint.
Only part of the api is implemented. The main reason for writing this library is the ability
to CRUD
dns records for a particular domain. This functionality can be used to respond to DNS01 challenges from the Let's Encrypt
servers.
This type of challenge is needed to get wildcard certificates.
use transip::{configuration_from_environment, Client, api::general::GeneralApi};
let mut client = configuration_from_environment()
.and_then(Client::try_from)
.expect("No cliƫnt");
let pong = client.api_test().expect("api test failed");
assert_eq!(pong.as_str(), "pong");
The following environment variables should be set!.
This is the username used in authentication
Example
export TRANSIP_API_USERNAME=paulusminus
This is the name of the file that holds the pem encoded private key used in authentication
Example
export TRANSIP_API_PRIVATE_KEY=/etc/transip/private.pem
Can be 'true' or 'false'. If you wan't to prevent accidental modifications set this to 'true'.
Example
export TRANSIP_API_READONLY=false
Can be 'true' or 'false'. Use true if on a ipv6 only (virtual) machine.
Example
export TRANSIP_API_IPV6ONLY=false
Can be 'true' or 'false'. If you wan't to access the api on a whitelisted ipaddress set this to 'true'.
Authentication means receiving a token. The interval in which the received will expired can be controlled.
export TRANSIP_API_TOKEN_EXPIRATION=5 minutes
export TRANSIP_API_TOKEN_EXPIRATION=55 seconds
export TRANSIP_API_TOKEN_EXPIRATION=1 hour
Directory where the rotating log files are written.
export TRANSIP_API_LOG_DIR=/var/log/transip
Name of the file where the authentication token received from the endpoint will be written to.
export TRANSIP_API_TOKEN_PATH=/root/.token.txt