~chimo/apkbuilds

7e0edc38da52d939dfd63a807d3acee3beffc162 — chimo a month ago 5894bb3
Add py3-uptime-kuma-web-api & dependencies.
A py3-aiomysql/APKBUILD => py3-aiomysql/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-aiomysql
pkgver=0.2.0
pkgrel=0
_pkgreal=aiomysql
pkgdesc="MySQL driver for asyncio."
url="https://pypi.org/project/aiomysql/"
arch="noarch"
license="MIT"
depends="py3-pymysql"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
# Needs running mysql
options="!check"
#checkdepends="py3-pytest py3-sqlalchemy"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/a/aiomysql/aiomysql-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6ffa2a4f7b86fec89953f10117c212000093240094d48e78f72454f4aa1e4c02a24d5c1fd146dc92fe0a4fd869d5e9fd99f25ec6d6c3c81a8ab2e5720ba2d760  aiomysql-0.2.0.tar.gz
"

A py3-asyncio/APKBUILD => py3-asyncio/APKBUILD +38 -0
@@ 0,0 1,38 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-asyncio
pkgver=3.4.3
pkgrel=0
_pkgreal=asyncio
pkgdesc="reference implementation of PEP 3156"
url="https://pypi.org/project/asyncio/"
arch="noarch"
license="PSF"
# Tests fail. Investigate.
options="!check"
#makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/a/asyncio/asyncio-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
42077cbbae3d67e6e45224cc1996f1aaaff137cdc5c8679ba830fd66098d1e9d8c05e315c8d2ef1add2f504ab769bd339e5d8ae2f7532d423282baca2d383736  asyncio-3.4.3.tar.gz
"

A py3-asyncodbc/APKBUILD => py3-asyncodbc/APKBUILD +43 -0
@@ 0,0 1,43 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-asyncodbc
pkgver=0.1.1
pkgrel=1
_pkgreal=asyncodbc
pkgdesc="Forked from aioodbc and make improvement"
url="https://pypi.org/project/asyncodbc/"
arch="noarch"
license="Apache-2.0"
depends="py3-pyodbc"
makedepends="py3-poetry-core py3-gpep517 py3-setuptools py3-wheel"
# Tests fail. Investigate.
options="!check"
#checkdepends="py3-pytest py3-pytest-asyncio"
subpackages="$pkgname-pyc"
#source="https://files.pythonhosted.org/packages/source/a/asyncodbc/asyncodbc-$pkgver.tar.gz"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/tortoise/asyncodbc/archive/refs/tags/v0.1.1.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	# ???
	rm "$pkgdir/usr/lib/python3.12/site-packages/LICENSE" "$pkgdir/usr/lib/python3.12/site-packages/README.rst"
}

sha512sums="
319cb7c569f3d9b345445a15300dad33cc234e0f6be8e5f6e718fdefa96c2e59e7a4cbb2606cbba36c59292e5e9bf122889f46e1cff6630a5f3362690c8ec3ba  asyncodbc-0.1.1.tar.gz
"

A py3-bidict/APKBUILD => py3-bidict/APKBUILD +36 -0
@@ 0,0 1,36 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-bidict
pkgver=0.23.1
pkgrel=0
_pkgreal=bidict
pkgdesc="The bidirectional mapping library for Python."
url="https://pypi.org/project/bidict/"
arch="noarch"
license="MPL 2.0"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-tox"
subpackages="$pkgname-pyc"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/jab/bidict/archive/refs/tags/v0.23.1.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
 	.testenv/bin/python3 -m tox -e python3.12 --sitepackages
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
795e29b61c1717dd34807c60ce598fc6a142decebd0545378bdc728f397e2050f52cf11212075ba60e22553031e9727fcbaae26891f531219075f6f58e457d05  bidict-0.23.1.tar.gz
"

A py3-ciso8601/APKBUILD => py3-ciso8601/APKBUILD +35 -0
@@ 0,0 1,35 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-ciso8601
pkgver=2.3.1
pkgrel=0
_pkgreal=ciso8601
pkgdesc="Fast ISO8601 date time parser for Python written in C"
url="https://pypi.org/project/ciso8601/"
arch="all"
license="MIT"
makedepends="python3-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/c/ciso8601/ciso8601-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3adca3fae94f951b379025c29b56ef03d0860a3581a95188ccc68fa2805daa36c9a8538b0dcaec8d9a9b88e617c8e364cfc98666e6ab8c1af37a784533f9b949  ciso8601-2.3.1.tar.gz
"

