Skip to content

Commit 3a8b683

Browse files
committed
release 2.2.4
1 parent 733d7d4 commit 3a8b683

31 files changed

+605
-209
lines changed

.github/workflows/spa-client-cd.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- os: macos-latest
2121
name: mac-spa-client
2222
bash: make release-client-mac
23-
- os: windows-latest
23+
- os: windows-latest
2424
name: windows-spa-client
2525
bash: make release-client-win
2626
runs-on: ${{ matrix.settings.os }}
@@ -29,21 +29,7 @@ jobs:
2929
uses: actions/checkout@v3
3030
with:
3131
submodules: true
32-
33-
- name: Install Rust
34-
uses: actions-rs/toolchain@v1
35-
with:
36-
toolchain: stable
37-
- name: Cache cargo registry
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.cargo/registry
41-
key: ${{ matrix.settings.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
42-
- name: Cache cargo index
43-
uses: actions/cache@v2
44-
with:
45-
path: ~/.cargo/git
46-
key: ${{ matrix.settings.os }}-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
32+
- uses: Swatinem/rust-cache@v2
4733
- name: Setup MUSL
4834
if: matrix.settings.os == 'ubuntu-latest'
4935
run: |
@@ -53,7 +39,6 @@ jobs:
5339
- name: Build Release
5440
run: ${{ matrix.settings.bash }}
5541

56-
5742
- name: Upload artifact
5843
uses: actions/upload-artifact@v4
5944
with:

.github/workflows/spa-server-cd.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,11 @@ jobs:
4747
- uses: actions/checkout@v3
4848
with:
4949
submodules: true
50-
- name: Install Rust
51-
uses: actions-rs/toolchain@v1
52-
with:
53-
toolchain: stable
54-
55-
- name: Cache cargo registry
56-
uses: actions/cache@v2
57-
with:
58-
path: ~/.cargo/registry
59-
key: cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
60-
61-
- name: Cache cargo index
62-
uses: actions/cache@v2
63-
with:
64-
path: ~/.cargo/git
65-
key: cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
66-
50+
- uses: Swatinem/rust-cache@v2
6751
- name: Setup MUSL
6852
run: |
6953
rustup target add x86_64-unknown-linux-musl
7054
sudo apt-get -qq install musl-tools
71-
7255
- name: Build Release Linux
7356
run: make release-linux-server-musl
7457

.github/workflows/spa-server-ci.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,16 @@ jobs:
1414
- uses: actions/checkout@v3
1515
with:
1616
submodules: true
17-
- name: Install Rust
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: stable
21-
- name: Cache cargo registry
22-
uses: actions/cache@v2
23-
with:
24-
path: ~/.cargo/registry
25-
key: cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
26-
- name: Cache cargo index
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.cargo/git
30-
key: cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
31-
- name: build all
32-
run: cargo build
33-
- name: run spa-client test
34-
run: cargo test -p spa-client
35-
- name: run spa-client test
36-
run: cargo test -p spa-server
17+
- uses: Swatinem/rust-cache@v2
3718
- name: run integration test
3819
# --show-output
3920
run: cargo test -p tests --test starter -j 1 -- --test-threads 1
4021
- name: run pebble
4122
run: ./run_pebble.sh
4223
working-directory: ./tests/bash/
4324
- name: run acme integration test
44-
run: cargo test -p tests --test acme_test -j 1 -- --test-threads 1
25+
run: cargo test -p tests --test acme_test -j 1 -- --test-threads 1
26+
- name: run spa-client test
27+
run: cargo test -p spa-client
28+
- name: run spa-client test
29+
run: cargo test -p spa-server

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spa-client"
3-
version = "2.2.3"
3+
version = "2.2.4"
44
edition = "2021"
55
authors = ["timzaak"]
66
license = "MIT"

client/src/api.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use crate::Config;
22
use anyhow::anyhow;
33
use reqwest::{header, multipart, StatusCode};
4-
use spa_server::admin_server::request::{
5-
DeleteDomainVersionOption, DomainWithOptVersionOption, GetDomainOption,
6-
UpdateUploadingStatusOption,
7-
};
8-
use spa_server::domain_storage::{DomainInfo, ShortMetaData, UploadDomainPosition};
4+
use spa_server::admin_server::request::{DeleteDomainVersionOption, DomainWithOptVersionOption, DomainWithVersionOption, GetDomainOption, UpdateUploadingStatusOption};
5+
use spa_server::domain_storage::{CertInfo, DomainInfo, ShortMetaData, UploadDomainPosition};
96
use std::borrow::Cow;
107
use std::path::PathBuf;
118

@@ -129,6 +126,19 @@ impl API {
129126
handle!(resp)
130127
}
131128

129+
pub async fn revoke_version(&self, domain:String, version:u32) -> anyhow::Result<()> {
130+
let resp = self
131+
.async_client
132+
.post(self.url("files/revoke_version"))
133+
.json(&DomainWithVersionOption {
134+
domain,
135+
version,
136+
})
137+
.send()
138+
.await?;
139+
handle!(resp)
140+
}
141+
132142
//TODO: use thiserror instead of anyhow
133143
pub async fn upload_file<T: Into<Cow<'static, str>>>(
134144
&self,
@@ -185,6 +195,12 @@ impl API {
185195
.await?;
186196
json_resp!(resp, UploadDomainPosition)
187197
}
198+
199+
pub async fn get_acme_cert_info(&self, domain: Option<String>) -> anyhow::Result<Vec<CertInfo>> {
200+
let resp = self.async_client.get(self.url("cert/acme"))
201+
.query(&GetDomainOption{domain}).send().await?;
202+
json_resp!(resp, Vec<CertInfo>)
203+
}
188204
}
189205
#[cfg(test)]
190206
mod test {

client/src/commands.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ pub enum Commands {
2525
domain: Option<String>,
2626
max_reserve: Option<u32>,
2727
},
28+
Revoke {
29+
domain: String,
30+
version: u32,
31+
}
2832
}
2933

3034
#[derive(Args, Debug)]
@@ -116,4 +120,15 @@ mod test {
116120
unreachable!()
117121
}
118122
}
123+
124+
#[test]
125+
fn revoke_version() {
126+
let c = CliCommand::parse_from(&["test", "revoke", "www.example.com", "1"]);
127+
if let Commands::Revoke {domain, version} = c.commands {
128+
assert_eq!(domain, "www.example.com".to_string());
129+
assert_eq!(version, 1);
130+
} else {
131+
unreachable!()
132+
}
133+
}
119134
}

client/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ async fn run_with_commands(commands: CliCommand) -> anyhow::Result<()> {
6262
api.remove_files(domain, max_reserve).await?;
6363
success("delete success!");
6464
}
65+
Commands::Revoke {domain, version} => {
66+
api.revoke_version(domain, version).await?;
67+
success("revoke success!");
68+
}
6569
};
6670
Ok(())
6771
}

config.release.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ file_dir = "/data"
2828
// # directory to store account and certificate
2929
// # optional, default is ${file_dir}/acme
3030
// // dir = "/data/acme"
31-
// # ci / stage / prod, default is prod
31+
// # ci / stage / prod, default is prod, ci is just for CI test with Pebble, don't use it.
3232
// //type = prod
3333
// }
3434

docs/develop/change-log.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Change Log
2+
3+
### Version 2.2.4
4+
5+
- feat: add cert query API (no doc, no client SDK support)
6+
- improve: add check when upload of multiple/single domain
7+
- ci: improve GitHub Action speed
8+
- feat: add revoke version API (release JS SDK 2.2.4)
9+
210
### Version 2.2.3
311
- fix: sub_path '' => '/', like GitHub pages
412
- fix: redirect with no querystring

0 commit comments

Comments
 (0)