Merge pull request #138 from redhawk07/feature/zmb-member-multishares

Allow multiple shares for ZMB-MEMBER
This commit is contained in:
Thorsten Spille
2025-10-16 21:34:46 +02:00
committed by GitHub
4 changed files with 32 additions and 19 deletions

View File

@@ -153,10 +153,10 @@ ZMB_ADMIN_PASS='Start!123'
``` ```
Please use 'single quotation marks' to avoid unexpected behaviour. Please use 'single quotation marks' to avoid unexpected behaviour.
`zmb-ad` domain administrator has to meet the password complexity policy, if password is too weak, domain provisioning will fail. `zmb-ad` domain administrator has to meet the password complexity policy, if password is too weak, domain provisioning will fail.
### ZMB_SHARE ### ZMB_SHARES
Defines the name of your Zamba share Defines the names of your Zamba shares
```bash ```bash
ZMB_SHARE="share" ZMB_SHARES="share1,share2"
``` ```
<br> <br>

View File

@@ -114,8 +114,8 @@ ZMB_ADMIN_PASS='Start!123'
# Name of the "domain admins" group (depends on your Active Directory language, valid on zmb-cups, lower case) # Name of the "domain admins" group (depends on your Active Directory language, valid on zmb-cups, lower case)
ZMB_DOMAIN_ADMINS="domain admins" ZMB_DOMAIN_ADMINS="domain admins"
# Defines the name of your Zamba share # Defines the names of your Zamba shares in a comma separated list
ZMB_SHARE="share" ZMB_SHARES="share1,share2"
############### Mailpiler-Section ############### ############### Mailpiler-Section ###############

View File

@@ -75,8 +75,13 @@ cat > /etc/samba/smb.conf <<EOF
shadow: snapprefix = ^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(weekly\)\{0,1\}\(monthly\)\{0,1\}\(backup\)\{0,1\}\(manual\)\{0,1\} shadow: snapprefix = ^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(weekly\)\{0,1\}\(monthly\)\{0,1\}\(backup\)\{0,1\}\(manual\)\{0,1\}
shadow: delimiter = -20 shadow: delimiter = -20
EOF
IFS=',' read -r -a ZMB_SHARES_ARRAY <<< "$ZMB_SHARES"
for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}"
do
cat >> /etc/samba/smb.conf << EOF
[$ZMB_SHARE] [$ZMB_SHARE]
comment = Main Share
path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
read only = No read only = No
create mask = 0660 create mask = 0660
@@ -84,6 +89,7 @@ cat > /etc/samba/smb.conf <<EOF
inherit acls = Yes inherit acls = Yes
EOF EOF
done
systemctl restart smbd systemctl restart smbd
@@ -96,6 +102,8 @@ systemctl restart winbind nmbd
wbinfo -u wbinfo -u
wbinfo -g wbinfo -g
for SHARE in "${ZMB_SHARES_ARRAY[@]}"
do
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
# originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins' # originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins'
@@ -103,5 +111,6 @@ chown "${ZMB_ADMIN_USER@L}":"${ZMB_DOMAIN_ADMINS@L}" /$LXC_SHAREFS_MOUNTPOINT/$Z
setfacl -Rm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE setfacl -Rm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
setfacl -Rdm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE setfacl -Rdm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
done
systemctl restart smbd nmbd winbind wsdd systemctl restart smbd nmbd winbind wsdd

View File

@@ -65,6 +65,9 @@ EOF
net conf import /etc/samba/import.template net conf import /etc/samba/import.template
IFS=',' read -r -a ZMB_SHARES_ARRAY <<< "$ZMB_SHARES"
for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}"
do
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
chmod -R 770 /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE chmod -R 770 /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
chown -R $USER:root /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE chown -R $USER:root /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
@@ -74,5 +77,6 @@ net conf setparm $ZMB_SHARE readonly no
net conf setparm $ZMB_SHARE browseable yes net conf setparm $ZMB_SHARE browseable yes
net conf setparm $ZMB_SHARE createmask 0660 net conf setparm $ZMB_SHARE createmask 0660
net conf setparm $ZMB_SHARE directorymask 0770 net conf setparm $ZMB_SHARE directorymask 0770
done
systemctl restart smbd nmbd wsdd systemctl restart smbd nmbd wsdd