Skip to content

Commit

Permalink
fix web update to NC12.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Aug 10, 2017
1 parent d177de9 commit 9d4bcfe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
16 changes: 9 additions & 7 deletions etc/nextcloudpi-config.d/letsencrypt.sh
Expand Up @@ -55,15 +55,17 @@ configure()
sed -i "s|SSLCertificateFile.*|SSLCertificateFile /etc/letsencrypt/live/$DOMAIN_/fullchain.pem|" $VHOSTCFG2 sed -i "s|SSLCertificateFile.*|SSLCertificateFile /etc/letsencrypt/live/$DOMAIN_/fullchain.pem|" $VHOSTCFG2
sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN_/privkey.pem|" $VHOSTCFG2 sed -i "s|SSLCertificateKeyFile.*|SSLCertificateKeyFile /etc/letsencrypt/live/$DOMAIN_/privkey.pem|" $VHOSTCFG2


/etc/letsencrypt/letsencrypt-auto certonly -n --no-self-upgrade --webroot -w $NCDIR --hsts --agree-tos -m $EMAIL_ -d $DOMAIN_ || return 1 /etc/letsencrypt/letsencrypt-auto certonly -n --no-self-upgrade --webroot -w $NCDIR --hsts --agree-tos -m $EMAIL_ -d $DOMAIN_ && {
echo "* 1 * * 1 root /etc/letsencrypt/certbot-auto renew --quiet" > /etc/cron.d/letsencrypt-ncp echo "* 1 * * 1 root /etc/letsencrypt/certbot-auto renew --quiet" > /etc/cron.d/letsencrypt-ncp


cd /var/www/nextcloud cd /var/www/nextcloud
sudo -u www-data php occ config:system:set trusted_domains 4 --value=$DOMAIN_ sudo -u www-data php occ config:system:set trusted_domains 4 --value=$DOMAIN_
sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://$DOMAIN_ sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://$DOMAIN_


# delayed in bg so it does not kill the connection, and we get AJAX response # delayed in bg so it does not kill the connection, and we get AJAX response
( sleep 2 && systemctl restart apache2 ) &>/dev/null & ( sleep 2 && systemctl restart apache2 ) &>/dev/null &
}
rm -rf $NCDIR/.well-known
} }


cleanup() cleanup()
Expand Down
4 changes: 2 additions & 2 deletions etc/nextcloudpi-config.d/nc-nextcloud.sh
Expand Up @@ -115,11 +115,11 @@ EOF
printf "chmod/chown .htaccess\n" printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]; then if [ -f ${ocpath}/.htaccess ]; then
chmod 0644 ${ocpath}/.htaccess chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess chown ${htuser}:${htgroup} ${ocpath}/.htaccess
fi fi
if [ -f ${ocpath}/data/.htaccess ]; then if [ -f ${ocpath}/data/.htaccess ]; then
chmod 0644 ${ocpath}/data/.htaccess chmod 0644 ${ocpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess chown ${htuser}:${htgroup} ${ocpath}/data/.htaccess
fi fi


# create and configure opcache dir # create and configure opcache dir
Expand Down
4 changes: 4 additions & 0 deletions update.sh
Expand Up @@ -59,6 +59,10 @@ activate_script unattended-upgrades.sh
# for old image users, save default password # for old image users, save default password
test -f /root/.my.cnf || echo -e "[client]\npassword=ownyourbits" > /root/.my.cnf test -f /root/.my.cnf || echo -e "[client]\npassword=ownyourbits" > /root/.my.cnf


# fix updates from NC12 to NC12.0.1
chown www-data /var/www/nextcloud/.htaccess
rm -rf /var/www/nextcloud/.well-known

# License # License
# #
# This script is free software; you can redistribute it and/or modify it # This script is free software; you can redistribute it and/or modify it
Expand Down

0 comments on commit 9d4bcfe

Please sign in to comment.