Skip to content

Commit 33d8397

Browse files
committed
Beak cleanup; remove the need for mutagen
1 parent 7580767 commit 33d8397

File tree

3 files changed

+49
-39
lines changed

3 files changed

+49
-39
lines changed

beak

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,54 @@
11
#!/usr/bin/env bash
22

3+
# If the environment file for the Panel exists we want to source it so
4+
# that any environment variables defined within that are passed along to
5+
# additional commands we may call here.
6+
if [ -f ./code/panel/.env ]; then
7+
source ./code/panel/.env
8+
fi
9+
310
export WWWUSER=${WWWUSER:-$UID}
411
export WWWGROUP=${WWWGROUP:-$(id -g)}
512

13+
if ! docker compose &>/dev/null; then
14+
DOCKER_COMPOSE=(docker-compose)
15+
else
16+
DOCKER_COMPOSE=(docker compose)
17+
fi
18+
19+
ARGS=()
20+
PEXEC=(exec -u pterodactyl app)
21+
22+
# Handle SSH into the container for the Panel.
623
if [ "$1" == "app" ]; then
7-
if [ "$2" == "" ]; then
8-
docker compose exec -u pterodactyl app bash
9-
elif [ "$2" == "root" ]; then
10-
docker compose exec -u root app bash
11-
else
12-
echo "./beak.sh app [root]"
13-
exit 1
24+
shift 1
25+
CONTAINER_USER=pterodactyl
26+
if [ "$1" == "root" ]; then
27+
CONTAINER_USER=root
1428
fi
29+
ARGS+=(exec -u "$CONTAINER_USER" app bash)
30+
31+
# Boot into the wings instance.
1532
elif [ "$1" == "wings" ]; then
16-
docker compose exec -u root wings bash
17-
elif [ "$1" == "up" ]; then
18-
shift
19-
mutagen-compose up $@
20-
elif [ "$1" == "down" ]; then
21-
shift
22-
mutagen-compose down $@
33+
shift 1
34+
"${DOCKER_COMPOSE[@]}" exec -u root wings bash
35+
36+
# Start an artisan instance within the container.
37+
elif [ "$1" == "artisan" ]; then
38+
shift 1
39+
ARGS+=("${PEXEC[@]}" php artisan "$@")
40+
41+
# Handle tinker commands.
42+
elif [ "$1" == "tinker" ]; then
43+
shift 1
44+
ARGS+=("${PEXEC[@]}" php artisan tinker)
45+
46+
elif [ "$1" == "serve" ]; then
47+
shift 1
48+
ARGS+=("${PEXEC[@]}" yarn run serve "$@")
49+
2350
else
24-
echo "./beak.sh <up|down|wings|app> [root]"
25-
exit 1
51+
ARGS+=("$@")
2652
fi
53+
54+
"${DOCKER_COMPOSE[@]}" "${ARGS[@]}"

build/panel/entrypoint

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ fi
99

1010
if [ -d "/etc/php/mods-available" ]; then
1111
if [ -d "/etc/php/mods-available/cli" ]; then
12-
ln -s /etc/php/mods-available/cli/* /etc/php/8.1/cli/conf.d
12+
ln -sf /etc/php/mods-available/cli/* /etc/php/8.1/cli/conf.d
1313
fi
1414
if [ -d "/etc/php/mods-available/fpm" ]; then
15-
ln -s /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
15+
ln -sf /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
1616
fi
1717
find /etc/php/mods-available/. -maxdepth 1 -type f -print0 | while read -d $'\0' file
1818
do
19-
ln -s "$file" /etc/php/8.1/cli/conf.d/
20-
ln -s "$file" /etc/php/8.1/fpm/conf.d/
19+
ln -sf "$file" /etc/php/8.1/cli/conf.d/
20+
ln -sf "$file" /etc/php/8.1/fpm/conf.d/
2121
done
2222
fi
2323

docker-compose.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
aliases:
3232
- pterodactyl.test
3333
volumes:
34-
- panel_code:/var/www/html
34+
- ./code/panel:/var/www/html
3535
- ./docker/certificates:/etc/certs:ro
3636
- ./docker/php:/etc/php/mods-available:ro
3737
labels:
@@ -140,27 +140,9 @@ networks:
140140
driver: bridge
141141

142142
volumes:
143-
panel_code:
144143
mysql:
145144
driver: local
146145
minio:
147146
driver: local
148147
go_modules:
149148
driver: local
150-
151-
x-mutagen:
152-
sync:
153-
defaults:
154-
permissions:
155-
defaultOwner: "id:${WWWUSER:-$$(id -u)}"
156-
defaultGroup: "id:33"
157-
defaultFileMode: 0644
158-
defaultDirectoryMode: 0755
159-
code:
160-
alpha: "./code/panel"
161-
beta: "volume://panel_code"
162-
mode: "two-way-resolved"
163-
ignore:
164-
vcs: true
165-
paths:
166-
- ".idea"

0 commit comments

Comments
 (0)