From 4facafbbfc09f460e1cef89f314dcc0131226ae7 Mon Sep 17 00:00:00 2001 From: Maxim Karasev Date: Sun, 16 Oct 2022 18:15:58 +0300 Subject: [PATCH] testing/teleport: new aport --- testing/teleport/APKBUILD | 59 +++++++++++++++++++++++++++++++++ testing/teleport/teleport.confd | 18 ++++++++++ testing/teleport/teleport.initd | 37 +++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 testing/teleport/APKBUILD create mode 100644 testing/teleport/teleport.confd create mode 100644 testing/teleport/teleport.initd diff --git a/testing/teleport/APKBUILD b/testing/teleport/APKBUILD new file mode 100644 index 00000000000..eb9eaa0beae --- /dev/null +++ b/testing/teleport/APKBUILD @@ -0,0 +1,59 @@ +# Contributor: Maxim Karasev +# Maintainer: Maxim Karasev +pkgname=teleport +pkgver=11.1.4 +pkgrel=0 +pkgdesc="identity-aware, multi-protocol access proxy" +url="https://goteleport.com/" +arch="x86_64 x86 aarch64 ppc64le s390x" # "relocation truncated to fit" on 32-bit arches +license="Apache-2.0" +makedepends="go linux-headers yarn npm python3 !rust" # tries to build rdpclient otherwise +subpackages="$pkgname-client $pkgname-openrc" +source="https://github.com/gravitational/teleport/archive/v$pkgver/teleport-$pkgver.tar.gz + https://github.com/gravitational/webapps/archive/v$pkgver/webapps-$pkgver.tar.gz + teleport.initd + teleport.confd" +options="!check" # not our problems + +build() { + cd "$srcdir"/webapps-$pkgver + yarn install && yarn build-teleport-oss + mv packages/teleport "$builddir"/webassets/ + cd "$builddir" + make ARCH="" # otherwise tries to be too smart, e.g. hardcoded CC + + build/teleport configure >teleport.yaml +} + +#check() { +# go test ./... +#} + +package() { + mkdir -p "$pkgdir"/usr/bin + + make \ + BINDIR="$pkgdir"/usr/bin \ + DATADIR="$pkgdir"/usr/share/teleport \ + install + + # isn't included in Makefile install target for now + install -Dm755 build/tbot "$pkgdir"/usr/bin/tbot + + install -Dm755 "$srcdir"/teleport.initd "$pkgdir"/etc/init.d/teleport + install -Dm644 "$srcdir"/teleport.confd "$pkgdir"/etc/conf.d/teleport + install -Dm644 teleport.yaml "$pkgdir"/etc/teleport.yaml +} + +client() { + amove usr/bin/tctl + amove usr/bin/tsh + amove usr/bin/tbot +} + +sha512sums=" +08c44b0e7317518397b08f760994e0fc8f8672f2ab6f46db1c02c60492da3c3eb4927271c02e753cf5f81252ea3d22a7c1ce4c230fc65fc7c504f20f41c33b42 teleport-11.1.4.tar.gz +ea141b05c2793fd268f8e4a1f9fce51c7cf8038d37b0f7cc855d4bf0a4c9782075ee14f03209a99ecc7c626c21754cddfb0ae68e0af834b8288013d5304c1e54 webapps-11.1.4.tar.gz +9dd26daa519e9fef30b25ef5af505b8b35d8566eaa02f0ec47a6f7805227e94eb25ffb8fd007b73e7c3a91f9e783d47391c55dd8d659d683770aa9d5a02df923 teleport.initd +21ff397908c665a7dc55593751562c4b91338eb559d6ed01f6c13535a84588258aa90ac85c26b087dc1bccf6241fc96edf33e1b4b8247a84ef80d9459cf242ab teleport.confd +" diff --git a/testing/teleport/teleport.confd b/testing/teleport/teleport.confd new file mode 100644 index 00000000000..3c268562760 --- /dev/null +++ b/testing/teleport/teleport.confd @@ -0,0 +1,18 @@ +# /etc/conf.d/teleport: config file for /etc/init.d/teleport + +# Where is your teleport.yaml file stored? +TELEPORT_CONFDIR="/etc" + +# Any random options you want to pass to teleport. +TELEPORT_OPTS="" + +# Pid file to use (needs to be absolute path). +#TELEPORT_PIDFILE="/var/run/teleport.pid" + +# Path to log file +#TELEPORT_LOGFILE="/var/log/teleport.log" + +# Startup dependency +# Un-comment when using etcd storage backend +#rc_need="etcd" + diff --git a/testing/teleport/teleport.initd b/testing/teleport/teleport.initd new file mode 100644 index 00000000000..a951ec5318a --- /dev/null +++ b/testing/teleport/teleport.initd @@ -0,0 +1,37 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +: ${TELEPORT_CONFDIR:=/etc/teleport} +: ${TELEPORT_PIDFILE:=/var/run/${SVCNAME}.pid} +: ${TELEPORT_BINARY:=/usr/bin/teleport} +: ${TELEPORT_LOGFILE:=/var/log/teleport.log} + +depend() { + need net +} + +start() { + ebegin "Starting Teleport SSH Service" + start-stop-daemon --start --exec /usr/bin/teleport \ + --background --make-pidfile --pidfile "${TELEPORT_PIDFILE}" \ + --stderr "${TELEPORT_LOGFILE}" \ + -- start --config="${TELEPORT_CONFDIR}/teleport.yaml" \ + ${TELEPORT_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Teleport SSH Service" + start-stop-daemon --stop --exec /usr/bin/teleport \ + --pidfile "${TELEPORT_PIDFILE}" + eend $? +} + +reload() { + checkconfig || return 1 + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP \ + --exec "${TELEPORT_BINARY}" --pidfile "${TELEPORT_PIDFILE}" + eend $? +} -- GitLab