mirror of
https://github.com/pterodactyl/development.git
synced 2025-12-13 03:03:02 -06:00
Fix initial entrypoint when changing the user ID
This commit is contained in:
parent
d394002abe
commit
fe343a5b4e
@ -54,7 +54,7 @@ COPY configs/pterodactyl.conf /etc/nginx/sites-available/pterodactyl.conf
|
|||||||
|
|
||||||
RUN useradd -m pterodactyl \
|
RUN useradd -m pterodactyl \
|
||||||
&& usermod -a -g www-data -G sudo pterodactyl \
|
&& usermod -a -g www-data -G sudo pterodactyl \
|
||||||
&& echo "pterodactyl ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/pterodactyl \
|
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/sudoers \
|
||||||
&& chmod +x /usr/local/bin/setup-pterodactyl \
|
&& chmod +x /usr/local/bin/setup-pterodactyl \
|
||||||
&& chmod +x /usr/local/bin/entrypoint \
|
&& chmod +x /usr/local/bin/entrypoint \
|
||||||
&& rm -rf /etc/nginx/sites-enabled/* \
|
&& rm -rf /etc/nginx/sites-enabled/* \
|
||||||
@ -68,6 +68,5 @@ WORKDIR /var/www/html
|
|||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
USER pterodactyl
|
|
||||||
|
|
||||||
ENTRYPOINT ["entrypoint"]
|
ENTRYPOINT ["entrypoint"]
|
||||||
|
|||||||
@ -1,37 +1,39 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -x
|
set -x
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
if [ ! -z "$WWWUSER" ]; then
|
if [ -n "$WWWUSER" ]; then
|
||||||
sudo usermod -u $WWWUSER pterodactyl
|
usermod -u "$WWWUSER" pterodactyl
|
||||||
fi
|
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
|
||||||
sudo ln -s /etc/php/mods-available/cli/* /etc/php/8.1/cli/conf.d
|
ln -s /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
|
||||||
sudo ln -s /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
|
ln -s /etc/php/mods-available/fpm/* /etc/php/8.1/fpm/conf.d
|
||||||
fi
|
fi
|
||||||
find . -maxdepth 1 -type f -print0 | while read -d $'\0' file
|
find . -maxdepth 1 -type f -print0 | while read -d $'\0' file
|
||||||
do
|
do
|
||||||
sudo ln -s "$file" /etc/php/8.1/cli/conf.d/
|
ln -s "$file" /etc/php/8.1/cli/conf.d/
|
||||||
sudo ln -s "$file" /etc/php/8.1/fpm/conf.d/
|
ln -s "$file" /etc/php/8.1/fpm/conf.d/
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "/etc/certs" ]; then
|
if [ -d "/etc/certs" ]; then
|
||||||
sudo mkdir -p /usr/local/share/ca-certificates/mkcert
|
mkdir -p /usr/local/share/ca-certificates/mkcert
|
||||||
sudo cp /etc/certs/pterodactyl*.pem /usr/local/share/ca-certificates/mkcert/
|
cp /etc/certs/pterodactyl*.pem /usr/local/share/ca-certificates/mkcert/
|
||||||
sudo update-ca-certificates
|
update-ca-certificates
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /var/www/html || exit 1
|
cd /var/www/html || exit 1
|
||||||
sudo chown -R pterodactyl:www-data storage
|
chown -R pterodactyl:www-data storage
|
||||||
sudo chmod -R 777 storage/* bootstrap/cache
|
chmod -R 777 storage/* bootstrap/cache
|
||||||
|
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
sudo su -c "/bin/bash"
|
sudo su -l pterodactyl -c "/bin/bash"
|
||||||
else
|
else
|
||||||
sudo service cron start
|
service cron start
|
||||||
sudo /usr/bin/supervisord -c /etc/supervisord.conf -n
|
/usr/bin/supervisord -c /etc/supervisord.conf -n
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -11,3 +11,6 @@ opcache.enable_cli = 1
|
|||||||
xdebug.mode=debug
|
xdebug.mode=debug
|
||||||
xdebug.client_host=host.docker.internal
|
xdebug.client_host=host.docker.internal
|
||||||
xdebug.client_port=9003
|
xdebug.client_port=9003
|
||||||
|
|
||||||
|
[curl]
|
||||||
|
curl.cainfo = /etc/certs/root_ca.pem
|
||||||
Loading…
x
Reference in New Issue
Block a user