mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
With this change, the location of the secret SSH key can be configured
through `${RAD_HOME}/config.json` so that the node key does not have to
be placed under `${RAD_HOME}/keys` anymore.
Further, there is now an option to override `config.json` directly when
executing `radicle-node` via the command line argument
`--secret`.
The primary motivation is more flexible deployments, for example
leveraging external secret management solutions, like
<https://systemd.io/CREDENTIALS/>.
The secret key is fingerprinted by taking the fingerprint of the public
key corresponding to the secret key. This allows to detect when the
secret key changes.
54 lines
1.6 KiB
Rust
54 lines
1.6 KiB
Rust
// N.b. Rust 1.85 introduced some annoying clippy warnings about using `b""`
|
|
// syntax in place of `b''`, but in our cases they were u8 and not [u8] so the
|
|
// suggestions did not make sense.
|
|
#![allow(clippy::byte_char_slices)]
|
|
|
|
use std::str::FromStr;
|
|
use std::sync::LazyLock;
|
|
|
|
pub mod control;
|
|
pub mod fingerprint;
|
|
pub mod runtime;
|
|
pub(crate) use radicle_protocol::service;
|
|
#[cfg(any(test, feature = "test"))]
|
|
pub mod test;
|
|
#[cfg(test)]
|
|
pub mod tests;
|
|
pub mod wire;
|
|
pub mod worker;
|
|
|
|
use radicle::version::Version;
|
|
|
|
pub use localtime::{LocalDuration, LocalTime};
|
|
pub use radicle::node::Link;
|
|
pub use radicle::node::UserAgent;
|
|
pub use radicle::node::PROTOCOL_VERSION;
|
|
pub use radicle::prelude::Timestamp;
|
|
pub use radicle::{collections, crypto, git, identity, node, profile, rad, storage};
|
|
pub use runtime::Runtime;
|
|
|
|
/// Node version.
|
|
pub const VERSION: Version = Version {
|
|
name: env!("CARGO_PKG_NAME"),
|
|
commit: env!("GIT_HEAD"),
|
|
version: env!("RADICLE_VERSION"),
|
|
timestamp: env!("SOURCE_DATE_EPOCH"),
|
|
};
|
|
|
|
/// This node's user agent string.
|
|
pub static USER_AGENT: LazyLock<UserAgent> = LazyLock::new(|| {
|
|
FromStr::from_str(format!("/radicle:{}/", VERSION.version).as_str())
|
|
.expect("user agent is valid")
|
|
});
|
|
|
|
pub mod prelude {
|
|
pub use crate::crypto::{PublicKey, Signature};
|
|
pub use crate::identity::{Did, RepoId};
|
|
pub use crate::node::{config::Network, Address, Event, NodeId};
|
|
pub use crate::service::filter::Filter;
|
|
pub use crate::service::{DisconnectReason, Message};
|
|
pub use crate::storage::refs::Refs;
|
|
pub use crate::storage::WriteStorage;
|
|
pub use crate::{LocalDuration, LocalTime, Timestamp};
|
|
}
|