Skip to content

Commit

Permalink
Deploy iroh relay
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Oct 22, 2024
1 parent bbf508d commit 40bc816
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmdeploy/src/cmdeploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,16 @@ def deploy_mtail(config):
)


def deploy_iroh_relay() -> None:
server.shell(
name="Download iroh-relay",
commands=[
"(echo '8af7f6d29d17476ce5c3053c3161db5793cb2ac49057d0bcaf689436cdccbeab /usr/local/bin/iroh-relay' | sha256sum -c) || curl -L https://github.com/n0-computer/iroh/releases/download/v0.27.0/iroh-relay-v0.27.0-x86_64-unknown-linux-musl.tar.gz | gunzip | tar -x -f - ./iroh-relay -O >/usr/local/bin/iroh-relay",
"chmod 755 /usr/local/bin/iroh-relay",
],
)


def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
"""Deploy a chat-mail instance.
Expand Down Expand Up @@ -556,6 +566,8 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
enabled=True,
)

deploy_iroh_relay()

# Deploy acmetool to have TLS certificates.
deploy_acmetool(
domains=[mail_domain, f"mta-sts.{mail_domain}", f"www.{mail_domain}"],
Expand Down
11 changes: 11 additions & 0 deletions cmdeploy/src/cmdeploy/service/iroh-relay.service.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Iroh relay

[Service]
ExecStart=/usr/local/bin/iroh-relay --config-path /home/iroh-relay/iroh-relay.toml
WorkingDirectory=/home/iroh-relay/
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

0 comments on commit 40bc816

Please # to comment.