File config.sh of Package nextcloud-container-kiwi
#!/bin/bash
#
# Copyright (c) 2021, Ilmi Solutions Oy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Description:
# Config.sh for docker
#
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
if [ -z "$kiwi_iname" ]
then
kiwi_iname="unknown"
fi
echo "Configure image: [$kiwi_iname]..."
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Import repositories' keys
#--------------------------------------
suseImportBuildKey
#======================================
# Disable recommends
#--------------------------------------
sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = true/g' /etc/zypp/zypp.conf
#======================================
# Exclude docs intallation
#--------------------------------------
sed -i 's/.*rpm.install.excludedocs.*/# rpm.install.excludedocs = yes/g' /etc/zypp/zypp.conf
#======================================
# Remove locale files
#--------------------------------------
(cd /usr/share/locale && find . -name '*.mo' -print0 | xargs -0 rm)
#======================================
# Generate fi_FI UTF8 locale
#--------------------------------------
localedef -v -c -i fi_FI -f UTF-8 fi_FI.UTF-8
#======================================
# Correct owner
#--------------------------------------
chown -R nginx.nginx /etc/nginx
chown -R nginx.nginx /var/run
chmod -R og-rwx /etc/nginx
chmod -R u+rw /etc/nginx
mv /etc/nginx/nginx.conf.basicssl /etc/nginx/nginx.conf
# Change to home dir where we have writing permission
sed -i "s#/var/run/nginx.pid#/var/lib/nginx/nginx.pid#g" /etc/nginx/nginx.conf
sed -i "s/#pid/pid/g" /etc/nginx/nginx.conf
chown -R root.root /srv
chown -R nginx.nginx /srv/www
chmod -R o-rwx /srv/www
chmod -R root.root /etc/sudoers.d
mkdir /tmp/php7
if [ -d /etc/php7 ]
then
chown -R nginx.nginx /etc/php7
chmod -R og-rwx /etc/php7
fi
mkdir /tmp/php8
if [ -d /etc/php8 ]
then
chown -R nginx.nginx /etc/php8
chmod -R og-rwx /etc/php8
fi
# Use global compress if needed
sed -i "s#'row_format' => 'compressed'#'row_format' => 'dynamic'#" /srv/www/htdocs/nextcloud/lib/private/DB/ConnectionFactory.php
# Cli needs 512M not 128M
sed -i "s#memory_limit = 128M#memory_limit = 512M#" /etc/php7/cli/php.ini
sed -i "s#memory_limit = 128M#memory_limit = 512M#" /etc/php8/cli/php.ini
exit 0