mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
clenaup bootstrap a bit
This commit is contained in:
parent
07c0f477e1
commit
666b58a773
5 changed files with 97 additions and 109 deletions
|
|
@ -4,32 +4,12 @@ touch /var/log/nginx/access.log
|
|||
touch /var/log/nginx/error.log
|
||||
touch /var/log/cron/owncloud.log
|
||||
|
||||
cp /etc/nc/config.php /var/www/html/config/config.php
|
||||
chmod 0755 /var/www/html/config/config.php
|
||||
|
||||
if [ "$SQL" = "mysql" ]
|
||||
then
|
||||
cp /etc/nc/autoconfig_mysql.php /var/www/html/config/autoconfig.php
|
||||
fi
|
||||
|
||||
if [ "$SQL" = "mariadb" ]
|
||||
then
|
||||
cp /etc/nc/autoconfig_mariadb.php /var/www/html/config/autoconfig.php
|
||||
fi
|
||||
|
||||
if [ "$SQL" = "pgsql" ]
|
||||
then
|
||||
cp /etc/nc/autoconfig_pgsql.php /var/www/html/config/autoconfig.php
|
||||
fi
|
||||
|
||||
if [ "$SQL" = "oci" ]
|
||||
then
|
||||
cp /etc/nc/autoconfig_oci.php /var/www/html/config/autoconfig.php
|
||||
fi
|
||||
|
||||
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
|
||||
|
|
@ -40,58 +20,33 @@ 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 &
|
||||
# tail --follow --retry /var/log/nginx/*.log /var/log/cron/owncloud.log &
|
||||
|
||||
if [ -n "${S3:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/s3.php' /var/www/html/config/config.php
|
||||
fi
|
||||
chmod +sx /sbin/sudo
|
||||
|
||||
if [ -n "${S3MB:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/s3mb.php' /var/www/html/config/config.php
|
||||
fi
|
||||
mkdir -p /var/log/nginx /tmp /var/run/blackfire
|
||||
touch /var/log/nginx/access.log
|
||||
touch /var/log/nginx/error.log
|
||||
|
||||
if [ -n "${S3M:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/s3m.php' /var/www/html/config/config.php
|
||||
fi
|
||||
HAZE_UID=${HAZE_UID:-1000}
|
||||
HAZE_GID=${HAZE_GID:-1000}
|
||||
|
||||
if [ -n "${SWIFT:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/swift.php' /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${SWIFTV3:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/swiftv3.php' /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${AZURE:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/azure.php' /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${REDIS_TLS:-}" ]
|
||||
then
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/redis-tls.php' /var/www/html/config/config.php
|
||||
if [ "$(getent group "$HAZE_GID")" ]; then
|
||||
groupadd haze
|
||||
EXTRA_GROUP=" -G haze"
|
||||
else
|
||||
sed -i '/\/\/PLACEHOLDER/ r /etc/nc/redis-default.php' /var/www/html/config/config.php
|
||||
groupadd -g "$HAZE_GID" haze
|
||||
EXTRA_GROUP=""
|
||||
fi
|
||||
|
||||
if [ -n "${BLACKFIRE_SERVER_ID:-}" ]
|
||||
then
|
||||
sh -c '
|
||||
yes | blackfire agent:config --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN
|
||||
mkdir /var/run/blackfire/
|
||||
BLACKFIRE_LOG_LEVEL=4 BLACKFIRE_LOG_FILE=/var/log/agent.log blackfire agent &
|
||||
'&
|
||||
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
|
||||
|
||||
# crontab /etc/oc-cron.conf
|
||||
|
||||
# crond -f & # todo
|
||||
|
||||
if [ -n "${REDIS_TLS:-}" ]
|
||||
then
|
||||
redis-server --protected-mode no \
|
||||
|
|
@ -103,4 +58,14 @@ else
|
|||
redis-server --protected-mode no &
|
||||
fi
|
||||
|
||||
bootstrap-nginx "$@"
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue