Initial Commit

This commit is contained in:
LinuxSquare 2024-11-06 21:43:50 +01:00
commit 892c2a46f7
6 changed files with 116 additions and 0 deletions

19
APKBUILD Normal file
View file

@ -0,0 +1,19 @@
# Maintainer: LinuxSquare <linuxsquare@noveria.org>
pkgname=pterodactyl-panel-compose
pkgver=1.11.9
pkgrel=0
pkgdesc="The Pterodactyl Panel"
arch="x86_64"
url="https://pterodactyl.io/"
license="MIT"
optdepends="podman docker" # Install either podman or docker
makedepends="go"
install="$pkgname.post-install $pkgname.post-deinstall"
package() {
DESTDIR="$pkgdir" make install
local compose_path=$(find $pkgdir -name docker-compose.yml -exec dirname {} \; | sed "s|$pkgdir||")
echo "${pkgdir}${compose_path}"
sed -i "s|%VERSION%|$pkgver|" "${pkgdir}${compose_path}/docker-compose.yml"
chown -R 1337:1337 "${pkgdir}${compose_path}"
}

20
Makefile Normal file
View file

@ -0,0 +1,20 @@
PREFIX ?= /usr
SHARE_DIR=$(PREFIX)/share
APP_TIMEZONE=$(shell readlink /etc/localtime | cut -d/ -f5-)
MYSQL_PASSWORD=$(shell head /dev/urandom | tr -dc 'A-Za-z0-9!?,.$%&+-:<=>@_' | head -c32)
MYSQL_ROOT_PASSWORD=$(shell head /dev/urandom | tr -dc 'A-Za-z0-9!?,.$%&+-:<=>@_' | head -c32)
install: install-compose install-service
install-compose:
install -vDm 755 docker-compose.yml.in "$(DESTDIR)$(SHARE_DIR)/pterodactyl-panel/docker-compose.yml"
sed -i "s|%APP_TIMEZONE%|$(APP_TIMEZONE)|g" "$(DESTDIR)$(SHARE_DIR)/pterodactyl-panel/docker-compose.yml"
sed -i "s|%MYSQL_PASSWORD%|$(MYSQL_PASSWORD)|g" "$(DESTDIR)$(SHARE_DIR)/pterodactyl-panel/docker-compose.yml"
sed -i "s|%MYSQL_ROOT_PASSWORD%|$(MYSQL_ROOT_PASSWORD)|g" "$(DESTDIR)$(SHARE_DIR)/pterodactyl-panel/docker-compose.yml"
install-service:
install -vDm 755 pterodactyl-panel-compose.initd.in "$(DESTDIR)/etc/init.d/pterodactyl-panel-compose"
sed -i "s|%COMPOSEPATH%|$(SHARE_DIR)/pterodactyl-panel/docker-compose.yml|g" "$(DESTDIR)/etc/init.d/pterodactyl-panel-compose"
.PHONY: install

48
docker-compose.yml.in Normal file
View file

@ -0,0 +1,48 @@
services:
database:
image: docker.io/mariadb:10.5
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- "./database:/var/lib/mysql"
environment:
MYSQL_DATABASE: "panel"
MYSQL_USER: "pterodactyl"
MYSQL_PASSWORD: "%MYSQL_PASSWORD%"
MYSQL_ROOT_PASSWORD: "%MYSQL_ROOT_PASSWORD%"
cache:
image: docker.io/redis:alpine
restart: always
panel:
image: ghcr.io/pterodactyl/panel:v%VERSION%
restart: always
ports:
- "80:80"
- "443:443"
links:
- database
- cache
volumes:
- "./var:/app/var/"
- "./nginx:/etc/nginx/http.d/"
- "./certs:/etc/letsencrypt/"
- "./logs:/app/storage/logs"
environment:
DB_PASSWORD: "%MYSQL_PASSWORD%"
APP_ENV: "production"
APP_ENVIRONMENT_ONLY: "false"
CACHE_DRIVER: "redis"
SESSION_DRIVER: "redis"
QUEUE_DRIVER: "redis"
REDIS_HOST: "cache"
DB_HOST: "database"
DB_PORT: "3306"
RECAPTCHA_ENABLED: "false"
TRUSTED_PROXIES: "*"
APP_TIMEZONE: "%APP_TIMEZONE%"
APP_SERVICE_AUTHOR: "mail@example.com"
networks:
default:
ipam:
config:
- subnet: 172.20.0.0/16

View file

@ -0,0 +1,20 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
description="Pterodactyl Panel Containerized"
supervisor="supervise-daemon"
command="/usr/bin/podman-compose"
command_args="up -f %COMPOSEPATH% -d"
command_user="pterodactyl"
depend() {
after podman
need podman
}
stop() {
ebegin "Stopping $RC_SVCNAME"
/usr/bin/podman-compose down -f %COMPOSEPATH%
eend $?
}

View file

@ -0,0 +1,3 @@
#!/bin/sh
deluser pterodactyl 2>/dev/null

View file

@ -0,0 +1,6 @@
#!/bin/sh
addgroup -S -g 1337 pterodactyl 2>/dev/null
adduser -S -H -D -u 1337 -s /sbin/nologin -g pterodactyl pterodactyl 2>/dev/null
exit 0