From 5106f87ff1f40c38277d02dfa9613d43c44e3c63 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Nov 2025 03:20:25 -0600 Subject: [PATCH 1/2] Add the -p performance option, which improves cache performance. With the options strict sync = no sync always = no aio read size = 1 aio write size = 1 --- entrypoint.sh | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 06a400e..75365d4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,7 +30,7 @@ local master = no dns proxy = no EOT fi - while getopts ":u:s:h" opt; do + while getopts ":u:s:p:h" opt; do case $opt in h) cat <>"$CONFIG_FILE" + echo "strict sync = no" >> "$CONFIG_FILE" + echo "sync always = no" >> "$CONFIG_FILE" + echo "aio read size = 1" >> "$CONFIG_FILE" + echo "aio write size = 1" >> "$CONFIG_FILE" + echo -n "path '$sharepath' " + echo "path = \"$sharepath\"" >>"$CONFIG_FILE" + echo -n "read" + if [[ "rw" = "$readwrite" ]] ; then + echo -n "+write " + echo "read only = no" >>"$CONFIG_FILE" + echo "writable = yes" >>"$CONFIG_FILE" + else + echo -n "-only " + echo "read only = yes" >>"$CONFIG_FILE" + echo "writable = no" >>"$CONFIG_FILE" + fi + if [[ -z "$users" ]] ; then + echo -n "for guests: " + echo "browseable = yes" >>"$CONFIG_FILE" + echo "guest ok = yes" >>"$CONFIG_FILE" + echo "public = yes" >>"$CONFIG_FILE" + else + echo -n "for users: " + users=$(echo "$users" |tr "," " ") + echo -n "$users " + echo "valid users = $users" >>"$CONFIG_FILE" + echo "write list = $users" >>"$CONFIG_FILE" + fi + echo "DONE" + ;; \?) echo "Invalid option: -$OPTARG" exit 1 From 4d52f4f54181f35ffea66e6a3d2508e031508a44 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Nov 2025 16:09:30 -0600 Subject: [PATCH 2/2] add examples -p to readme --- Readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 6f1dce3..3c51c73 100644 --- a/Readme.md +++ b/Readme.md @@ -47,6 +47,7 @@ Container will be configured as samba sharing server and it just needs: - password (The password may be different from the user's actual password from your host filesystem) -s name:path:rw:user1[,user2[,userN]] +-p name:path:rw:user1[,user2[,userN]] - add share, that is visible as 'name', exposing contents of 'path' directory for read+write (rw) or read-only (ro) access for specified logins user1, user2, .., userN @@ -65,7 +66,7 @@ docker run -d -p 139:139 -p 445:445 \ -u "1002:1002:guest:guest:guest" \ -s "Backup directory:/share/backups:rw:alice,bob" \ -s "Alice (private):/share/data/alice:rw:alice" \ - -s "Bob (private):/share/data/bob:rw:bob" \ + -p "Bob (private):/share/data/bob:rw:bob" \ -s "Documents (readonly):/share/data/documents:ro:guest,alice,bob" ```