A py3-fastapi/APKBUILD => py3-fastapi/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-fastapi
pkgver=0.115.0
pkgrel=0
_pkgreal=fastapi
pkgdesc="FastAPI framework, high performance, easy to learn, fast to code, ready for production"
url="https://pypi.org/project/fastapi/"
arch="noarch"
license="MIT"
depends="py3-starlette py3-pydantic py3-typing-extensions"
makedepends="py3-gpep517 py3-setuptools py3-wheel py3-pdm-backend"
# Requirements for tests are not available in main
options="!check"
#checkdepends="py3-pytest py3-pytest-httpx py3-dirty-equals py3-python-multipart py3-flask py3-jwt py3-passlib py3-email-validator"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/f/fastapi/fastapi-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f3cec4395f3201660339e400846bf90cd458b9cfc47c9f9827eb27139f37dadf210dd4a82437db60b3eae7535b3a22d587d505cbc76102029c2c1eafc0a348ef  fastapi-0.115.0.tar.gz
"

A py3-pyodbc/APKBUILD => py3-pyodbc/APKBUILD +37 -0
@@ 0,0 1,37 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-pyodbc
pkgver=5.1.0
pkgrel=0
_pkgreal=pyodbc
pkgdesc="DB API module for ODBC"
url="https://pypi.org/project/pyodbc/"
arch="all"
license="MIT License"
makedepends="python3-dev unixodbc-dev py3-gpep517 py3-setuptools py3-wheel"
# Failing tests; to investigate.
options="!check"
#checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/p/pyodbc/pyodbc-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
78817864d30048eed0c670a30e1cc66bc72edd6c21d069a5cc5831ed180b25a5b30d2bf2313628431943defbae66c2df96e90781ef17bb8929622b9f49cfcaab  pyodbc-5.1.0.tar.gz
"

A py3-pypika-tortoise/APKBUILD => py3-pypika-tortoise/APKBUILD +40 -0
@@ 0,0 1,40 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-pypika-tortoise
pkgver=0.2.1
pkgrel=0
_pkgreal=pypika-tortoise
pkgdesc="Forked from pypika and streamline just for tortoise-orm"
url="https://pypi.org/project/pypika-tortoise/"
arch="noarch"
license="Apache-2.0"
makedepends="py3-poetry-core py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/tortoise/pypika-tortoise/archive/refs/tags/v0.2.1.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	# ???
	rm "$pkgdir/usr/lib/python3.12/site-packages/README.md"
	rm "$pkgdir/usr/lib/python3.12/site-packages/CHANGELOG.md"
}

sha512sums="
8bfa19beb694cfa09caa70b632ace326b5109019ea51405acad953d522efc8cde09a7d41e1ac1a1ce9f4768fca1100ba444f3d36ccdadecffca0a72d992bed82  pypika-tortoise-0.2.1.tar.gz
"

A py3-python-engineio/APKBUILD => py3-python-engineio/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-python-engineio
pkgver=4.9.1
pkgrel=0
_pkgreal=python-engineio
pkgdesc="Engine.IO server and client for Python"
url="https://pypi.org/project/python-engineio/"
arch="noarch"
license="MIT"
depends="py3-simple-websocket"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
# Two tests fail and I don't know why at the moment.
options="!check"
#checkdepends="py3-pytest py3-tox"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/python-engineio/python_engineio-$pkgver.tar.gz"
builddir="$srcdir/python_engineio-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m tox -e py312 --sitepackages
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ef90ee77a2f2dba6a34706597919f68b73547f4a47b5e8ba00f515c899638b6fff608bb1481547789ee0677b9af9a2e5b278fc9cd09ce52942443ff56e48bf0d  python_engineio-4.9.1.tar.gz
"

A py3-python-socketio/APKBUILD => py3-python-socketio/APKBUILD +37 -0
@@ 0,0 1,37 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-python-socketio
pkgver=5.11.4
pkgrel=0
_pkgreal=python-socketio
pkgdesc="Socket.IO server and client for Python"
url="https://pypi.org/project/python-socketio/"
arch="noarch"
license="MIT"
depends="py3-bidict py3-python-engineio"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-tox"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/python-socketio/python_socketio-$pkgver.tar.gz"
builddir="$srcdir/python_socketio-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m tox -e py312 --sitepackages
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c61d8247b1f2aab5eb2094a1c6bdd9cd53da66847584c48e7f8e026f8ba1705a87a8bfb7837485c1c3929b6d40b453d297a3a109298eb4ce6d6a784f08da2e1b  python_socketio-5.11.4.tar.gz
"

