Commit af2f3391 authored by w4t's avatar w4t

wtserver 0.27

parent 7c83f68b
......@@ -61,7 +61,7 @@ InstallNextcloud() {
apt_install php8.2 php8.2-fpm php8.2-cli php8.2-sqlite php8.2-gd php8.2-imap php8.2-curl php-pear curl \
php8.2-dev memcached php-memcached php8.2-xml php8.2-mbstring php8.2-zip php8.2-apcu \
php8.2-fpm php8.2-mysql php8.2-xsl php8.2-gmp php8.2-bcmath php8.2-cgi php-gettext libxml2-dev \
php8.2-json php8.2-intl php8.2-imagick php8.2-common php8.2-opcache php8.2-readline php8.2
php8.2-intl php8.2-imagick php8.2-common php8.2-opcache php8.2-readline php8.2
# Enable APC before Nextcloud tools are run
sed -i '1i apc.enabled=1\napc.enable_cli=1' /etc/php/8.2/mods-available/apcu.ini
......@@ -123,6 +123,63 @@ InstallNextcloud() {
else
InstallNextcloudVer $owncloud_ver $owncloud_hash
fi
# Configure Nextcloud permissions
cat >> ./nextcloud_permissions.sh <<EOF
#!/bin/bash
ocpath='$CLOUD_DIR'
htuser='www-data'
htgroup='www-data'
rootuser='root'
printf "Creating possible missing Directories\n"
mkdir -p \$ocpath/data
mkdir -p \$ocpath/assets
mkdir -p \$ocpath/updater
printf "chmod Files and Directories\n"
find \${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find \${ocpath}/ -type d -print0 | xargs -0 chmod 0770
printf "Setting directory ownership\n"
chown -R \${rootuser}:\${htgroup} \${ocpath}/
chown -R \${htuser}:\${htgroup} \${ocpath}/apps/
chown -R \${htuser}:\${htgroup} \${ocpath}/assets/
chown -R \${htuser}:\${htgroup} \${ocpath}/config/
chown -R \${htuser}:\${htgroup} \${ocpath}/data/
chown -R \${htuser}:\${htgroup} \${ocpath}/themes/
chown -R \${htuser}:\${htgroup} \${ocpath}/updater/
chmod +x \${ocpath}/occ
printf "Setting .htaccess permissions\n"
if [ -f \${ocpath}/.htaccess ]; then
chmod 0644 \${ocpath}/.htaccess
chown \${rootuser}:\${htgroup} \${ocpath}/.htaccess
fi
if [ -f \${ocpath}/data/.htaccess ]; then
chmod 0644 \${ocpath}/data/.htaccess
chown \${rootuser}:\${htgroup} \${ocpath}/data/.htaccess
fi
EOF
chmod +x ./nextcloud_permissions.sh
#./nextcloud_permissions.sh
# Create initial configuration
instanceid=oc$(echo $CFG_HOSTNAME_DOMAIN | sha1sum | fold -w 10 | head -n 1)
echo -n "Creating Nextcloud settings and database..."
CFG_CLOUDDBNAME=nextcloud
CFG_CLOUDDBUSER=nextcloud
CFG_CLOUDDBPWD=$(dd if=/dev/urandom bs=1 count=64 2>/dev/null | sha256sum | fold -w 40 | head -n 1)
dbruser=root
CFG_CLOUDADMINUSER=root
CFG_CLOUDADMINPWD=$(dd if=/dev/urandom bs=1 count=64 2>/dev/null | sha256sum | fold -w 40 | head -n 1)
}
#---------------------------------------------------------------------
......
......@@ -304,7 +304,7 @@ EOF
echo -n -e "$IDENTATION_LVL_1 Installing extra PHP and Modules...\n"
if [[ "$CFG_PHP_VERSION" == *"none"* ]]; then
echo -e "No PHP version selected for installation."
echo -e "$IDENTATION_LVL_2 No PHP version selected for installation."
else
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg >/dev/null 2>&1
echo "deb https://packages.sury.org/php/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/php.list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment