mirror of
https://github.com/pterodactyl/development.git
synced 2025-12-11 22:49:17 -06:00
Beak cleanup; remove the need for mutagen
This commit is contained in:
parent
7580767215
commit
33d8397cc2
66
beak
66
beak
@ -1,26 +1,54 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# If the environment file for the Panel exists we want to source it so
|
||||||
|
# that any environment variables defined within that are passed along to
|
||||||
|
# additional commands we may call here.
|
||||||
|
if [ -f ./code/panel/.env ]; then
|
||||||
|
source ./code/panel/.env
|
||||||
|
fi
|
||||||
|
|
||||||
export WWWUSER=${WWWUSER:-$UID}
|
export WWWUSER=${WWWUSER:-$UID}
|
||||||
export WWWGROUP=${WWWGROUP:-$(id -g)}
|
export WWWGROUP=${WWWGROUP:-$(id -g)}
|
||||||
|
|
||||||
if [ "$1" == "app" ]; then
|
if ! docker compose &>/dev/null; then
|
||||||
if [ "$2" == "" ]; then
|
DOCKER_COMPOSE=(docker-compose)
|
||||||
docker compose exec -u pterodactyl app bash
|
|
||||||
elif [ "$2" == "root" ]; then
|
|
||||||
docker compose exec -u root app bash
|
|
||||||
else
|
|
||||||
echo "./beak.sh app [root]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
elif [ "$1" == "wings" ]; then
|
|
||||||
docker compose exec -u root wings bash
|
|
||||||
elif [ "$1" == "up" ]; then
|
|
||||||
shift
|
|
||||||
mutagen-compose up $@
|
|
||||||
elif [ "$1" == "down" ]; then
|
|
||||||
shift
|
|
||||||
mutagen-compose down $@
|
|
||||||
else
|
else
|
||||||
echo "./beak.sh <up|down|wings|app> [root]"
|
DOCKER_COMPOSE=(docker compose)
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ARGS=()
|
||||||
|
PEXEC=(exec -u pterodactyl app)
|
||||||
|
|
||||||
|
# Handle SSH into the container for the Panel.
|
||||||
|
if [ "$1" == "app" ]; then
|
||||||
|
shift 1
|
||||||
|
CONTAINER_USER=pterodactyl
|
||||||
|
if [ "$1" == "root" ]; then
|
||||||
|
CONTAINER_USER=root
|
||||||
|
fi
|
||||||
|
ARGS+=(exec -u "$CONTAINER_USER" app bash)
|
||||||
|
|
||||||
|
# Boot into the wings instance.
|
||||||
|
elif [ "$1" == "wings" ]; then
|
||||||
|
shift 1
|
||||||
|
"${DOCKER_COMPOSE[@]}" exec -u root wings bash
|
||||||
|
|
||||||
|
# Start an artisan instance within the container.
|
||||||
|
elif [ "$1" == "artisan" ]; then
|
||||||
|
shift 1
|
||||||
|
ARGS+=("${PEXEC[@]}" php artisan "$@")
|
||||||
|
|
||||||
|
# Handle tinker commands.
|
||||||
|
elif [ "$1" == "tinker" ]; then
|
||||||
|
shift 1
|
||||||
|
ARGS+=("${PEXEC[@]}" php artisan tinker)
|
||||||
|
|
||||||
|
elif [ "$1" == "serve" ]; then
|
||||||
|
shift 1
|
||||||
|
ARGS+=("${PEXEC[@]}" yarn run serve "$@")
|
||||||
|
|
||||||
|
else
|
||||||
|
ARGS+=("$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
"${DOCKER_COMPOSE[@]}" "${ARGS[@]}"
|
||||||
@ -9,15 +9,15 @@ fi
|
|||||||
|
|
||||||
if [ -d "/etc/php/mods-available" ]; then
|
if [ -d "/etc/php/mods-available" ]; then
|
||||||
if [ -d "/etc/php/mods-available/cli" ]; then
|
if [ -d "/etc/php/mods-available/cli" ]; then
|
||||||
ln -s /etc/php/mods-available/cli/* /etc/php/8.1/cli/conf.d
|
ln -sf /etc/php/mods-available/cli/* /etc/php/8.1/cli/conf.d
|
||||||
fi
|
fi
|
||||||
if [ -d "/etc/php/mods-available/fpm" ]; then
|
if [ -d "/etc/php/mods-available/fpm" ]; then
|
||||||
ln -s /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
|
ln -sf /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
|
||||||
fi
|
fi
|
||||||
find /etc/php/mods-available/. -maxdepth 1 -type f -print0 | while read -d $'\0' file
|
find /etc/php/mods-available/. -maxdepth 1 -type f -print0 | while read -d $'\0' file
|
||||||
do
|
do
|
||||||
ln -s "$file" /etc/php/8.1/cli/conf.d/
|
ln -sf "$file" /etc/php/8.1/cli/conf.d/
|
||||||
ln -s "$file" /etc/php/8.1/fpm/conf.d/
|
ln -sf "$file" /etc/php/8.1/fpm/conf.d/
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ services:
|
|||||||
aliases:
|
aliases:
|
||||||
- pterodactyl.test
|
- pterodactyl.test
|
||||||
volumes:
|
volumes:
|
||||||
- panel_code:/var/www/html
|
- ./code/panel:/var/www/html
|
||||||
- ./docker/certificates:/etc/certs:ro
|
- ./docker/certificates:/etc/certs:ro
|
||||||
- ./docker/php:/etc/php/mods-available:ro
|
- ./docker/php:/etc/php/mods-available:ro
|
||||||
labels:
|
labels:
|
||||||
@ -140,27 +140,9 @@ networks:
|
|||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
panel_code:
|
|
||||||
mysql:
|
mysql:
|
||||||
driver: local
|
driver: local
|
||||||
minio:
|
minio:
|
||||||
driver: local
|
driver: local
|
||||||
go_modules:
|
go_modules:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
x-mutagen:
|
|
||||||
sync:
|
|
||||||
defaults:
|
|
||||||
permissions:
|
|
||||||
defaultOwner: "id:${WWWUSER:-$$(id -u)}"
|
|
||||||
defaultGroup: "id:33"
|
|
||||||
defaultFileMode: 0644
|
|
||||||
defaultDirectoryMode: 0755
|
|
||||||
code:
|
|
||||||
alpha: "./code/panel"
|
|
||||||
beta: "volume://panel_code"
|
|
||||||
mode: "two-way-resolved"
|
|
||||||
ignore:
|
|
||||||
vcs: true
|
|
||||||
paths:
|
|
||||||
- ".idea"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user