mirror of
https://codeberg.org/icewind/haze.git
synced 2026-10-02 01:04:10 +02:00
add sftp with key authentication service
This commit is contained in:
parent
f99238121b
commit
204fb676d6
19 changed files with 348 additions and 135 deletions
|
|
@ -87,7 +87,7 @@ impl ServiceTrait for NotifyPush {
|
|||
docker: &Docker,
|
||||
cloud_id: &str,
|
||||
config: &HazeConfig,
|
||||
) -> Result<Vec<String>> {
|
||||
) -> Result<Vec<Vec<String>>> {
|
||||
let mut ips: Vec<_> = self.get_ips(docker, cloud_id).await?.collect();
|
||||
if let Ok(local_interfaces) = list_afinet_netifas() {
|
||||
ips.extend(local_interfaces.into_iter().map(|(_, ip)| ip));
|
||||
|
|
@ -97,10 +97,14 @@ impl ServiceTrait for NotifyPush {
|
|||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, ip)| {
|
||||
format!(
|
||||
"occ config:system:set trusted_proxies {} --value {ip}",
|
||||
i + 1
|
||||
)
|
||||
vec![
|
||||
"occ".into(),
|
||||
"config:system:set".into(),
|
||||
"trusted_proxies".into(),
|
||||
(i + 1).to_string(),
|
||||
"--value".into(),
|
||||
ip.to_string(),
|
||||
]
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
|
@ -108,7 +112,7 @@ impl ServiceTrait for NotifyPush {
|
|||
config
|
||||
.proxy
|
||||
.addr_with_port(&self.container_name(cloud_id).unwrap(), ips[0], 7867);
|
||||
commands.push(format!("occ notify_push:setup {}", addr));
|
||||
commands.push(vec!["occ".into(), "notify_push:setup".into(), addr]);
|
||||
Ok(commands)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue