Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias K <6317548+theCalcaholic@users.noreply.github.com>2020-03-03 04:56:52 +0300
committernachoparker <nacho@ownyourbits.com>2020-03-16 07:23:45 +0300
commitc49c3900bedb4d16abe8615c921d4006cd16cd91 (patch)
tree76fad1ca13da03b756def6082fdc3b2c1b39c7ef
parent9304c86a0330d31826c109f4916ee56a5239d96a (diff)
samba: option to apply only to a NC group (#1048)v1.22.1
Signed-off-by: Tobias Knöppler Co-authored-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--bin/ncp/NETWORKING/samba.sh9
-rw-r--r--changelog.md4
-rw-r--r--etc/ncp-config.d/samba.cfg8
3 files changed, 18 insertions, 3 deletions
diff --git a/bin/ncp/NETWORKING/samba.sh b/bin/ncp/NETWORKING/samba.sh
index 0b781a54..c4fff3c3 100644
--- a/bin/ncp/NETWORKING/samba.sh
+++ b/bin/ncp/NETWORKING/samba.sh
@@ -68,6 +68,14 @@ EOF
done < <( ls -d "$DATADIR"/*/files )
for user in ${USERS[@]}; do
+ # Exclude users not matching group filter (if enabled)
+ if [[ -n "$FILTER_BY_GROUP" ]] \
+ && [[ -z "$(ncc user:info "$user" --output=json | jq ".groups[] | select( . == \"${FILTER_BY_GROUP}\" )")" ]]
+ then
+ echo "Omitting user $user (not in group ${FILTER_BY_GROUP})...";
+ continue;
+ fi
+
echo "adding SAMBA share for user $user"
local DIR="$DATADIR/$user/files"
[ -d "$DIR" ] || { echo -e "INFO: directory $DIR does not exist."; return 1; }
@@ -122,4 +130,3 @@ EOF
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
-
diff --git a/changelog.md b/changelog.md
index 056cf7e6..c5121de8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,7 @@
-[v1.22.0](https://github.com/nextcloud/nextcloudpi/commit/bd03e1c) (2020-03-03) Add nc-trusted-proxies (#1094)
+[v1.22.1](https://github.com/nextcloud/nextcloudpi/commit/e68d616) (2020-03-03) samba: option to apply only to a NC group (#1048)
+
+[v1.22.0 ](https://github.com/nextcloud/nextcloudpi/commit/9304c86) (2020-03-03) Add nc-trusted-proxies (#1094)
[v1.21.0](https://github.com/nextcloud/nextcloudpi/commit/4a51c1f) (2020-02-28) upgrade to NC18.0.1
diff --git a/etc/ncp-config.d/samba.cfg b/etc/ncp-config.d/samba.cfg
index 084a2be4..5ec6c05c 100644
--- a/etc/ncp-config.d/samba.cfg
+++ b/etc/ncp-config.d/samba.cfg
@@ -2,7 +2,7 @@
"id": "samba",
"name": "Samba",
"title": "samba",
- "description": "SMB/CIFS file server (for Mac/Linux/Windows)",
+ "description": "SMB/CIFS file server (for Mac/Linux/Windows)\nIf a group filter is given, samba shares will only be set up for users of that group.",
"info": "The username will be the Nextcloud username, and the password will be one we setup here.\nIf we intend to modify the data folder through SAMBA,\nthen we have to synchronize NextCloud to make it aware of the changes.\n\nThis can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'",
"infotitle": "Instructions for external synchronization",
"params": [
@@ -17,6 +17,12 @@
"name": "Password",
"value": "ownyourbits",
"type": "password"
+ },
+ {
+ "id": "FILTER_BY_GROUP",
+ "name": "Filter by NC group",
+ "value": "",
+ "suggest": "optional NC group"
}
]
}