diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-04-23 21:09:15 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-04-23 23:32:12 +0300 |
commit | 879b8a4ba3c5ebb42e4693285ea5b047cbbdefd2 (patch) | |
tree | 743bcb43e1dd06a6f1acd7fb507ffdc498ef0722 | |
parent | 83fd26438beb1a894cb3986668144a4f63fb3e74 (diff) |
armbian: fix root SSH in build and other fixes
-rw-r--r-- | armbian.sh | 10 | ||||
-rw-r--r-- | etc/ncp-config.d/nc-nextcloud.sh | 13 | ||||
-rw-r--r-- | install.sh | 7 | ||||
-rw-r--r-- | nextcloudplus.sh | 8 |
4 files changed, 19 insertions, 19 deletions
@@ -31,14 +31,12 @@ Main() { # indicate that this will be an Armbian image build touch /.ncp-image - export ARMBIANBUILD # install NCP curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash - # restore postfix package half-configured status - sed -i '/Package: postfix/{n;d}' /var/lib/dpkg/status - sed -i '/Package: postfix/a;Status: install ok half-configured|' /var/lib/dpkg/status + # permit root login in SSH + sed -i 's|^PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config # force change root password at first login (again) chage -d 0 root @@ -56,6 +54,10 @@ Main() { cleanup_script $script done + # restore postfix package half-configured status + sed -i '/^Package: postfix$/{n;d}' /var/lib/dpkg/status + sed -i '/^Package: postfix$/aStatus: install ok half-configured' /var/lib/dpkg/status + # enable randomize passwords systemctl enable nc-provisioning diff --git a/etc/ncp-config.d/nc-nextcloud.sh b/etc/ncp-config.d/nc-nextcloud.sh index 856a3799..d29654c7 100644 --- a/etc/ncp-config.d/nc-nextcloud.sh +++ b/etc/ncp-config.d/nc-nextcloud.sh @@ -49,14 +49,11 @@ install() $APTINSTALL php-smbclient # POSTFIX - [[ "$ARMBIANBUILD" != 1 ]] && { - $APTINSTALL postfix - } || { - # post installation script fails, so mark as no problem for the rest of the build - echo "[NCP] Please, ignore the following postfix installation errors ..." - $APTINSTALL postfix || true - sed -i '/Package: postfix/{n;d}' /var/lib/dpkg/status - sed -i '/Package: postfix/a;Status: install ok installed|' /var/lib/dpkg/status + $APTINSTALL postfix || { + # post installation script fails in Armbian build, so mark as no problem for the rest of the build + echo "[NCP] Please, ignore the previous postfix installation error" + sed -i '/^Package: postfix$/{n;d}' /var/lib/dpkg/status + sed -i '/^Package: postfix$/aStatus: install ok installed' /var/lib/dpkg/status } sed -i 's|^smtpd_banner .*|smtpd_banner = $myhostname ESMTP|' /etc/postfix/main.cf sed -i 's|^disable_vrfy_command .*|disable_vrfy_command = yes|' /etc/postfix/main.cf @@ -9,7 +9,8 @@ # # more details at https://ownyourbits.com -#DBG=x +BRANCH=master +DBG=x set -e$DBG @@ -37,10 +38,10 @@ apt-get install --no-install-recommends -y wget ca-certificates sudo rm -rf "$TMPDIR" && mkdir "$TMPDIR" && cd "$TMPDIR" wget -O- --no-check-certificate --content-disposition \ - https://github.com/nextcloud/nextcloudpi/archive/master/latest.tar.gz \ + https://github.com/nextcloud/nextcloudpi/archive/"$BRANCH"/latest.tar.gz \ | tar -xz \ || exit 1 -cd - && cd "$TMPDIR"/nextcloudpi-master +cd - && cd "$TMPDIR"/nextcloudpi-"$BRANCH" # install NCP echo -e "\nInstalling NextCloudPlus" diff --git a/nextcloudplus.sh b/nextcloudplus.sh index cc469ad8..16775cf6 100644 --- a/nextcloudplus.sh +++ b/nextcloudplus.sh @@ -16,6 +16,7 @@ WEBADMIN=ncp WEBPASSWD=ownyourbits +BRANCH=master CONFDIR=/usr/local/etc/ncp-config.d/ UPLOADTMPDIR=/var/www/nextcloud/data/tmp @@ -186,10 +187,10 @@ EOF # update to latest version from github as part of the build process $APTINSTALL git - wget https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/bin/ncp-update -O /usr/local/bin/ncp-update + wget https://raw.githubusercontent.com/nextcloud/nextcloudpi/$BRANCH/bin/ncp-update -O /usr/local/bin/ncp-update chmod a+x /usr/local/bin/ncp-update - /usr/local/bin/ncp-update + /usr/local/bin/ncp-update $BRANCH # ONLY FOR IMAGE BUILDS if [[ -f /.ncp-image ]]; then @@ -230,8 +231,7 @@ EOF sed -i 's|^#LogLevel .*|LogLevel VERBOSE|' /etc/ssh/sshd_config sed -i 's|^#Compression .*|Compression no|' /etc/ssh/sshd_config sed -i 's|^#AllowAgentForwarding .*|AllowAgentForwarding no|' /etc/ssh/sshd_config - [[ "$ARMBIANBUILD" != "1" ]] && \ - sed -i 's|^#PermitRootLogin .*|PermitRootLogin no|' /etc/ssh/sshd_config + sed -i 's|^#PermitRootLogin .*|PermitRootLogin no|' /etc/ssh/sshd_config } ## kernel hardening |