Compare commits
1 Commits
secrets-pr
...
4fa2b8deb6
| Author | SHA1 | Date | |
|---|---|---|---|
| 4fa2b8deb6 |
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -3124,7 +3124,6 @@ dependencies = [
|
||||
"fxhash",
|
||||
"newline-converter",
|
||||
"once_cell",
|
||||
"tempfile",
|
||||
"unicode-segmentation",
|
||||
"unicode-width 0.1.14",
|
||||
]
|
||||
|
||||
15
Cargo.toml
15
Cargo.toml
@@ -14,8 +14,7 @@ members = [
|
||||
"harmony_composer",
|
||||
"harmony_inventory_agent",
|
||||
"harmony_secret_derive",
|
||||
"harmony_secret",
|
||||
"adr/agent_discovery/mdns",
|
||||
"harmony_secret", "adr/agent_discovery/mdns",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
@@ -51,7 +50,7 @@ k8s-openapi = { version = "0.25", features = ["v1_30"] }
|
||||
serde_yaml = "0.9"
|
||||
serde-value = "0.7"
|
||||
http = "1.2"
|
||||
inquire = { version = "0.7", features = ["editor"] }
|
||||
inquire = "0.7"
|
||||
convert_case = "0.8"
|
||||
chrono = "0.4"
|
||||
similar = "2"
|
||||
@@ -67,11 +66,5 @@ thiserror = "2.0.14"
|
||||
serde = { version = "1.0.209", features = ["derive", "rc"] }
|
||||
serde_json = "1.0.127"
|
||||
askama = "0.14"
|
||||
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }
|
||||
reqwest = { version = "0.12", features = [
|
||||
"blocking",
|
||||
"stream",
|
||||
"rustls-tls",
|
||||
"http2",
|
||||
"json",
|
||||
], default-features = false }
|
||||
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite" ] }
|
||||
reqwest = { version = "0.12", features = ["blocking", "stream", "rustls-tls", "http2", "json"], default-features = false }
|
||||
|
||||
1
examples/try_rust_webapp/files_to_add/.dockerignore
Normal file
1
examples/try_rust_webapp/files_to_add/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
harmony
|
||||
20
examples/try_rust_webapp/files_to_add/Cargo.toml
Normal file
20
examples/try_rust_webapp/files_to_add/Cargo.toml
Normal file
@@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "harmony-tryrust"
|
||||
edition = "2024"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
harmony = { path = "../../../nationtech/harmony/harmony" }
|
||||
harmony_cli = { path = "../../../nationtech/harmony/harmony_cli" }
|
||||
harmony_types = { path = "../../../nationtech/harmony/harmony_types" }
|
||||
harmony_macros = { path = "../../../nationtech/harmony/harmony_macros" }
|
||||
tokio = { version = "1.40", features = [
|
||||
"io-std",
|
||||
"fs",
|
||||
"macros",
|
||||
"rt-multi-thread",
|
||||
] }
|
||||
log = { version = "0.4", features = ["kv"] }
|
||||
env_logger = "0.11"
|
||||
url = "2.5"
|
||||
base64 = "0.22.1"
|
||||
45
examples/try_rust_webapp/files_to_add/main.rs
Normal file
45
examples/try_rust_webapp/files_to_add/main.rs
Normal file
@@ -0,0 +1,45 @@
|
||||
use harmony::{
|
||||
inventory::Inventory,
|
||||
modules::{
|
||||
application::{
|
||||
ApplicationScore, RustWebFramework, RustWebapp,
|
||||
features::{ContinuousDelivery, Monitoring, rhob_monitoring::RHOBMonitoring},
|
||||
},
|
||||
monitoring::alert_channel::discord_alert_channel::DiscordWebhook,
|
||||
},
|
||||
topology::K8sAnywhereTopology,
|
||||
};
|
||||
use harmony_macros::hurl;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let application = Arc::new(RustWebapp {
|
||||
name: "tryrust".to_string(),
|
||||
project_root: PathBuf::from(".."),
|
||||
framework: Some(RustWebFramework::Leptos),
|
||||
service_port: 8080,
|
||||
});
|
||||
|
||||
let app = ApplicationScore {
|
||||
features: vec![
|
||||
Box::new(ContinuousDelivery {
|
||||
application: application.clone(),
|
||||
}),
|
||||
Box::new(RHOBMonitoring {
|
||||
application: application.clone(),
|
||||
alert_receiver: vec![],
|
||||
}),
|
||||
],
|
||||
application,
|
||||
};
|
||||
|
||||
harmony_cli::run(
|
||||
Inventory::autoload(),
|
||||
K8sAnywhereTopology::from_env(),
|
||||
vec![Box::new(app)],
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
@@ -120,26 +120,10 @@ impl SecretManager {
|
||||
|
||||
let ns = &manager.namespace;
|
||||
let key = T::KEY;
|
||||
let secret_json = inquire::Editor::new(&format!(
|
||||
"Secret not found for {ns} {key}, paste the JSON here :",
|
||||
let secret_json = inquire::Text::new(&format!(
|
||||
"Secret not found for {} {}, paste the JSON here :",
|
||||
ns, key
|
||||
))
|
||||
.with_formatter(&|data| {
|
||||
let char_count = data.chars().count();
|
||||
if char_count == 0 {
|
||||
String::from("<skipped>")
|
||||
} else if char_count <= 20 {
|
||||
data.into()
|
||||
} else {
|
||||
let mut substr: String = data.chars().take(17).collect();
|
||||
substr.push_str("...");
|
||||
substr
|
||||
}
|
||||
})
|
||||
.with_render_config(
|
||||
inquire::ui::RenderConfig::default().with_canceled_prompt_indicator(
|
||||
inquire::ui::Styled::new("<skipped>").with_fg(inquire::ui::Color::DarkYellow),
|
||||
),
|
||||
)
|
||||
.prompt()
|
||||
.map_err(|e| {
|
||||
SecretStoreError::Store(format!("Failed to prompt secret {ns} {key} : {e}").into())
|
||||
|
||||
Reference in New Issue
Block a user