Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Mar 5, 2024
1 parent ea25fc6 commit fab2dab
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-linux-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
matrix:
package_name:
- openziti
- openziti-controller
arch:
- goreleaser: amd64
gox: amd64
Expand Down
47 changes: 47 additions & 0 deletions dist/dist-packages/linux/nfpm-openziti-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# nfpm configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: openziti-controller
arch: ${GOARCH}
platform: linux
version: ${ZITI_VERSION}
maintainer: ${ZITI_MAINTAINER}
description: >
Provides a system service for running an OpenZiti Controller
vendor: ${ZITI_VENDOR}
homepage: ${ZITI_HOMEPAGE}
license: Apache-2.0

# 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

depends:
- openziti # ziti CLI

# Contents to add to the package.
contents:
- dst: /lib/systemd/system/
src: ./dist/dist-packages/linux/openziti-controller/ziti-controller.service

- dst: /opt/openziti/etc/controller
type: dir
file_info:
mode: 0755

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/env
type: config|noreplace

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/entrypoint.bash

13 changes: 13 additions & 0 deletions dist/dist-packages/linux/openziti-controller/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
#
# this thin wrapper script for the OpenZiti Controller enables
# - evaluating arguments from the env file
# - future: bootstrapping a default run environment with PKI and initialized database
#

set -o errexit
set -o nounset
set -o pipefail

# shellcheck disable=SC2068 # because we want to word-split args
exec /opt/openziti/bin/ziti controller run $@
2 changes: 2 additions & 0 deletions dist/dist-packages/linux/openziti-controller/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ZITI_CONTROLLER_RUN_ARGS="config.yml --log-formatter text --verbose"
#PFXLOG_NO_JSON=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=OpenZiti Controller
After=network-online.target

[Service]
Type=simple
DynamicUser=yes
StateDirectory=ziti-controller
UMask=0007
Restart=always
RestartSec=3
LimitNOFILE=65535
EnvironmentFile=/opt/openziti/etc/controller/env
ExecStart=/opt/openziti/etc/controller/entrypoint.bash ${ZITI_CONTROLLER_RUN_ARGS}

[Install]
WantedBy=multi-user.target

0 comments on commit fab2dab

Please sign in to comment.