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