Skip to content

Commit d57d884

Browse files
authored
Remove server (#84)
1 parent 571bad0 commit d57d884

File tree

11 files changed

+17
-1902
lines changed

11 files changed

+17
-1902
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ repository = "https://github.com/casey/filepack"
1313
include = ["CHANGELOG.md", "CONTRIBUTING", "LICENSE", "README.md", "src", "tests"]
1414

1515
[dependencies]
16-
axum = "0.8.4"
1716
blake3 = { version = "1.5.4", features = ["mmap", "rayon", "serde"] }
18-
boilerplate = { version = "1.0.1", features = ["axum"] }
1917
camino = { version = "1.1.9", features = ["serde1"] }
2018
clap = { version = "4.5.16", features = ["derive"] }
2119
clap_mangen = "0.2.23"
2220
dirs = "5.0.1"
2321
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
2422
hex = "0.4.3"
25-
html-escaper = "0.2.0"
2623
indicatif = "0.17.8"
2724
lexiclean = "0.0.1"
2825
owo-colors = "4"
@@ -32,18 +29,13 @@ serde_json = "1.0.127"
3229
serde_with = "3.11.0"
3330
serde_yaml = "0.9.34"
3431
snafu = "0.8.4"
35-
tokio = { version = "1.46.1", features = ["rt-multi-thread"] }
3632
walkdir = "2.5.0"
3733

3834
[dev-dependencies]
3935
assert_cmd = { version = "2.0.16", features = ["color-auto"] }
4036
assert_fs = { version = "1.1.2", features = ["color-auto"] }
41-
axum-test = "17.3.0"
42-
executable-path = "1.0.0"
4337
predicates = "3.1.2"
44-
pretty_assertions = "1.4.1"
4538
regex = "1.10.6"
46-
reqwest = { version = "0.12.22", features = ["blocking"] }
4739

4840
[lints.clippy]
4941
all = { level = "deny", priority = -1 }

src/bytes.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/error.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,6 @@ pub(crate) enum Error {
129129
backtrace: Option<Backtrace>,
130130
path: DisplayPath,
131131
},
132-
#[snafu(display("failed to bind server to `{address}:{port}`"))]
133-
ServerBind {
134-
address: String,
135-
backtrace: Option<Backtrace>,
136-
port: u16,
137-
source: io::Error,
138-
},
139-
#[snafu(display("failed to run server"))]
140-
ServerRun {
141-
backtrace: Option<Backtrace>,
142-
source: io::Error,
143-
},
144-
#[snafu(display("failed to initialize server runtime"))]
145-
ServerRuntime {
146-
backtrace: Option<Backtrace>,
147-
source: io::Error,
148-
},
149132
#[snafu(display("manifest has already been signed by public key `{public_key}`"))]
150133
SignatureAlreadyExists {
151134
backtrace: Option<Backtrace>,

src/main.rs

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
use {
22
self::{
3-
arguments::Arguments, bytes::Bytes, display_path::DisplayPath, display_secret::DisplaySecret,
4-
entry::Entry, error::Error, hash::Hash, lint::Lint, lint_group::LintGroup, list::List,
5-
manifest::Manifest, metadata::Metadata, options::Options, owo_colorize_ext::OwoColorizeExt,
6-
package::Package, private_key::PrivateKey, public_key::PublicKey, relative_path::RelativePath,
3+
arguments::Arguments, display_path::DisplayPath, display_secret::DisplaySecret, entry::Entry,
4+
error::Error, hash::Hash, lint::Lint, lint_group::LintGroup, list::List, manifest::Manifest,
5+
metadata::Metadata, options::Options, owo_colorize_ext::OwoColorizeExt,
6+
private_key::PrivateKey, public_key::PublicKey, relative_path::RelativePath,
77
signature::Signature, signature_error::SignatureError, style::Style, subcommand::Subcommand,
88
template::Template, utf8_path_ext::Utf8PathExt,
99
},
1010
blake3::Hasher,
11-
boilerplate::Boilerplate,
1211
camino::{Utf8Component, Utf8Path, Utf8PathBuf},
1312
clap::{Parser, ValueEnum},
14-
html_escaper::{Escape, Trusted},
1513
indicatif::{ProgressBar, ProgressStyle},
1614
lexiclean::Lexiclean,
1715
owo_colors::Styled,
@@ -30,51 +28,14 @@ use {
3028
path::{Path, PathBuf},
3129
process,
3230
str::{self, FromStr},
33-
sync::Arc,
3431
},
35-
tokio::runtime::Runtime,
3632
walkdir::WalkDir,
3733
};
3834

3935
#[cfg(test)]
40-
use {
41-
assert_fs::{
42-
fixture::{FileWriteStr, PathChild, PathCreateDir},
43-
TempDir,
44-
},
45-
std::ffi::OsString,
46-
};
47-
48-
#[cfg(test)]
49-
macro_rules! command {
50-
( $($argument:expr),* $(,)?) => {
51-
{
52-
#![allow(clippy::vec_init_then_push)]
53-
54-
let mut arguments = Vec::<OsString>::new();
55-
56-
arguments.push("filepack".into());
57-
58-
arguments.push("--quiet".into());
59-
60-
$(
61-
arguments.push($argument.into());
62-
)*
63-
64-
let arguments = match Arguments::try_parse_from(arguments) {
65-
Ok(arguments) => arguments,
66-
Err(error) => {
67-
panic!("{error}");
68-
}
69-
};
70-
71-
arguments.run().unwrap();
72-
}
73-
};
74-
}
36+
use assert_fs::TempDir;
7537

7638
mod arguments;
77-
mod bytes;
7839
mod display_path;
7940
mod display_secret;
8041
mod entry;
@@ -88,7 +49,6 @@ mod manifest;
8849
mod metadata;
8950
mod options;
9051
mod owo_colorize_ext;
91-
mod package;
9252
mod private_key;
9353
mod progress_bar;
9454
mod public_key;

src/manifest.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ impl Manifest {
4848
pub(crate) fn store(&self, path: &Utf8Path) -> Result<()> {
4949
filesystem::write(path, format!("{}\n", serde_json::to_string(self).unwrap()))
5050
}
51-
52-
pub(crate) fn total_size(&self) -> u64 {
53-
self.files.values().map(|entry| entry.size).sum()
54-
}
5551
}
5652

5753
#[cfg(test)]

src/package.rs

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/subcommand.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod hash;
1212
mod key;
1313
mod keygen;
1414
mod man;
15-
mod server;
1615
mod sign;
1716
mod verify;
1817

@@ -39,8 +38,6 @@ pub(crate) enum Subcommand {
3938
Keygen,
4039
#[command(about = "Print man page")]
4140
Man,
42-
#[command(about = "Run server")]
43-
Server(server::Server),
4441
#[command(about = "Sign manifest")]
4542
Sign(sign::Sign),
4643
#[command(about = "Verify manifest")]
@@ -56,7 +53,6 @@ impl Subcommand {
5653
Self::Key => key::run(options),
5754
Self::Keygen => keygen::run(options),
5855
Self::Man => man::run(),
59-
Self::Server(server) => server.run(),
6056
Self::Sign(sign) => sign.run(options),
6157
Self::Verify(verify) => verify.run(options),
6258
}

0 commit comments

Comments
 (0)