diff options
-rw-r--r-- | etc/nextcloudpi-config.d/nc-init.sh | 8 | ||||
-rw-r--r-- | nextcloudpi.sh | 3 | ||||
-rwxr-xr-x | update.sh | 13 |
3 files changed, 22 insertions, 2 deletions
diff --git a/etc/nextcloudpi-config.d/nc-init.sh b/etc/nextcloudpi-config.d/nc-init.sh index a9007b96..e641a24a 100644 --- a/etc/nextcloudpi-config.d/nc-init.sh +++ b/etc/nextcloudpi-config.d/nc-init.sh @@ -82,7 +82,13 @@ EOF # Default trusted domain ( only from nextcloudpi-config ) test -f /usr/local/bin/nextcloud-domain.sh && bash /usr/local/bin/nextcloud-domain.sh - # more + # email + sudo -u www-data php occ config:system:set mail_smtpmode --value="php" + sudo -u www-data php occ config:system:set mail_smtpauthtype --value="LOGIN" + sudo -u www-data php occ config:system:set mail_from_address --value="admin" + sudo -u www-data php occ config:system:set mail_domain --value="ownyourbits.com" + + # other sudo -u www-data php occ config:system:set overwriteprotocol --value=https } diff --git a/nextcloudpi.sh b/nextcloudpi.sh index dedaad0a..832f6e10 100644 --- a/nextcloudpi.sh +++ b/nextcloudpi.sh @@ -138,8 +138,9 @@ EOF chmod a+x /usr/local/bin/ncp-update /usr/local/bin/ncp-update - # External requirements for Apps + # Optional packets for Nextcloud and Apps $APTINSTALL -o "Dpkg::Options::=--force-confold" php-smbclient + $APTINSTALL postfix } configure() { :; } @@ -129,6 +129,19 @@ inotifywait --monitor --event create --event delete --format '%f %e' /media/ | \ done EOF chmod +x /usr/local/etc/nc-automount-links-mon + + # install and configure email if not present + type sendmail &>/dev/null || { + echo "Installing and configuring email" + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postfix + OCC=/var/www/nextcloud/occ + sudo -u www-data php $OCC config:system:set mail_smtpmode --value="php" + sudo -u www-data php $OCC config:system:set mail_smtpauthtype --value="LOGIN" + sudo -u www-data php $OCC config:system:set mail_from_address --value="admin" + sudo -u www-data php $OCC config:system:set mail_domain --value="ownyourbits.com" +} + # restart PHP to get updates in the ncp-web # FIXME: php doesn't come up if run from ncp-web #( |