diff --git a/.github/workflows/promote-downstreams.yml b/.github/workflows/promote-downstreams.yml index 6e46c3df..66b07ca0 100644 --- a/.github/workflows/promote-downstreams.yml +++ b/.github/workflows/promote-downstreams.yml @@ -63,6 +63,7 @@ jobs: package_name: - zrok - zrok-share + - zrok-agent arch: - deb: amd64 rpm: x86_64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 097edc32..b3c6a01c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.goreleaser-linux-amd64.yml b/.goreleaser-linux-amd64.yml index 9c3766d0..40695482 100644 --- a/.goreleaser-linux-amd64.yml +++ b/.goreleaser-linux-amd64.yml @@ -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 diff --git a/.goreleaser-linux-arm64.yml b/.goreleaser-linux-arm64.yml index e4c5454f..bc357c61 100644 --- a/.goreleaser-linux-arm64.yml +++ b/.goreleaser-linux-arm64.yml @@ -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 diff --git a/.goreleaser-linux-armel.yml b/.goreleaser-linux-armel.yml index 86526dec..f4433553 100644 --- a/.goreleaser-linux-armel.yml +++ b/.goreleaser-linux-armel.yml @@ -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 diff --git a/.goreleaser-linux-armhf.yml b/.goreleaser-linux-armhf.yml index 67518309..fd76de1f 100644 --- a/.goreleaser-linux-armhf.yml +++ b/.goreleaser-linux-armhf.yml @@ -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 diff --git a/nfpm/zrok-agent.service b/nfpm/zrok-agent.service new file mode 100644 index 00000000..8d760568 --- /dev/null +++ b/nfpm/zrok-agent.service @@ -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 diff --git a/nfpm/zrok-share@.service b/nfpm/zrok-share@.service index ad242bf6..1ccf3356 100644 --- a/nfpm/zrok-share@.service +++ b/nfpm/zrok-share@.service @@ -14,4 +14,4 @@ Restart=always RestartSec=3 [Install] -WantedBy=multi-user.target +WantedBy=default.target