From 0cc9046fdabc66f227f2dc53b4ce08194198164f Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sun, 10 Nov 2024 12:35:27 +0100 Subject: [PATCH] Initial Commit --- APKBUILD | 55 ++++++++++++++++++++++++++++++++++++++++ pterodactyl-queue.initd | 12 +++++++++ pterodactyl-scheduler.sh | 2 ++ 3 files changed, 69 insertions(+) create mode 100644 APKBUILD create mode 100644 pterodactyl-queue.initd create mode 100644 pterodactyl-scheduler.sh diff --git a/APKBUILD b/APKBUILD new file mode 100644 index 0000000..5ce44b7 --- /dev/null +++ b/APKBUILD @@ -0,0 +1,55 @@ +pkgname="pterodactyl-panel" +pkgver=1.11.7 +pkgrel=0 +pkgdesc="An open-source game server management panel" +url="https://pterodactyl.io" +license="MIT" +arch="noarch" +depends="php83 php83-gd php83-sodium cronie" +optdepends="redis mariadb" +makedepends="composer" +source=" +$pkgname-$pkgver.tar.gz::https://github.com/pterodactyl/panel/releases/download/v$pkgver/panel.tar.gz +pterodactyl-queue.initd +pterodactyl-scheduler.sh +" +option="!strip !check !dbg" + +build() { + install -d "$pkgname-$pkgver" + tar -xf "$pkgname-$pkgver.tar.gz" -C "$pkgname-$pkgver" + cd "$pkgname-$pkgver" + # download vendor files + composer install --no-interaction --no-dev --ignore-platform-reqs +} + +package() { + # binaries + install -d "$pkgdir/usr/share/webapps/pterodactyl" + cp -r * "$pkgdir/usr/share/webapps/pterodactyl" + # config + install -D -o root -g www-data -m 640 ".env.example" "$pkgdir/etc/webapps/pterodactyl/config.env" + ln -s "/etc/webapps/pterodactyl/config.env" "$pkgdir/usr/share/webapps/pterodactyl/.env" + # temporary cache + install -d "$pkgdir/var/cache/" + mv "$pkgdir/usr/share/webapps/pterodactyl/bootstrap/cache" "$pkgdir/var/cache/pterodactyl" + ln -s "/var/cache/pterodactyl" "$pkgdir/usr/share/webapps/pterodactyl/bootstrap/cache" + chown -R :www-data "$pkgdir/var/cache/pterodactyl" + chmod 750 "$pkgdir/var/cache/pterodactyl" + # persistent storage + install -d "$pkgdir/var/lib/" + rm "$pkgdir/usr/share/webapps/pterodactyl/storage/logs/laravel-"* + mv "$pkgdir/usr/share/webapps/pterodactyl/storage" "$pkgdir/var/lib/pterodactyl" + ln -s "/var/lib/pterodactyl" "$pkgdir/usr/share/webapps/pterodactyl/storage" + chown -R :www-data "$pkgdir/var/lib/pterodactyl" + chmod 750 "$pkgdir/var/lib/pterodactyl" + # service files + install -D -m 755 "$srcdir/pterodactyl-queue.initd" "$pkgdir/etc/init.d/pterodactyl-queue" + install -D -m 755 "$srcdir/pterodactyl-scheduler.sh" "$pkgdir/etc/periodic/minutely/pterodactyl-scheduler" +} + +sha512sums=" +4bae22da8991abfda4b7e3f0c4dd0f22713c45ec9a6e0ab0d82aae75268f63cc0cab3f2def5085d74ab67d34804b5ac759b29a7ea9d00488fcff06ed2a3633bd pterodactyl-panel-1.11.7.tar.gz +a89ca24893656ffce482f74911d9946bcfdf4846e285ec3511e720b295ece64a3520254010a132e1715b81cbf231cef84f7547494ead1764bf4c5d3a9a8f77c0 pterodactyl-queue.initd +94539e1a3336324db3b1d1f9d8127db275bc0016a84c4bab625cfbca622a5903c37610e9a9dcef635c1848c2a6423dc8202d3a7b174b372c9f0a086ca10a9732 pterodactyl-scheduler.sh +" diff --git a/pterodactyl-queue.initd b/pterodactyl-queue.initd new file mode 100644 index 0000000..fe608bc --- /dev/null +++ b/pterodactyl-queue.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +name=$RC_SVCNAME +description="Pterodactyl queue service" +supervisor="supervise-daemon" +command="/usr/bin/php" +command_args="/usr/share/webapps/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3" +command_user="http" + +depend() { + after redis +} \ No newline at end of file diff --git a/pterodactyl-scheduler.sh b/pterodactyl-scheduler.sh new file mode 100644 index 0000000..780d0df --- /dev/null +++ b/pterodactyl-scheduler.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/php /usr/share/webapps/pterodactyl/artisan schedule:run \ No newline at end of file