A py3-simple-websocket/APKBUILD => py3-simple-websocket/APKBUILD +38 -0
@@ 0,0 1,38 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-simple-websocket
pkgver=1.0.0
pkgrel=0
_pkgreal=simple-websocket
pkgdesc="Simple WebSocket server and client for Python"
url="https://pypi.org/project/simple-websocket/"
arch="noarch"
license="MIT"
depends="py3-wsproto"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
# source="https://files.pythonhosted.org/packages/source/s/simple-websocket/simple-websocket-$pkgver.tar.gz"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/miguelgrinberg/simple-websocket/archive/refs/tags/v1.0.0.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
63ccc19fe09f675e098f33d32659d1314b573893014bc203abb285c3ff6c04916fd6b592bcf50cc9d65d40d4ebe739e686ac53257ff8407de60312d6e21ca1b5  simple-websocket-1.0.0.tar.gz
"

A py3-tortoise-orm/APKBUILD => py3-tortoise-orm/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-tortoise-orm
pkgver=0.21.6
pkgrel=0
_pkgreal=tortoise-orm
pkgdesc="Easy async ORM for python, built with relations in mind"
url="https://pypi.org/project/tortoise-orm/"
arch="noarch"
license="Apache-2.0"
depends="py3-aiosqlite py3-ciso8601 py3-iso8601 py3-pydantic py3-pypika-tortoise py3-tz py3-uvloop"
makedepends="py3-poetry-core py3-gpep517 py3-setuptools py3-wheel"
# Failing. Investigate.
options="!check"
#checkdepends="py3-pytest py3-pyodbc py3-asyncpg py3-fastapi py3-asyncodbc py3-aiomysql py3-psycopg-pyc"
subpackages="$pkgname-pyc"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/tortoise/tortoise-orm/archive/refs/tags/0.21.6.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3b6b9918856a30caa30339a7ee17d05691310ae22c1c559338ac22d1ab6bf532bad3235b1fb5a78e0ce63c98dd73251096b168dc3e3f39f455037a19e2538392  tortoise-orm-0.21.6.tar.gz
"

A py3-uptime-kuma-api/APKBUILD => py3-uptime-kuma-api/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-uptime-kuma-api
pkgver=1.2.1
pkgrel=0
_pkgreal=uptime-kuma-api
pkgdesc="A python wrapper for the Uptime Kuma WebSocket API"
url="https://pypi.org/project/uptime-kuma-api/"
arch="noarch"
license="MIT"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
# Tests fail. Investigate.
options="!check"
#checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/u/uptime-kuma-api/uptime_kuma_api-$pkgver.tar.gz"
#source="$_pkgreal-$pkgver.tar.gz::https://github.com/lucasheld/uptime-kuma-api/archive/refs/tags/1.2.1.tar.gz"
builddir="$srcdir/uptime_kuma_api-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
2efbf4ebdbc82b09b6b3000173a1f5afd14e499903a3a4235ffabe49ec4865f9923b3f74c18cad7fd6807c8ff088c78b742f15e41d7ddc311684ab761ebe3405  uptime_kuma_api-1.2.1.tar.gz
"

A py3-uptime-kuma-web-api/APKBUILD => py3-uptime-kuma-web-api/APKBUILD +89 -0
@@ 0,0 1,89 @@
# Contributor: chimo <chimo@chromic.org>
# Maintainer: chimo <chimo@chromic.org>
pkgname=py3-uptime-kuma-web-api
pkgver=1.2.2
pkgrel=0
_pkgreal=uptime-kuma-web-api
pkgdesc="Uptime Kuma REST API"
url="https://github.com/MedAziz11/Uptime-Kuma-Web-API"
arch="noarch"
license="custom"
depends="
	py3-aiosqlite
	py3-anyio
	py3-bcrypt
	py3-bidict
	py3-certifi
	py3-charset-normalizer
	py3-click
	py3-dotenv
	py3-fastapi
	py3-h11
	py3-httptools
	py3-idna
	py3-iso8601
	py3-packaging
	py3-passlib
	py3-pydantic
	py3-pydantic-settings
	py3-jwt
	py3-parsing
	py3-pypika-tortoise
	py3-python-engineio
	py3-python-multipart
	py3-python-socketio
	py3-tz
	py3-yaml
	py3-requests
	py3-six
	py3-sniffio
	py3-starlette
	py3-tortoise-orm
	py3-typing-extensions
	py3-uptime-kuma-api
	py3-urllib3
	py3-uvloop
	py3-watchfiles
	py3-websocket-client
	py3-websockets
	py3-asyncio
	py3-gunicorn
	uvicorn
