From c84afa44f4498f520ccd95e9cb70fa4b55fabbc6 Mon Sep 17 00:00:00 2001 From: Haro Date: Wed, 14 Oct 2026 13:16:00 +0000 Subject: [PATCH] [NEW][pterodactyl][0.0.14] --- pterodactyl/.helmignore | 5 + pterodactyl/Chart.yaml | 6 + pterodactyl/OlaresManifest.yaml | 129 +++++++++++++++++ pterodactyl/i18n/de-DE/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/en-US/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/es-ES/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/fr-FR/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/it-IT/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/ja-JP/OlaresManifest.yaml | 30 ++++ pterodactyl/i18n/zh-CN/OlaresManifest.yaml | 30 ++++ pterodactyl/owners | 3 + pterodactyl/templates/configmap.yaml | 159 +++++++++++++++++++++ pterodactyl/templates/deployment.yaml | 140 ++++++++++++++++++ pterodactyl/templates/secret.yaml | 18 +++ pterodactyl/templates/wings.yaml | 105 ++++++++++++++ pterodactyl/values.yaml | 8 ++ 16 files changed, 783 insertions(+) create mode 100644 pterodactyl/.helmignore create mode 100644 pterodactyl/Chart.yaml create mode 100644 pterodactyl/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/de-DE/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/en-US/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/es-ES/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/fr-FR/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/it-IT/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/ja-JP/OlaresManifest.yaml create mode 100644 pterodactyl/i18n/zh-CN/OlaresManifest.yaml create mode 100644 pterodactyl/owners create mode 100644 pterodactyl/templates/configmap.yaml create mode 100644 pterodactyl/templates/deployment.yaml create mode 100644 pterodactyl/templates/secret.yaml create mode 100644 pterodactyl/templates/wings.yaml create mode 100644 pterodactyl/values.yaml diff --git a/pterodactyl/.helmignore b/pterodactyl/.helmignore new file mode 100644 index 000000000..f0daaec3b --- /dev/null +++ b/pterodactyl/.helmignore @@ -0,0 +1,5 @@ +*.md +test*/ +assets/ +files/ +.git/ diff --git a/pterodactyl/Chart.yaml b/pterodactyl/Chart.yaml new file mode 100644 index 000000000..a60f886e6 --- /dev/null +++ b/pterodactyl/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: pterodactyl +description: Pterodactyl Panel for Olares +type: application +version: 0.0.14 +appVersion: '1.15.1' diff --git a/pterodactyl/OlaresManifest.yaml b/pterodactyl/OlaresManifest.yaml new file mode 100644 index 000000000..d32f109e7 --- /dev/null +++ b/pterodactyl/OlaresManifest.yaml @@ -0,0 +1,129 @@ +olaresManifest.version: '0.12.0' +olaresManifest.type: app +apiVersion: v3 +metadata: + name: pterodactyl + title: Pterodactyl Panel + description: Game server management with an experimental local Wings node. + icon: https://cdn.olares.com/images/2026/10/a6d9f087598ca3a354f566343f1b2588.png + version: 0.0.14 + categories: + - Developer Tools + - Fun + - homelab + tags: + - gaming +entrances: + - name: panel + host: pterodactyl + port: 8080 + title: Pterodactyl Panel + icon: https://cdn.olares.com/images/2026/10/a6d9f087598ca3a354f566343f1b2588.png + authLevel: private + openMethod: window + - name: wings + host: wings + port: 8080 + title: Wings API + icon: https://cdn.olares.com/images/2026/10/a6d9f087598ca3a354f566343f1b2588.png + authLevel: public + invisible: true +ports: + - name: wingssftp + host: wings + port: 2022 + exposePort: 42022 + protocol: tcp + - name: wingstestgame + host: wings + port: 30000 + exposePort: 43000 + protocol: tcp +spec: + versionName: '1.15.1' + developer: Pterodactyl Software + website: https://pterodactyl.io/ + sourceCode: https://github.com/pterodactyl/panel + doc: https://docs.pterodactyl.io/v1 + submitter: harveyff + locale: + - en-US + - zh-CN + - de-DE + - es-ES + - fr-FR + - it-IT + - ja-JP + license: + - text: MIT License + url: https://github.com/pterodactyl/panel/blob/develop/LICENSE.md + featuredImage: https://cdn.olares.com/images/2026/10/e6b8791ebba2f51e2cdc6e783a6f0a58.png + promoteImage: + - https://cdn.olares.com/images/2026/10/e6b8791ebba2f51e2cdc6e783a6f0a58.png + - https://cdn.olares.com/images/2026/10/3d08eb1c79172687b0622fcea9247940.png + - https://cdn.olares.com/images/2026/10/7e42f94f2ec59d6abab793d424308add.png + fullDescription: | + Pterodactyl is an open-source game server management panel. Manage server consoles, files, schedules, backups and user permissions from your browser. + + Panel manages game servers created through Wings. It does not take over Minecraft or other applications installed separately from Olares Market. + + This Olares package includes Panel 1.15.1 and an experimental local Wings 1.13.3 node backed by Docker-in-Docker. Set the administrator username and password during installation. Existing administrators are preserved on upgrades. + + The local Docker service runs in a privileged container. Panel and Wings run as UID/GID 1000. Game installation scripts must create files with matching ownership; arbitrary game templates may need adaptation. + + Create an allocation for 0.0.0.0:30000 in Panel before adding a local game server. This internal TCP port is exposed as node TCP 43000. SFTP uses node TCP 42022. Advertise the actual node address and exposed port to game clients. Other game ports require additional configuration. + + Create Terraria/TShock servers with Egg templates and use Panel to manage startup, shutdown, console commands, backups and recovery. + + MariaDB middleware is required. Export the Panel database before uninstalling if retaining accounts and configuration; retaining App Data alone does not guarantee database preservation. Configure SMTP separately for email delivery. + supportArch: + - amd64 + - arm64 + requiredCpu: '1' + limitedCpu: '6' + requiredMemory: 1Gi + limitedMemory: 8Gi + requiredDisk: 1Gi + limitedDisk: 20Gi +permission: + appData: true + appCache: true +middleware: + mariadb: + username: pterodactyl + databases: + - name: panel + redis: + namespace: pterodactyl +options: + apiTimeout: 300 + dependencies: + - name: olares + type: system + version: '>=1.12.6-0' + - name: mariadb + type: middleware + version: '>=10.0.0-0' + mandatory: true +workloadReplicas: + pterodactyl: 1 + wings: 1 +envs: + - envName: ENABLE_WINGS + type: bool + default: 'true' + required: false + editable: false + description: Run a local Wings node with a privileged Docker-in-Docker service + - envName: ADMIN_USERNAME + type: string + required: true + editable: false + regex: '^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,63}$' + description: Administrator username + - envName: ADMIN_PASSWORD + type: password + required: true + editable: false + regex: '^.{8,}$' + description: Administrator password (at least 8 characters) diff --git a/pterodactyl/i18n/de-DE/OlaresManifest.yaml b/pterodactyl/i18n/de-DE/OlaresManifest.yaml new file mode 100644 index 000000000..5d364d2e4 --- /dev/null +++ b/pterodactyl/i18n/de-DE/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: Gameserver-Verwaltung mit experimentellem lokalem Wings-Knoten +spec: + fullDescription: | + Pterodactyl ist ein quelloffenes Verwaltungspanel für Gameserver. Verwalten Sie Konsolen, Dateien, Zeitpläne, Backups und Benutzerrechte im Browser. + + Panel verwaltet Gameserver, die über Wings erstellt wurden. Separat aus Olares Market installierte Anwendungen, einschließlich Minecraft, werden nicht übernommen. + + Dieses Olares-Paket enthält Panel 1.15.1 und einen experimentellen lokalen Wings-Knoten 1.13.3 mit Docker-in-Docker. Legen Sie den Administratornamen und das Passwort bei der Installation fest. Bestehende Administratorkonten bleiben bei Upgrades erhalten. + + Der lokale Docker-Dienst läuft in einem privilegierten Container. Panel und Wings verwenden UID/GID 1000. Installationsskripte für Spiele müssen Dateien mit derselben Eigentümerzuordnung erstellen; andere Spielvorlagen können Anpassungen erfordern. + + Erstellen Sie in Panel eine Zuweisung für 0.0.0.0:30000, bevor Sie einen lokalen Gameserver hinzufügen. Dieser interne TCP-Port wird als TCP 43000 am Knoten bereitgestellt. SFTP verwendet TCP 42022 am Knoten. Verwenden Sie für Spielclients die tatsächliche Knotenadresse und den externen Port. Weitere Spielports erfordern zusätzliche Konfiguration. + + Erstellen Sie Terraria/TShock-Server mit Egg-Vorlagen und verwalten Sie Start, Stopp, Konsolenbefehle, Backups und Wiederherstellung über Panel. + + MariaDB-Middleware ist erforderlich. Exportieren Sie vor der Deinstallation die Panel-Datenbank, wenn Konten und Konfiguration erhalten bleiben sollen. Das Beibehalten der App-Daten allein garantiert keinen Datenbankerhalt. Konfigurieren Sie SMTP separat für den E-Mail-Versand. +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: Lokalen Wings-Knoten mit einem privilegierten Docker-in-Docker-Dienst ausführen +- envName: ADMIN_USERNAME + description: Administratorname +- envName: ADMIN_PASSWORD + description: Administratorpasswort (mindestens 8 Zeichen) diff --git a/pterodactyl/i18n/en-US/OlaresManifest.yaml b/pterodactyl/i18n/en-US/OlaresManifest.yaml new file mode 100644 index 000000000..e07df9050 --- /dev/null +++ b/pterodactyl/i18n/en-US/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: Game server management with an experimental local Wings node +spec: + fullDescription: | + Pterodactyl is an open-source game server management panel. Manage server consoles, files, schedules, backups and user permissions from your browser. + + Panel manages game servers created through Wings. It does not take over Minecraft or other applications installed separately from Olares Market. + + This Olares package includes Panel 1.15.1 and an experimental local Wings 1.13.3 node backed by Docker-in-Docker. Set the administrator username and password during installation. Existing administrators are preserved on upgrades. + + The local Docker service runs in a privileged container. Panel and Wings run as UID/GID 1000. Game installation scripts must create files with matching ownership; arbitrary game templates may need adaptation. + + Create an allocation for 0.0.0.0:30000 in Panel before adding a local game server. This internal TCP port is exposed as node TCP 43000. SFTP uses node TCP 42022. Advertise the actual node address and exposed port to game clients. Other game ports require additional configuration. + + Create Terraria/TShock servers with Egg templates and use Panel to manage startup, shutdown, console commands, backups and recovery. + + MariaDB middleware is required. Export the Panel database before uninstalling if retaining accounts and configuration; retaining App Data alone does not guarantee database preservation. Configure SMTP separately for email delivery. +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: Run a local Wings node with a privileged Docker-in-Docker service +- envName: ADMIN_USERNAME + description: Administrator username +- envName: ADMIN_PASSWORD + description: Administrator password (at least 8 characters) diff --git a/pterodactyl/i18n/es-ES/OlaresManifest.yaml b/pterodactyl/i18n/es-ES/OlaresManifest.yaml new file mode 100644 index 000000000..23e49c783 --- /dev/null +++ b/pterodactyl/i18n/es-ES/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: Gestión de servidores de juegos con un nodo Wings local experimental +spec: + fullDescription: | + Pterodactyl es un panel de código abierto para gestionar servidores de juegos. Administra consolas, archivos, tareas programadas, copias de seguridad y permisos de usuario desde el navegador. + + Panel gestiona servidores de juegos creados mediante Wings. No toma el control de Minecraft ni de otras aplicaciones instaladas por separado desde Olares Market. + + Este paquete de Olares incluye Panel 1.15.1 y un nodo Wings 1.13.3 local experimental con Docker-in-Docker. Define el nombre de usuario y la contraseña del administrador durante la instalación. Las actualizaciones conservan las cuentas de administrador existentes. + + El servicio Docker local se ejecuta en un contenedor privilegiado. Panel y Wings usan UID/GID 1000. Los scripts de instalación de juegos deben crear archivos con el mismo propietario; otras plantillas pueden necesitar adaptaciones. + + Antes de añadir un servidor local, crea en Panel una asignación para 0.0.0.0:30000. Este puerto TCP interno se expone como TCP 43000 del nodo. SFTP usa TCP 42022 del nodo. Usa la dirección real del nodo y el puerto externo para conectar los clientes del juego. Otros puertos requieren configuración adicional. + + Crea servidores Terraria/TShock con plantillas Egg y usa Panel para gestionar el inicio, la parada, los comandos de consola, las copias de seguridad y la recuperación. + + Se requiere el middleware MariaDB. Exporta la base de datos de Panel antes de desinstalar si necesitas conservar cuentas y configuración; conservar solo los datos de la aplicación no garantiza la conservación de la base de datos. Configura SMTP por separado para enviar correo. +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: Ejecutar un nodo Wings local con un servicio Docker-in-Docker privilegiado +- envName: ADMIN_USERNAME + description: Nombre de usuario del administrador +- envName: ADMIN_PASSWORD + description: Contraseña del administrador (al menos 8 caracteres) diff --git a/pterodactyl/i18n/fr-FR/OlaresManifest.yaml b/pterodactyl/i18n/fr-FR/OlaresManifest.yaml new file mode 100644 index 000000000..75ffeccd6 --- /dev/null +++ b/pterodactyl/i18n/fr-FR/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: Gestion de serveurs de jeux avec un nœud Wings local expérimental +spec: + fullDescription: | + Pterodactyl est un panneau open source de gestion de serveurs de jeux. Gérez les consoles, fichiers, tâches planifiées, sauvegardes et permissions depuis votre navigateur. + + Panel gère les serveurs de jeux créés via Wings. Il ne prend pas en charge les applications installées séparément depuis Olares Market, y compris Minecraft. + + Ce paquet Olares comprend Panel 1.15.1 et un nœud Wings 1.13.3 local expérimental utilisant Docker-in-Docker. Définissez le nom d’utilisateur et le mot de passe administrateur pendant l’installation. Les mises à niveau conservent les comptes administrateur existants. + + Le service Docker local fonctionne dans un conteneur privilégié. Panel et Wings utilisent UID/GID 1000. Les scripts d’installation des jeux doivent créer des fichiers avec le même propriétaire ; les autres modèles peuvent nécessiter une adaptation. + + Avant d’ajouter un serveur local, créez une allocation pour 0.0.0.0:30000 dans Panel. Ce port TCP interne est exposé sur le port TCP 43000 du nœud. SFTP utilise le port TCP 42022 du nœud. Utilisez l’adresse réelle du nœud et le port externe pour les clients du jeu. Les autres ports nécessitent une configuration supplémentaire. + + Créez des serveurs Terraria/TShock avec des modèles Egg et utilisez Panel pour gérer le démarrage, l’arrêt, les commandes de console, les sauvegardes et la restauration. + + Le middleware MariaDB est requis. Exportez la base de données de Panel avant la désinstallation pour conserver les comptes et la configuration. Conserver uniquement les données de l’application ne garantit pas la conservation de la base de données. Configurez SMTP séparément pour l’envoi d’e-mails. +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: Exécuter un nœud Wings local avec un service Docker-in-Docker privilégié +- envName: ADMIN_USERNAME + description: Nom d’utilisateur administrateur +- envName: ADMIN_PASSWORD + description: Mot de passe administrateur (au moins 8 caractères) diff --git a/pterodactyl/i18n/it-IT/OlaresManifest.yaml b/pterodactyl/i18n/it-IT/OlaresManifest.yaml new file mode 100644 index 000000000..5239fd36e --- /dev/null +++ b/pterodactyl/i18n/it-IT/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: Gestione di server di gioco con un nodo Wings locale sperimentale +spec: + fullDescription: | + Pterodactyl è un pannello open source per gestire server di gioco. Gestisci console, file, attività pianificate, backup e permessi utente dal browser. + + Panel gestisce i server di gioco creati tramite Wings. Non prende il controllo di Minecraft o di altre applicazioni installate separatamente da Olares Market. + + Questo pacchetto Olares include Panel 1.15.1 e un nodo Wings 1.13.3 locale sperimentale basato su Docker-in-Docker. Imposta nome utente e password dell’amministratore durante l’installazione. Gli aggiornamenti conservano gli account amministratore esistenti. + + Il servizio Docker locale viene eseguito in un container privilegiato. Panel e Wings usano UID/GID 1000. Gli script di installazione dei giochi devono creare file con lo stesso proprietario; altri modelli possono richiedere adattamenti. + + Prima di aggiungere un server locale, crea in Panel un’allocazione per 0.0.0.0:30000. Questa porta TCP interna è esposta come TCP 43000 sul nodo. SFTP usa TCP 42022 sul nodo. Usa l’indirizzo effettivo del nodo e la porta esterna per i client di gioco. Le altre porte richiedono configurazioni aggiuntive. + + Crea server Terraria/TShock con modelli Egg e usa Panel per gestire avvio, arresto, comandi della console, backup e ripristino. + + È richiesto il middleware MariaDB. Esporta il database di Panel prima della disinstallazione per conservare account e configurazione; mantenere solo i dati dell’applicazione non garantisce la conservazione del database. Configura SMTP separatamente per l’invio delle e-mail. +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: Eseguire un nodo Wings locale con un servizio Docker-in-Docker privilegiato +- envName: ADMIN_USERNAME + description: Nome utente amministratore +- envName: ADMIN_PASSWORD + description: Password amministratore (almeno 8 caratteri) diff --git a/pterodactyl/i18n/ja-JP/OlaresManifest.yaml b/pterodactyl/i18n/ja-JP/OlaresManifest.yaml new file mode 100644 index 000000000..577c48d6c --- /dev/null +++ b/pterodactyl/i18n/ja-JP/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: 実験的なローカルWingsノードを備えたゲームサーバー管理パネル +spec: + fullDescription: | + Pterodactylはオープンソースのゲームサーバー管理パネルです。ブラウザーからコンソール、ファイル、スケジュール、バックアップ、ユーザー権限を管理できます。 + + PanelはWingsで作成したゲームサーバーを管理します。Olares Marketから個別にインストールしたMinecraftや他のアプリを引き継ぐことはできません。 + + Olares向けパッケージには、Panel 1.15.1とDocker-in-Dockerで動作する実験的なローカルWings 1.13.3ノードが含まれます。インストール時に管理者のユーザー名とパスワードを設定します。アップグレード時には既存の管理者アカウントが保持されます。 + + ローカルDockerサービスは特権コンテナーで動作します。PanelとWingsはUID/GID 1000で実行されます。ゲームのインストールスクリプトが作成するファイルも同じ所有者である必要があります。他のゲームテンプレートには調整が必要な場合があります。 + + ローカルゲームサーバーを追加する前に、Panelで0.0.0.0:30000のポート割り当てを作成してください。この内部TCPポートはノードのTCP 43000に公開されます。SFTPはノードのTCP 42022を使用します。ゲームクライアントには実際のノードアドレスと外部ポートを指定してください。他のゲームポートには追加設定が必要です。 + + EggテンプレートでTerraria/TShockサーバーを作成し、Panelから起動・停止、コンソールコマンド、バックアップと復元を管理できます。 + + MariaDBミドルウェアが必要です。アカウントと設定を保持するには、アンインストール前にPanelのデータベースをエクスポートしてください。アプリデータを保持するだけではデータベースの保持は保証されません。メール送信にはSMTPを別途設定してください。 +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: 特権Docker-in-DockerサービスでローカルWingsノードを実行 +- envName: ADMIN_USERNAME + description: 管理者ユーザー名 +- envName: ADMIN_PASSWORD + description: 管理者パスワード(8文字以上) diff --git a/pterodactyl/i18n/zh-CN/OlaresManifest.yaml b/pterodactyl/i18n/zh-CN/OlaresManifest.yaml new file mode 100644 index 000000000..5e7982a1d --- /dev/null +++ b/pterodactyl/i18n/zh-CN/OlaresManifest.yaml @@ -0,0 +1,30 @@ +metadata: + title: Pterodactyl Panel + description: 游戏服务器管理面板,包含实验性的本地 Wings 节点 +spec: + fullDescription: | + Pterodactyl 是开源的游戏服务器管理面板。通过浏览器管理服务器控制台、文件、计划任务、备份和用户权限。 + + Panel 管理通过 Wings 创建的游戏服务器,不会接管从 Olares Market 独立安装的 Minecraft 或其他应用。 + + Olares 版本包含 Panel 1.15.1 和实验性的本地 Wings 1.13.3 节点,后者通过 Docker-in-Docker 运行。安装时设置管理员用户名和密码。升级时保留现有管理员账户。 + + 本地 Docker 服务运行在特权容器中。Panel 和 Wings 使用 UID/GID 1000 运行。游戏安装脚本创建的文件必须使用相同的所有者;其他游戏模板可能需要适配。 + + 添加本地游戏服务器前,在 Panel 中为 0.0.0.0:30000 创建端口分配。内部 TCP 端口映射到节点的 TCP 43000,SFTP 使用节点的 TCP 42022。连接游戏时使用实际节点地址和对外端口。其他游戏端口需要另行配置。 + + 支持通过 Egg 模板创建 Terraria/TShock 服务器,并使用 Panel 管理服务器启停、控制台命令和备份恢复。 + + 需要 MariaDB 中间件。如需保留账户和配置,请在卸载前导出 Panel 数据库;仅保留应用数据不保证数据库能够保留。邮件发送需要单独配置 SMTP。 +entrances: +- name: panel + title: Pterodactyl Panel +- name: wings + title: Wings API +envs: +- envName: ENABLE_WINGS + description: 通过特权 Docker-in-Docker 服务运行本地 Wings 节点 +- envName: ADMIN_USERNAME + description: 管理员用户名 +- envName: ADMIN_PASSWORD + description: 管理员密码(至少 8 个字符) diff --git a/pterodactyl/owners b/pterodactyl/owners new file mode 100644 index 000000000..54214d082 --- /dev/null +++ b/pterodactyl/owners @@ -0,0 +1,3 @@ +owners: + - username: '@beclab' + title: 'Olares' diff --git a/pterodactyl/templates/configmap.yaml b/pterodactyl/templates/configmap.yaml new file mode 100644 index 000000000..5c12e12b7 --- /dev/null +++ b/pterodactyl/templates/configmap.yaml @@ -0,0 +1,159 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: pterodactyl-config +data: + admin.php: | + make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + if (!Pterodactyl\Models\User::where('root_admin', true)->exists()) { + $username = getenv('ADMIN_USERNAME'); + $password = getenv('ADMIN_PASSWORD'); + if (!$username || !$password) { + throw new RuntimeException('Administrator username and password must be supplied at installation.'); + } + $app->make(Pterodactyl\Services\Users\UserCreationService::class)->handle([ + 'email' => 'admin@example.com', + 'username' => $username, + 'name_first' => 'Panel', + 'name_last' => 'Administrator', + 'password' => $password, + 'root_admin' => true, + ]); + } + nginx.conf: | + pid /tmp/nginx.pid; + error_log /dev/stderr; + events { worker_connections 1024; } + http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + access_log /dev/stdout; + client_body_temp_path /tmp/client-body; + fastcgi_temp_path /tmp/fastcgi; + proxy_temp_path /tmp/proxy; + uwsgi_temp_path /tmp/uwsgi; + scgi_temp_path /tmp/scgi; + server { + listen 8080; + server_name _; + root /app/public; + index index.php; + client_max_body_size 100m; + location / { try_files $uri $uri/ /index.php?$query_string; } + location ~ \.php$ { + include /etc/nginx/fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTP_PROXY ""; + fastcgi_read_timeout 300; + fastcgi_buffer_size 16k; + fastcgi_buffers 4 16k; + } + location ~ /\. { deny all; } + } + } + php-fpm.conf: | + [global] + pid = /tmp/php-fpm.pid + error_log = /proc/self/fd/2 + daemonize = no + [www] + listen = 127.0.0.1:9000 + pm = ondemand + pm.max_children = 9 + pm.process_idle_timeout = 10s + clear_env = no + catch_workers_output = yes + php_admin_value[upload_max_filesize] = 100M + php_admin_value[post_max_size] = 100M + start.sh: | + #!/bin/ash + set -eu + cd /app + export HOME=/app + printf '[client]\nskip-ssl\n' > /app/.my.cnf + mkdir -p storage/logs storage/framework/cache/data storage/framework/sessions storage/framework/views bootstrap/cache + # Retain the encryption key with durable data across namespace recreation. + if [ -s /data/app-key ]; then + export APP_KEY="$(cat /data/app-key)" + else + umask 077 + printf '%s' "$APP_KEY" > /data/app-key + fi + touch .env + php artisan migrate --seed --force + php /config/admin.php + if [ "${ENABLE_WINGS:-false}" = true ]; then + php /config/wings-node.php + fi + exec supervisord -n -c /config/supervisord.conf + supervisord.conf: | + [supervisord] + nodaemon=true + logfile=/dev/null + pidfile=/tmp/supervisord.pid + [program:php] + command=php-fpm -F -y /config/php-fpm.conf + autorestart=true + stdout_logfile=/dev/stdout + stdout_logfile_maxbytes=0 + stderr_logfile=/dev/stderr + stderr_logfile_maxbytes=0 + [program:nginx] + command=nginx -e /dev/stderr -c /config/nginx.conf -g 'daemon off;' + autorestart=true + stdout_logfile=/dev/stdout + stdout_logfile_maxbytes=0 + stderr_logfile=/dev/stderr + stderr_logfile_maxbytes=0 + [program:queue] + command=php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 + autorestart=true + stdout_logfile=/dev/stdout + stdout_logfile_maxbytes=0 + stderr_logfile=/dev/stderr + stderr_logfile_maxbytes=0 + [program:scheduler] + command=/bin/ash -c 'while true; do php /app/artisan schedule:run; sleep 60; done' + autorestart=true + stdout_logfile=/dev/stdout + stdout_logfile_maxbytes=0 + stderr_logfile=/dev/stderr + stderr_logfile_maxbytes=0 + wings-node.php: | + make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + $location = Pterodactyl\Models\Location::firstOrCreate(['short'=>'olares-local'],['long'=>'Local Olares Wings node']); + $node = Pterodactyl\Models\Node::where('name','Olares Local Wings')->first(); + if (!$node) { + $node = $app->make(Pterodactyl\Services\Nodes\NodeCreationService::class)->handle([ + 'name'=>'Olares Local Wings','location_id'=>$location->id,'fqdn'=>getenv('WINGS_DOMAIN'), + 'scheme'=>'https','behind_proxy'=>true,'memory'=>4096,'memory_overallocate'=>0, + 'disk'=>10240,'disk_overallocate'=>0,'daemonListen'=>443,'daemonSFTP'=>42022, + 'daemonBase'=>'/wings/volumes','public'=>false,'upload_size'=>100, + ]); + } + $config=$node->getConfiguration(); + $config['api']['port']=8080; + $config['api']['ssl']=['enabled'=>false]; + $config['system']=array_replace_recursive($config['system'],[ + 'root_directory'=>'/wings','log_directory'=>'/wings/logs','data'=>'/wings/volumes', + 'archive_directory'=>'/wings/archives','backup_directory'=>'/wings/backups', + 'tmp_directory'=>'/wings/tmp','timezone'=>'Asia/Shanghai', + 'user'=>['rootless'=>['enabled'=>true,'container_uid'=>1000,'container_gid'=>1000],'uid'=>1000,'gid'=>1000], + 'sftp'=>['bind_address'=>'0.0.0.0','bind_port'=>2022],'enable_log_rotate'=>false, + 'machine_id'=>['enabled'=>false], + ]); + $config['remote']='http://pterodactyl:8080'; + $config['allowed_mounts']=null; + $config['allowed_origins']=[getenv('APP_URL')]; + $config['docker']=['network'=>['name'=>'pterodactyl_nw','interface'=>'172.30.0.1','network_mtu'=>1450,'interfaces'=>['v4'=>['subnet'=>'172.30.0.0/16','gateway'=>'172.30.0.1']]],'installer_limits'=>['memory'=>1024,'cpu'=>100]]; + umask(0077); + file_put_contents('/data/wings/config.yml.new',Symfony\Component\Yaml\Yaml::dump($config,8,2)); + rename('/data/wings/config.yml.new','/data/wings/config.yml'); + echo "Local Wings node configured\n"; diff --git a/pterodactyl/templates/deployment.yaml b/pterodactyl/templates/deployment.yaml new file mode 100644 index 000000000..07b1a2b94 --- /dev/null +++ b/pterodactyl/templates/deployment.yaml @@ -0,0 +1,140 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pterodactyl +spec: + replicas: {{ .Values.workloads.pterodactyl.replicaCount }} + strategy: + type: Recreate + selector: + matchLabels: + app: pterodactyl + template: + metadata: + labels: + app: pterodactyl + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + spec: + enableServiceLinks: false + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + fsGroup: 1000 + initContainers: + - name: init-permissions + image: beclab/aboveos-busybox:1.37.0 + securityContext: + runAsUser: 0 + command: [sh, -c, 'mkdir -p /data/storage /data/wings; chown 1000:1000 /data /data/storage /data/wings'] + volumeMounts: + - name: data + mountPath: /data + - name: copy-app + image: {{ .Values.image }} + command: [sh, -c, 'cp -R /app/. /runtime/; cp -Rn /app/storage/. /data/storage/'] + volumeMounts: + - name: app + mountPath: /runtime + - name: data + mountPath: /data + containers: + - name: panel + image: {{ .Values.image }} + command: [/bin/ash, /config/start.sh] + envFrom: + - secretRef: + name: pterodactyl-auth + env: + - name: ENABLE_WINGS + value: {{ .Values.olaresEnv.ENABLE_WINGS | quote }} + - name: WINGS_DOMAIN + value: {{ .Values.domain.wings | quote }} + - name: APP_URL + value: 'https://{{ .Values.domain.panel }}' + - name: APP_ENV + value: production + - name: APP_DEBUG + value: 'false' + - name: RECAPTCHA_ENABLED + value: 'false' + - name: APP_TIMEZONE + value: Asia/Shanghai + - name: TRUSTED_PROXIES + value: '*' + - name: DB_HOST + value: {{ .Values.mariadb.host | quote }} + - name: DB_PORT + value: {{ .Values.mariadb.port | quote }} + - name: DB_DATABASE + value: {{ .Values.mariadb.databases.panel | quote }} + - name: DB_USERNAME + value: {{ .Values.mariadb.username | quote }} + - name: REDIS_HOST + value: {{ .Values.redis.host | quote }} + - name: REDIS_PORT + value: {{ .Values.redis.port | quote }} + - name: REDIS_PREFIX + value: pterodactyl_ + - name: CACHE_DRIVER + value: redis + - name: SESSION_DRIVER + value: redis + - name: QUEUE_CONNECTION + value: redis + - name: MAIL_MAILER + value: log + ports: + - containerPort: 8080 + startupProbe: + httpGet: + path: /auth/login + port: 8080 + failureThreshold: 60 + periodSeconds: 5 + readinessProbe: + httpGet: + path: /auth/login + port: 8080 + livenessProbe: + tcpSocket: + port: 8080 + periodSeconds: 20 + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: '2' + memory: 2Gi + volumeMounts: + - name: app + mountPath: /app + - name: data + mountPath: /data + - name: data + mountPath: /app/storage + subPath: storage + - name: config + mountPath: /config + volumes: + - name: app + emptyDir: {} + - name: data + hostPath: + path: {{ .Values.userspace.appData | quote }} + type: DirectoryOrCreate + - name: config + configMap: + name: pterodactyl-config +--- +apiVersion: v1 +kind: Service +metadata: + name: pterodactyl +spec: + selector: + app: pterodactyl + ports: + - port: 8080 + targetPort: 8080 diff --git a/pterodactyl/templates/secret.yaml b/pterodactyl/templates/secret.yaml new file mode 100644 index 000000000..06e77479b --- /dev/null +++ b/pterodactyl/templates/secret.yaml @@ -0,0 +1,18 @@ +{{- $existing := lookup "v1" "Secret" .Release.Namespace "pterodactyl-auth" -}} +{{- $key := printf "base64:%s" (randAlphaNum 32 | b64enc) -}} +{{- if and $existing $existing.data -}} +{{- $key = index $existing.data "APP_KEY" | b64dec -}} +{{- end }} +apiVersion: v1 +kind: Secret +metadata: + name: pterodactyl-auth + annotations: + helm.sh/resource-policy: keep +type: Opaque +stringData: + APP_KEY: {{ $key | quote }} + ADMIN_USERNAME: {{ .Values.olaresEnv.ADMIN_USERNAME | quote }} + ADMIN_PASSWORD: {{ .Values.olaresEnv.ADMIN_PASSWORD | quote }} + DB_PASSWORD: {{ .Values.mariadb.password | quote }} + REDIS_PASSWORD: {{ .Values.redis.password | quote }} diff --git a/pterodactyl/templates/wings.yaml b/pterodactyl/templates/wings.yaml new file mode 100644 index 000000000..e1c33ddf1 --- /dev/null +++ b/pterodactyl/templates/wings.yaml @@ -0,0 +1,105 @@ +{{- if eq (toString .Values.olaresEnv.ENABLE_WINGS) "true" }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wings +spec: + replicas: {{ .Values.workloads.wings.replicaCount }} + strategy: + type: Recreate + selector: + matchLabels: + app: wings + template: + metadata: + labels: + app: wings + annotations: + config.linkerd.io/skip-subnets: '172.30.0.0/16' + spec: + enableServiceLinks: false + initContainers: + - name: init-permissions + image: beclab/aboveos-busybox:1.37.0 + securityContext: {runAsUser: 0} + command: [sh, -c, 'mkdir -p /wings/volumes /wings/logs /wings/archives /wings/backups /wings/tmp; chown 1000:1000 /wings /wings/volumes /wings/logs /wings/archives /wings/backups /wings/tmp'] + volumeMounts: + - {name: wings-data, mountPath: /wings} + - name: wait-config + image: beclab/aboveos-busybox:1.37.0 + securityContext: {runAsUser: 1000} + command: [sh, -c, 'until test -s /wings/config.yml; do sleep 2; done'] + volumeMounts: + - {name: wings-data, mountPath: /wings} + containers: + - name: wings + image: {{ .Values.wingsImage }} + args: [--config, /wings/config.yml] + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + allowPrivilegeEscalation: false + capabilities: {drop: [ALL]} + env: + - {name: DOCKER_HOST, value: 'tcp://127.0.0.1:2375'} + - {name: WINGS_UID, value: '1000'} + - {name: WINGS_GID, value: '1000'} + ports: + - {containerPort: 8080} + - {containerPort: 2022} + startupProbe: + tcpSocket: {port: 8080} + periodSeconds: 5 + failureThreshold: 60 + readinessProbe: + tcpSocket: {port: 8080} + resources: + requests: {cpu: 100m, memory: 128Mi} + limits: {cpu: '1', memory: 512Mi} + volumeMounts: + - {name: wings-data, mountPath: /wings} + - name: dind + image: {{ .Values.dindImage }} + securityContext: {privileged: true} + env: + - {name: DOCKER_TLS_CERTDIR, value: ''} + command: + - sh + - -c + - | + if iptables -t nat -S PROXY_INIT_OUTPUT >/dev/null 2>&1; then + iptables -t nat -C PROXY_INIT_OUTPUT -d 172.30.0.0/16 -j RETURN 2>/dev/null || + iptables -t nat -I PROXY_INIT_OUTPUT 1 -d 172.30.0.0/16 -j RETURN + fi + exec dockerd --host=tcp://127.0.0.1:2375 --host=unix:///var/run/docker.sock --mtu=1450 + startupProbe: + exec: {command: [docker, info]} + periodSeconds: 5 + failureThreshold: 60 + resources: + requests: {cpu: 200m, memory: 256Mi} + limits: {cpu: '3', memory: 5Gi} + volumeMounts: + - {name: docker-data, mountPath: /var/lib/docker} + - {name: wings-data, mountPath: /wings} + volumes: + - name: wings-data + hostPath: + path: '{{ .Values.userspace.appData }}/wings' + type: DirectoryOrCreate + - name: docker-data + hostPath: + path: '{{ .Values.userspace.appCache }}/docker' + type: DirectoryOrCreate +{{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: wings +spec: + selector: {app: wings} + ports: + - {name: api, port: 8080, targetPort: 8080} + - {name: sftp, port: 2022, targetPort: 2022} + - {name: game, port: 30000, targetPort: 30000} diff --git a/pterodactyl/values.yaml b/pterodactyl/values.yaml new file mode 100644 index 000000000..daeef55eb --- /dev/null +++ b/pterodactyl/values.yaml @@ -0,0 +1,8 @@ +image: ghcr.io/pterodactyl/panel:v1.15.1 +wingsImage: ghcr.io/pterodactyl/wings:v1.13.3 +dindImage: beclab/docker:29.3.0-dind +workloads: + pterodactyl: + replicaCount: 1 + wings: + replicaCount: 1