mirror of
https://codeberg.org/spire/dispenser.git
synced 2026-06-03 10:04:07 +02:00
sidewindow
This commit is contained in:
parent
6c9b7244a9
commit
3f25246f39
1 changed files with 10 additions and 9 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -149,26 +149,27 @@ async fn setup(
|
|||
ssh.exec("apt-get -qq --yes --force-yes purge unattended-upgrades")
|
||||
.await?;
|
||||
|
||||
info!("setting up prometheus");
|
||||
ssh.exec("wget https://github.com/icewind1991/palantir/raw/main/palantir.service -O /etc/systemd/system/palantir.service").await?;
|
||||
ssh.exec("wget https://github.com/icewind1991/palantir/releases/download/v1.1.0/palantir-x86_64-unknown-linux-musl -O /usr/local/bin/palantir").await?;
|
||||
ssh.exec("chmod +x /usr/local/bin/palantir").await?;
|
||||
info!("setting up sidewindow");
|
||||
ssh.exec(
|
||||
r#"sed -i -e "s|User=palantir|DynamicUser=true|" /etc/systemd/system/palantir.service"#,
|
||||
)
|
||||
.await?;
|
||||
"wget https://codeberg.org/icewind/sidewindow/raw/main/sidewindow.service -O /etc/systemd/system/sidewindow.service \
|
||||
&& wget https://codeberg.org/icewind/sidewindow/releases/download/v1.4.0/x86_64-unknown-linux-musl -O /usr/local/bin/sidewindow \
|
||||
&& chmod +x /usr/local/bin/sidewindow \
|
||||
&& sed -i -e 's/User=sidewindow/DynamicUser=true/' /etc/systemd/system/sidewindow.service
|
||||
").await?;
|
||||
ssh.exec("iptables -I INPUT -p tcp --dport 5665 -j ACCEPT")
|
||||
.await?;
|
||||
if let Some(hostname) = hostname {
|
||||
ssh.exec(&format!(
|
||||
"hostname {} && systemctl start palantir",
|
||||
"hostname {} && systemctl start sidewindow",
|
||||
hostname
|
||||
))
|
||||
.await?;
|
||||
} else {
|
||||
ssh.exec("systemctl start palantir").await?;
|
||||
ssh.exec("systemctl start sidewindow").await?;
|
||||
}
|
||||
|
||||
info!("setup done");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue