mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
76 lines
No EOL
2.4 KiB
Bash
Executable file
76 lines
No EOL
2.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
touch /var/log/nginx/access.log
|
|
touch /var/log/nginx/error.log
|
|
touch /var/log/cron/owncloud.log
|
|
|
|
echo "# Options in here overwrite the builtin php.ini" > /php.ini
|
|
chmod 0777 /php.ini
|
|
PHP_INI_DIR="$(php --ini | grep 'Scan' | cut -d ' ' -f7)"
|
|
ln -s /php.ini "$PHP_INI_DIR/zz_extra.ini"
|
|
|
|
HAZE_UID=${HAZE_UID:-www-data}
|
|
HAZE_GID=${HAZE_GID:-www-data}
|
|
|
|
nc-auto-config
|
|
shadow-setup
|
|
|
|
echo "Running as $HAZE_UID:$HAZE_GID"
|
|
|
|
mkdir -p /var/www/html/core/skeleton /var/www/html/build/integration/vendor /var/www/html/build/integration/output /var/www/html/build/integration/work /var/www/html/core/skeleton /var/www/.composer/cache /var/www/html/apps/spreed/tests/integration/vendor/composer
|
|
chown -R "$HAZE_UID":"$HAZE_GID" /var/www/html/data /var/www/html/config
|
|
chown "$HAZE_UID":"$HAZE_GID" /var/www/html/core/skeleton /var/www/html/build/integration/vendor /var/www/html/build/integration/composer.lock /var/www/html/build/integration/output /var/www/html/build/integration/work /var/www/html/core/skeleton /var/www/.composer/cache /var/www/html/apps/spreed/tests/integration/vendor/composer
|
|
|
|
echo "{}" > /var/www/html/build/integration/composer.lock
|
|
|
|
echo "Starting server using $SQL database…"
|
|
|
|
# tail --follow --retry /var/log/nginx/*.log /var/log/cron/owncloud.log &
|
|
|
|
chmod +sx /sbin/sudo
|
|
|
|
mkdir -p /var/log/nginx /tmp /var/run/blackfire
|
|
touch /var/log/nginx/access.log
|
|
touch /var/log/nginx/error.log
|
|
|
|
HAZE_UID=${HAZE_UID:-1000}
|
|
HAZE_GID=${HAZE_GID:-1000}
|
|
|
|
if [ "$(getent group "$HAZE_GID")" ]; then
|
|
groupadd haze
|
|
EXTRA_GROUP=" -G haze"
|
|
else
|
|
groupadd -g "$HAZE_GID" haze
|
|
EXTRA_GROUP=""
|
|
fi
|
|
|
|
useradd -u "$HAZE_UID" -g "$HAZE_GID""$EXTRA_GROUP" haze
|
|
chown -R haze:"$HAZE_GID" /home/haze
|
|
|
|
if [ -f "/var/run/docker.sock" ]; then
|
|
groupadd docker -g "$(stat --format "%g" /var/run/docker.sock)"
|
|
usermod -a -G docker haze
|
|
fi
|
|
|
|
if [ -n "${REDIS_TLS:-}" ]
|
|
then
|
|
redis-server --protected-mode no \
|
|
--tls-port 6379 --port 0 \
|
|
--tls-cert-file /redis-certificates/server.crt \
|
|
--tls-key-file /redis-certificates/server.key \
|
|
--tls-ca-cert-file /redis-certificates/ca.crt &
|
|
else
|
|
redis-server --protected-mode no &
|
|
fi
|
|
|
|
if [ -n "${BLACKFIRE_SERVER_ID:-}" ]
|
|
then
|
|
sh -c '
|
|
yes | blackfire agent:config --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN
|
|
BLACKFIRE_LOG_LEVEL=4 BLACKFIRE_LOG_FILE=/var/log/agent.log blackfire agent &
|
|
'&
|
|
fi
|
|
|
|
php-fpm --fpm-config /etc/php-fpm.conf&
|
|
|
|
nginx -c /etc/nginx.conf |