add zrok agent service unit

This commit is contained in:
Kenneth Bingham 2025-03-20 19:02:11 -04:00
parent 8442cada6f
commit 1a01232123
No known key found for this signature in database
GPG Key ID: 31709281860130B6
8 changed files with 234 additions and 3 deletions

View File

@ -63,6 +63,7 @@ jobs:
package_name:
- zrok
- zrok-share
- zrok-agent
arch:
- deb: amd64
rpm: x86_64

View File

@ -103,7 +103,7 @@ jobs:
else
SEMVER_PRE=${SEMVER#*-}
fi
for PAX in zrok{,-share}; do
for PAX in zrok{,-share,-agent}; do
_pattern="./dist/${PAX}-${SEMVER_CORE}${SEMVER_PRE:+~${SEMVER_PRE}}*.${ARCH}.rpm"
if ! compgen -G "$_pattern" > /dev/null; then
echo "ERROR: No RPM files found matching pattern '${_pattern}'" >&2
@ -139,7 +139,7 @@ jobs:
else
SEMVER_PRE=${SEMVER#*-}
fi
for PAX in zrok{,-share}; do
for PAX in zrok{,-share,-agent}; do
_pattern="./dist/${PAX}_${SEMVER_CORE}${SEMVER_PRE:+~${SEMVER_PRE}}*_${ARCH}.deb"
if ! compgen -G "$_pattern" > /dev/null; then
echo "ERROR: No DEB files found matching pattern '${_pattern}'" >&2

View File

@ -137,3 +137,56 @@ nfpms:
- dst: /opt/openziti/etc/zrok/
src: ./etc/caddy/multiple_upstream.Caddyfile
type: config|noreplace
- package_name: zrok-agent
id: zrok-agent
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |
This package provides zrok-agent.service. Enable your zrok account on this device with "zrok enable". Run
"systemctl enable --user --now zrok-agent.service" to enable the service for the current user and visit the agent
UI by running "zrok agent console".
license: Apache 2.0
# do not bundle the built binaries, only supporting files
meta: true
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
dependencies:
- zrok
# this allows users to satisfy the requirement for jq another way, not with the package manager, e.g.
# apt install --no-recommends zrok-share
recommends: []
overrides:
# yum and dnf do not automatically install "weak deps" aka "recommends", so we need to add them as a dependency
rpm:
dependencies:
- zrok
# Contents to add to the package.
contents:
- dst: /usr/lib/systemd/user/
src: ./nfpm/zrok-agent.service

View File

@ -141,3 +141,56 @@ nfpms:
- dst: /opt/openziti/etc/zrok/
src: ./etc/caddy/multiple_upstream.Caddyfile
type: config|noreplace
- package_name: zrok-agent
id: zrok-agent
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |
This package provides zrok-agent.service. Enable your zrok account on this device with "zrok enable". Run
"systemctl enable --user --now zrok-agent.service" to enable the service for the current user and visit the agent
UI by running "zrok agent console".
license: Apache 2.0
# do not bundle the built binaries, only supporting files
meta: true
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
dependencies:
- zrok
# this allows users to satisfy the requirement for jq another way, not with the package manager, e.g.
# apt install --no-recommends zrok-share
recommends: []
overrides:
# yum and dnf do not automatically install "weak deps" aka "recommends", so we need to add them as a dependency
rpm:
dependencies:
- zrok
# Contents to add to the package.
contents:
- dst: /usr/lib/systemd/user/
src: ./nfpm/zrok-agent.service

View File

@ -145,3 +145,56 @@ nfpms:
- dst: /opt/openziti/etc/zrok/
src: ./etc/caddy/multiple_upstream.Caddyfile
type: config|noreplace
- package_name: zrok-agent
id: zrok-agent
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |
This package provides zrok-agent.service. Enable your zrok account on this device with "zrok enable". Run
"systemctl enable --user --now zrok-agent.service" to enable the service for the current user and visit the agent
UI by running "zrok agent console".
license: Apache 2.0
# do not bundle the built binaries, only supporting files
meta: true
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
dependencies:
- zrok
# this allows users to satisfy the requirement for jq another way, not with the package manager, e.g.
# apt install --no-recommends zrok-share
recommends: []
overrides:
# yum and dnf do not automatically install "weak deps" aka "recommends", so we need to add them as a dependency
rpm:
dependencies:
- zrok
# Contents to add to the package.
contents:
- dst: /usr/lib/systemd/user/
src: ./nfpm/zrok-agent.service

View File

@ -143,3 +143,56 @@ nfpms:
- dst: /opt/openziti/etc/zrok/
src: ./etc/caddy/multiple_upstream.Caddyfile
type: config|noreplace
- package_name: zrok-agent
id: zrok-agent
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |
This package provides zrok-agent.service. Enable your zrok account on this device with "zrok enable". Run
"systemctl enable --user --now zrok-agent.service" to enable the service for the current user and visit the agent
UI by running "zrok agent console".
license: Apache 2.0
# do not bundle the built binaries, only supporting files
meta: true
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
dependencies:
- zrok
# this allows users to satisfy the requirement for jq another way, not with the package manager, e.g.
# apt install --no-recommends zrok-share
recommends: []
overrides:
# yum and dnf do not automatically install "weak deps" aka "recommends", so we need to add them as a dependency
rpm:
dependencies:
- zrok
# Contents to add to the package.
contents:
- dst: /usr/lib/systemd/user/
src: ./nfpm/zrok-agent.service

18
nfpm/zrok-agent.service Normal file
View File

@ -0,0 +1,18 @@
# /usr/lib/systemd/user/zrok-agent.service
[Unit]
Description=zrok agent user service unit
After=network-online.target
[Service]
Type=simple
UMask=0007
ExecStart=/opt/openziti/bin/zrok agent start
Restart=always
RestartSec=3
#StandardInput=null
#StandardOutput=journal
#StandardError=journal
[Install]
WantedBy=default.target

View File

@ -14,4 +14,4 @@ Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
WantedBy=default.target