Skip to content

Commit 6d35ad1

Browse files
committed
fix, build temporary image
1 parent 82882bf commit 6d35ad1

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

.github/workflows/http-01.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build http-01 image
2+
permissions:
3+
contents: read
4+
id-token: write
5+
packages: write
6+
on:
7+
push:
8+
branches:
9+
- http-01
10+
paths-ignore:
11+
- "*.md"
12+
- "LICENSE"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build-http-01:
20+
uses: ./.github/workflows/build-docker.yml
21+
with:
22+
flavor: |
23+
latest=false
24+
tags: |
25+
type=raw,value=2.0.0-http-01

crates/defguard_core/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ pub async fn run_web_server(
690690

691691
if let Some((cert_pem, key_pem)) = tls_cert_pair {
692692
let tls_config =
693-
RustlsConfig::from_pem(cert_pem.into_bytes().into(), key_pem.into_bytes().into())
693+
RustlsConfig::from_pem(cert_pem.into_bytes(), key_pem.into_bytes())
694694
.await
695695
.map_err(|err| anyhow!("Failed to load TLS config: {err}"))?;
696696
axum_server::bind_rustls(addr, tls_config)
@@ -748,10 +748,12 @@ pub async fn init_dev_env(config: &DefGuardConfig) {
748748
.await
749749
.expect("Failed to update settings");
750750

751-
let mut certs = Certificates::default();
752-
certs.ca_cert_der = Some(ca.cert_der().to_vec());
753-
certs.ca_key_der = Some(ca.key_pair_der().to_vec());
754-
certs.ca_expiry = Some(ca.expiry().expect("Failed to get CA expiry"));
751+
let certs = Certificates {
752+
ca_cert_der: Some(ca.cert_der().to_vec()),
753+
ca_key_der: Some(ca.key_pair_der().to_vec()),
754+
ca_expiry: Some(ca.expiry().expect("Failed to get CA expiry")),
755+
..Default::default()
756+
};
755757
certs
756758
.save(&pool)
757759
.await

0 commit comments

Comments
 (0)