"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
# No tests
options="!check"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
pkgusers="kuma-api"
pkggroups="www-data"
#source="$_pkgreal-$pkgver.tar.gz::https://github.com/MedAziz11/Uptime-Kuma-Web-API/archive/refs/tags/v1.2.2.tar.gz"
source="
	$pkgname.initd
	$pkgname.confd
	$_pkgreal-$pkgver.tar.gz::https://github.com/MedAziz11/Uptime-Kuma-Web-API/archive/refs/tags/v1.2.2.tar.gz
"
builddir="$srcdir/Uptime-Kuma-Web-API-$pkgver"

package() {
	installdir="$pkgdir/usr/share/webapps/$pkgname"

	install -D -m 755 -o kuma-api -g www-data -d "$installdir/db"

	cp -r "$builddir/app" "$installdir/"

	install -d -m 755 -o kuma-api -g www-data \
		$pkgdir/var/log/$pkgname

        install -m 755 -D "$srcdir/$pkgname.initd" \
                "$pkgdir/etc/init.d/$pkgname"
        install -m 644 -D "$srcdir/$pkgname.confd" \
                "$pkgdir/etc/conf.d/$pkgname"
}


sha512sums="
63a8f871ecf6b1c5e6da13922c469dbeece8b4f6ca6516addd62c7fc94f5648b8243cefc4b65310a37ae1f522f4a19be6bdf29c0a737595054b462e35f2c66ea  py3-uptime-kuma-web-api.initd
05cbfc18d8534ee1453b78287d6274c56dd88a3c7b0786e1ef9d867bfcf8a0373e6b54756e58986a9fef52d41ad5335cc3996208ad3c1041d1412fcdd190a89a  py3-uptime-kuma-web-api.confd
2c60abbdbeafed0a42f49ccee02f335967ce7bb100512fb1fba8dc324e677a3147b7f0d215b6fa42ee4ad2d8784c9c2188f2f25c219a8fc4b1612e16e8436edf  uptime-kuma-web-api-1.2.2.tar.gz
"

A py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.confd => py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.confd +16 -0
@@ 0,0 1,16 @@
NAME=uptime-kuma-web-api
USER=kuma-api
GROUP=kuma-api
WORKERS=1
WORKER_CLASS=uvicorn.workers.UvicornWorker
BIND=0.0.0.0:8000
LOG_LEVEL=info

KUMA_SERVER=http://localhost:3001
KUMA_USERNAME=admin
KUMA_PASSWORD=admin
ADMIN_PASSWORD=api_password

# Comment out to disable process supervisor.
supervisor=supervise-daemon


A py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.initd => py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.initd +40 -0
@@ 0,0 1,40 @@
#!/sbin/openrc-run

name="py3-uptime-kuma-web-api"
description="Uptime Kuma REST API"

export DIR=/app
export KUMA_SERVER="${KUMA_SERVER}"
export KUMA_USERNAME="${KUMA_USERNAME}"
export KUMA_PASSWORD="${KUMA_PASSWORD}"
export ADMIN_PASSWORD="${ADMIN_PASSWORD}"

command="/usr/bin/gunicorn"
command_args="main:app \                 
        --name ${NAME:-uptime-kuma-web-api} \
        --workers ${WORKERS:-1} \     
        --worker-class ${WORKER_CLASS:-uvicorn.workers.UvicornWorker} \
        --user=${USER:-kuma-api} \
        --group=${GROUP:-kuma-api} \
        --bind=${BIND:-0.0.0.0:8000} \
        --log-level=${LOG_LEVEL:-info}"

command_background="true"
command_user="kuma-api:kuma-api"

directory="/usr/share/webapps/${name}/app"

error_logger="logger"
output_logger="logger"

pidfile="/run/$RC_SVCNAME.pid"

depend() {
	need net
	after firewall
}

start_pre() {
        checkpath -d -o $command_user ${pidfile%/*}
}


A py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.pre-install => py3-uptime-kuma-web-api/py3-uptime-kuma-web-api.pre-install +6 -0
@@ 0,0 1,6 @@
#!/bin/sh

addgroup -S kuma-api 2>/dev/null
adduser -S -D -H -s /sbin/nologin -G kuma-api -g kuma-api kuma-api 2>/dev/null

exit 0