meta: prepare for publishing
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I02ee54baee048c58a480522ce79159eb6a6a6964
This commit is contained in:
parent
b1f3b4b1ff
commit
265a30d3c8
18 changed files with 102 additions and 78 deletions
|
|
@ -3,9 +3,12 @@ members = [ "crates/*", "ncro" ]
|
|||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
edition = "2024"
|
||||
license = "EUPL-1.2"
|
||||
version = "2.0.0"
|
||||
description = "Nix Cache Route Optimizer"
|
||||
edition = "2024"
|
||||
homepage = "https://github.com/notashelf/ncro"
|
||||
license = "EUPL-1.2"
|
||||
repository = "https://github.com/notashelf/ncro"
|
||||
version = "2.0.0"
|
||||
|
||||
[workspace.dependencies]
|
||||
# Workspace components
|
||||
|
|
|
|||
|
|
@ -1,39 +1,39 @@
|
|||
[server]
|
||||
listen = ":8080"
|
||||
read_timeout = "30s"
|
||||
listen = ":8080"
|
||||
read_timeout = "30s"
|
||||
write_timeout = "30s"
|
||||
|
||||
[[upstreams]]
|
||||
url = "https://cache.nixos.org"
|
||||
priority = 10
|
||||
priority = 10
|
||||
public_key = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
url = "https://cache.nixos.org"
|
||||
|
||||
# Try without a public key.
|
||||
[[upstreams]]
|
||||
url = "https://nix-community.cachix.org"
|
||||
priority = 20
|
||||
url = "https://nix-community.cachix.org"
|
||||
|
||||
[cache]
|
||||
db_path = "/var/lib/ncro/routes.db"
|
||||
max_entries = 100000
|
||||
ttl = "1h"
|
||||
negative_ttl = "10m"
|
||||
db_path = "/var/lib/ncro/routes.db"
|
||||
latency_alpha = 0.3
|
||||
max_entries = 100000
|
||||
negative_ttl = "10m"
|
||||
ttl = "1h"
|
||||
|
||||
[discovery]
|
||||
enabled = false
|
||||
service_name = "_nix-serve._tcp"
|
||||
domain = "local"
|
||||
discovery_time = "5s"
|
||||
priority = 20
|
||||
domain = "local"
|
||||
enabled = false
|
||||
priority = 20
|
||||
service_name = "_nix-serve._tcp"
|
||||
|
||||
[mesh]
|
||||
enabled = false
|
||||
bind_addr = "0.0.0.0:7946"
|
||||
peers = []
|
||||
private_key = "/etc/ncro/node.key"
|
||||
bind_addr = "0.0.0.0:7946"
|
||||
enabled = false
|
||||
gossip_interval = "30s"
|
||||
peers = [ ]
|
||||
private_key = "/etc/ncro/node.key"
|
||||
|
||||
[logging]
|
||||
level = "info"
|
||||
format = "json"
|
||||
level = "info"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-config"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-config"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
hex.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-db"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-db"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
chrono = { workspace = true, features = [ "serde" ] }
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub struct RouteEntry {
|
|||
}
|
||||
|
||||
impl RouteEntry {
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn is_valid(&self) -> bool {
|
||||
Utc::now() < self.ttl
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-discovery"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-discovery"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-health"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-health"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
|
||||
[dependencies]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub enum Status {
|
|||
}
|
||||
|
||||
impl Status {
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub const fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Active => "ACTIVE",
|
||||
|
|
@ -66,7 +66,7 @@ struct ProberInner {
|
|||
}
|
||||
|
||||
impl Prober {
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn new(alpha: f64) -> Self {
|
||||
Self {
|
||||
inner: Arc::new(ProberInner {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-mesh"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-mesh"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
chrono.workspace = true
|
||||
|
|
|
|||
|
|
@ -72,11 +72,11 @@ impl Node {
|
|||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn id(&self) -> String {
|
||||
hex::encode(&self.public_key()[..8])
|
||||
}
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn public_key(&self) -> [u8; 32] {
|
||||
self.signing_key.verifying_key().to_bytes()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-metrics"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-metrics"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
prometheus.workspace = true
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ pub fn get() -> &'static Metrics {
|
|||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn gather() -> String {
|
||||
let mut buf = Vec::new();
|
||||
let encoder = TextEncoder::new();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-narinfo"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-narinfo"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
base64.workspace = true
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ impl NarInfo {
|
|||
Ok(narinfo)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn fingerprint(&self) -> String {
|
||||
let refs = self
|
||||
.references
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-router"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-router"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
chrono.workspace = true
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct RaceResult {
|
|||
}
|
||||
|
||||
impl Router {
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
db: Db,
|
||||
prober: Prober,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[package]
|
||||
name = "ncro-server"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
publish = false
|
||||
name = "ncro-server"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
axum = { workspace = true, features = [ "macros" ] }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
[package]
|
||||
name = "ncro"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
name = "ncro"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
description.workspace = true
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue