From 0eff91d4c7ad00bc81f2c0273e48207e1dedb789 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Thu, 28 Mar 2024 21:29:15 +0100 Subject: [PATCH] zot-bin: Initial import Signed-off-by: Stefan Knoblich --- acct-group/zot/Manifest | 1 + acct-group/zot/zot-0.ebuild | 9 ++++ acct-user/zot/Manifest | 1 + acct-user/zot/zot-0.ebuild | 13 ++++++ app-containers/zot-bin/Manifest | 6 +++ app-containers/zot-bin/files/zot.confd | 0 app-containers/zot-bin/files/zot.initd | 21 ++++++++++ app-containers/zot-bin/files/zot.service | 21 ++++++++++ app-containers/zot-bin/zot-bin-2.0.3.ebuild | 46 +++++++++++++++++++++ 9 files changed, 118 insertions(+) create mode 100644 acct-group/zot/Manifest create mode 100644 acct-group/zot/zot-0.ebuild create mode 100644 acct-user/zot/Manifest create mode 100644 acct-user/zot/zot-0.ebuild create mode 100644 app-containers/zot-bin/Manifest create mode 100644 app-containers/zot-bin/files/zot.confd create mode 100644 app-containers/zot-bin/files/zot.initd create mode 100644 app-containers/zot-bin/files/zot.service create mode 100644 app-containers/zot-bin/zot-bin-2.0.3.ebuild diff --git a/acct-group/zot/Manifest b/acct-group/zot/Manifest new file mode 100644 index 0000000..caaaa71 --- /dev/null +++ b/acct-group/zot/Manifest @@ -0,0 +1 @@ +EBUILD zot-0.ebuild 188 BLAKE2B e10c31dbf19b935fbf1a7383362480a5a8756252226fc013287108f7e39dd9668caaae77aa747cd0e9b1038f9bc6cd682a64df1477f38689232efa5af452d69c SHA512 3454faf2f9a9868ec03dcb5f83e0841accb5130745d50544aa275640ca39ae4d282d208ce436333003702db7ad55b91d948bd25b8590fff8775de960a0a5d159 diff --git a/acct-group/zot/zot-0.ebuild b/acct-group/zot/zot-0.ebuild new file mode 100644 index 0000000..90f01e1 --- /dev/null +++ b/acct-group/zot/zot-0.ebuild @@ -0,0 +1,9 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit acct-group + +DESCRIPTION="Zot OCI registry group" +ACCT_GROUP_ID=749 diff --git a/acct-user/zot/Manifest b/acct-user/zot/Manifest new file mode 100644 index 0000000..6e6d0e4 --- /dev/null +++ b/acct-user/zot/Manifest @@ -0,0 +1 @@ +EBUILD zot-0.ebuild 283 BLAKE2B 6ed0e5e9a15b3d1d48d71f76363f3a701c2ab8cd8e592328b7c3094c39949ffaae7bd6273d2b4765ea2e1eddd4f3d48827e83f38fbc9b90716f1ea4b922e33a3 SHA512 104c46d6b37b319a4fe39c15212709ffea04fa2d022316cc5d85585c60a198f880cdddf84c03470e237a16040ffba2ec6945ee25d88541118918c61b95139dc0 diff --git a/acct-user/zot/zot-0.ebuild b/acct-user/zot/zot-0.ebuild new file mode 100644 index 0000000..85a0bd6 --- /dev/null +++ b/acct-user/zot/zot-0.ebuild @@ -0,0 +1,13 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit acct-user + +DESCRIPTION="Zot OCI registry user" +ACCT_USER_ID=749 +ACCT_USER_HOME=/var/lib/zot +ACCT_USER_HOME_PERMS=0750 +ACCT_USER_GROUPS=( zot ) +acct-user_add_deps diff --git a/app-containers/zot-bin/Manifest b/app-containers/zot-bin/Manifest new file mode 100644 index 0000000..7129c93 --- /dev/null +++ b/app-containers/zot-bin/Manifest @@ -0,0 +1,6 @@ +AUX zot.confd 0 BLAKE2B 786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e +AUX zot.initd 720 BLAKE2B d6dda4249d9a5273497e1e9cbf5c41c3a04a2fbc640c39bed671cb313b4929927531adfcd99193e4d7ed2851ab9c9ae07486e8bf4fa1b9fc08e09c49e2cf98f7 SHA512 a9c85f3638fca25e8582d24e724f88a93a406d66d9daeab8417c9a79e53ace0a7304ff399d9b8be48e397ae7c41c497c1585c233f9f8e34a884758d408d813fc +AUX zot.service 417 BLAKE2B f8873f598388e9211c7b109298ed8a19bc368d0f54c3fa02b8bf9b13cc986de10ee0dc74ba8532cbd38f4d1bd3154bd7ebd7b390fca4b35cdc494120eea6cc3e SHA512 2e43523796b364c0719f8703ad58a5167cdcbc157938c103d465ceca6ab398c8ef281c3c9cfb9ad8bf946fa9d1dfea7c1938cd95bb5d3794437480c5598e24cd +DIST zli-2.0.3-linux-amd64 13066561 BLAKE2B a47e70efd51b2e8ee15aa41786d59a781a9e31e0eb5ecddfa7f6b552babae666a1ee21fdf36af808dabf4edd2ee1e701fd6bdad4b0fa9711ad30de5821a9e330 SHA512 34043d7f0fe4110c80b739c4a4c5369fb0f0afa31bd5a29696a1e3f71e0ac66f8ba5fc072dc2bf4a412e0f8d1bc59e17d08e194da6d15e6051f1fffb9e7dc9d2 +DIST zot-2.0.3-linux-amd64 155664705 BLAKE2B 460ec6b9648537c75f8dc549fb6688d01185123cf16d6abad4ec0ada02c16be94bcd274c5af7570e8e0a3f154b480c4fd56b38f61a47b9a2fc482224659414d6 SHA512 af9a7fdd328bd4c587ba9c40d284f7e16fb32f1e12f3f1cbda16302fff401b0f1f36d46756af49f914980effb746ca91993c417360fbaec9aa88485865b8209b +EBUILD zot-bin-2.0.3.ebuild 1022 BLAKE2B abc392a2e11e0666df64a67fdb6d2597393cfbcfe65144e35363af1e56277275cacf54118960f953729cd66df45aa51fd5c3a39b778209713f96330bddd7a007 SHA512 e982a515400e439e3aa4f206281381079da7fd009a4dff0dbbb2853edbdf69316156373e5164ba65d13f96dd0f3ed9552e3e7dbe90fef6fe25ffd1cefe29b751 diff --git a/app-containers/zot-bin/files/zot.confd b/app-containers/zot-bin/files/zot.confd new file mode 100644 index 0000000..e69de29 diff --git a/app-containers/zot-bin/files/zot.initd b/app-containers/zot-bin/files/zot.initd new file mode 100644 index 0000000..62e1796 --- /dev/null +++ b/app-containers/zot-bin/files/zot.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +ZOT_USER="${ZOT_USER:-zot}" +ZOT_GROUP="${ZOT_GROUP:-zot}" +ZOT_CONFIG="${ZOT_CONFIG:-/etc/zot/config.json}" +ZOT_DATA_DIR="${ZOT_DATA_DIR:-/var/lib/zot}" +ZOT_LOG_DIR="${ZOT_LOG_DIR:-/var/log/zot}" + +command="/usr/sbin/zot" +command_args="${ZOT_CONFIG}" + +pidfile="/run/${RC_SVCNAME}.pid" +command_background="true" +start_stop_daemon_args="--user=\"${ZOT_USER}\" --group=\"${ZOT_GROUP}\" --stdout ${ZOT_LOG_DIR}/zot.log --stderr ${ZOT_LOG_DIR}/zot.err --chdir ${ZOT_DATA_DIR}" + +start_pre() { + checkpath -d -o "${ZOT_USER}" -m750 "${ZOT_DATA_DIR}" + checkpath -d -o "${ZOT_USER}" -m750 "${ZOT_LOG_DIR}" +} diff --git a/app-containers/zot-bin/files/zot.service b/app-containers/zot-bin/files/zot.service new file mode 100644 index 0000000..ed4a7fd --- /dev/null +++ b/app-containers/zot-bin/files/zot.service @@ -0,0 +1,21 @@ +[Unit] +Description=Zot OCI registry +Documentation=https://github.com/project-zot/zot +After=network.target auditd.service local-fs.target + +[Service] +Type=simple +ExecStart=/usr/sbin/zot /etc/zot/config.json +Restart=on-failure +User=zot +Group=zot +LimitNOFILE=500000 + +WorkingDirectory=/var/lib/zot +StateDirectory=zot +StateDirectoryMode=0750 +CacheDirectory=zot +CacheDirectoryMode=0750 + +[Install] +WantedBy=multi-user.target diff --git a/app-containers/zot-bin/zot-bin-2.0.3.ebuild b/app-containers/zot-bin/zot-bin-2.0.3.ebuild new file mode 100644 index 0000000..cfd11a0 --- /dev/null +++ b/app-containers/zot-bin/zot-bin-2.0.3.ebuild @@ -0,0 +1,46 @@ + +EAPI="7" + +inherit systemd + +MY_PN="${PN/-bin/}" + +DESCRIPTION="A production-ready vendor-neutral OCI-native container image/artifact registry" +HOMEPAGE="https://github.com/project-zot/zot" +SRC_URI=" + https://github.com/project-zot/zot/releases/download/v${PV}/zot-linux-amd64 -> zot-${PV}-linux-amd64 + https://github.com/project-zot/zot/releases/download/v${PV}/zli-linux-amd64 -> zli-${PV}-linux-amd64 +" + +SLOT="0" +LICENSE="Apache-2.0" +KEYWORDS="amd64" +S="${WORKDIR}" + +QA_PRESTRIPPED=" + /usr/sbin/zot + /usr/bin/zli +" + +DEPEND=" + acct-group/zot + acct-user/zot +" + +src_install() { + newsbin "${DISTDIR}/zot-${PV}-linux-amd64" zot + newbin "${DISTDIR}/zli-${PV}-linux-amd64" zli + + newinitd "${FILESDIR}/${MY_PN}.initd" ${MY_PN} + newconfd "${FILESDIR}/${MY_PN}.confd" ${MY_PN} + + systemd_dounit "${FILESDIR}/${MY_PN}.service" + + diropts -m 0750 -o ${MY_PN} -g ${MY_PN} + dodir /etc/${MY_PN} + keepdir /var/lib/${MY_PN} + keepdir /var/log/${MY_PN} + + insinto /etc/${MY_PN} + newins example/config-minimal.json config.json +}