From c7c245945434fdb690e933073b9a9b3a36c65e70 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Tue, 22 Oct 2024 19:05:29 +0200 Subject: [PATCH] feat: systemd unit for zia-client in deb package --- zia-client/Cargo.toml | 8 ++++++++ zia-client/debian/default | 8 ++++++++ zia-client/debian/service | 12 ++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 zia-client/debian/default create mode 100644 zia-client/debian/service diff --git a/zia-client/Cargo.toml b/zia-client/Cargo.toml index 3be16a8..8e60332 100644 --- a/zia-client/Cargo.toml +++ b/zia-client/Cargo.toml @@ -25,6 +25,14 @@ anyhow = { version = "1.0", default-features = false } hyper-util = { version = "0.1", features = ["tokio"] } hyper = { version = "1.4", default-features = false } +[package.metadata.deb] +maintainer-scripts = "debian/" +systemd-units = { enable = false } +assets = [ + ["target/release/zia-client", "/usr/bin/zia-client", "755"], + ["debian/default", "/etc/zia-client", "644"] +] + [package.metadata.generate-rpm] assets = [ { source = "../LICENSE", dest = "/usr/share/doc/zia-client/LICENSE", doc = true, mode = "0644" }, diff --git a/zia-client/debian/default b/zia-client/debian/default new file mode 100644 index 0000000..1b1a38f --- /dev/null +++ b/zia-client/debian/default @@ -0,0 +1,8 @@ +# public websocket listener (client -> ZIA_UPSTREAM) +ZIA_LISTEN_ADDR=127.0.0.1:8090 + +# your actual udp service e.g. wireguard listener +#ZIA_UPSTREAM=wss://domain.tld/ws + +ZIA_COUNT=4 +ZIA_WS_MASKING=true diff --git a/zia-client/debian/service b/zia-client/debian/service new file mode 100644 index 0000000..875ce0d --- /dev/null +++ b/zia-client/debian/service @@ -0,0 +1,12 @@ +[Unit] +Description=Proxy udp over websocket, zia client +After=network.target + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/zia-client +EnvironmentFile=/etc/zia-client + +[Install] +WantedBy=multi-user.target