Initial Commit

This commit is contained in:
LinuxSquare 2024-11-10 12:35:27 +01:00
commit 0cc9046fda
3 changed files with 69 additions and 0 deletions

55
APKBUILD Normal file
View file

@ -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
"

12
pterodactyl-queue.initd Normal file
View file

@ -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
}

2
pterodactyl-scheduler.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/sh
/usr/bin/php /usr/share/webapps/pterodactyl/artisan schedule:run