MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / new_certbot

Function new_certbot

certbot/src/bot/tests.rs:11–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9use super::*;
10
11async fn new_certbot() -> Result<CertBot> {
12 let cf_api_token = std::env::var("CLOUDFLARE_API_TOKEN").expect("CLOUDFLARE_API_TOKEN not set");
13 let domains = vec![std::env::var("TEST_DOMAIN").expect("TEST_DOMAIN not set")];
14 let config = CertBotConfig::builder()
15 .acme_url(LetsEncrypt::Staging.url())
16 .auto_create_account(true)
17 .credentials_file("./test-workdir/credentials.json")
18 .cf_api_token(cf_api_token)
19 .cert_dir("./test-workdir/backup")
20 .cert_file("./test-workdir/live/cert.pem")
21 .key_file("./test-workdir/live/key.pem")
22 .cert_subject_alt_names(domains)
23 .renew_interval(Duration::from_secs(30))
24 .renew_timeout(Duration::from_secs(120))
25 .renew_expires_in(Duration::from_secs(7772187))
26 .max_dns_wait(Duration::from_secs(300))
27 .auto_set_caa(false)
28 .build();
29 config.build_bot().await
30}
31
32#[tokio::test]
33async fn test_certbot() {

Callers 1

test_certbotFunction · 0.85

Calls 3

renew_intervalMethod · 0.80
build_botMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected