From cac81ec0f062116931fc63a0a09e95360e58968a Mon Sep 17 00:00:00 2001 From: nachoparker Date: Fri, 9 Feb 2018 12:22:29 +0100 Subject: [PATCH] samba: create share per NC user --- changelog.md | 10 ++++-- etc/nextcloudpi-config.d/samba.sh | 52 +++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/changelog.md b/changelog.md index 0bf8acb50..881adb1f7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,13 @@ -[v0.46.7](https://github.com/nextcloud/nextcloudpi/commit/5eba8d6) (2018-02-12) update: fix typo in check version +[v0.46.10](https://github.com/nextcloud/nextcloudpi/commit/b2c809c) (2018-02-09) samba: create share per NC user -[v0.46.6](https://github.com/nextcloud/nextcloudpi/commit/9101b0d) (2018-02-08) Update ncp-check-version +[v0.46.9](https://github.com/nextcloud/nextcloudpi/commit/19ccdb4) (2018-02-13) letsencrypt: only call update-rc.d in docker builds + +[v0.46.8 ](https://github.com/nextcloud/nextcloudpi/commit/354c767) (2018-02-12) preactivate useful apps for a selfhosted instance + +[v0.46.7 ](https://github.com/nextcloud/nextcloudpi/commit/5fd3cfa) (2018-02-12) update: fix typo in check version + +[v0.46.6 ](https://github.com/nextcloud/nextcloudpi/commit/9101b0d) (2018-02-08) Update ncp-check-version [v0.46.5 ](https://github.com/nextcloud/nextcloudpi/commit/69242d0) (2018-02-09) nc-backup: stronger permissions for backup file diff --git a/etc/nextcloudpi-config.d/samba.sh b/etc/nextcloudpi-config.d/samba.sh index 09b0f789b..5dae603db 100644 --- a/etc/nextcloudpi-config.d/samba.sh +++ b/etc/nextcloudpi-config.d/samba.sh @@ -14,8 +14,6 @@ # ACTIVE_=no -NCUSER_=admin -USER_=ncp PWD_=ownyourbits DESCRIPTION="SMB/CIFS file server (for Mac/Linux/Windows)" @@ -40,6 +38,11 @@ install() # disable the [homes] share by default sed -i /\[homes\]/s/homes/homes_disabled_ncp/ /etc/samba/smb.conf + + cat >> /etc/samba/smb.conf <> /etc/samba/smb.conf <> /etc/samba/smb.conf </dev/null || adduser --disabled-password --gecos "" "$user" + echo -e "$PWD_\n$PWD_" | smbpasswd -s -a $user + + usermod -aG www-data $user + sudo chmod g+w $DIR + done + update-rc.d smbd defaults update-rc.d smbd enable service smbd start - usermod -aG www-data $USER_ - echo -e "$PWD_\n$PWD_" | smbpasswd -s -a $USER_ - sudo chmod g+w $DIR echo "SMB enabled" }