diff options
author | Andy Walsh <andy.walsh44+github@gmail.com> | 2018-08-17 00:11:10 +0200 |
---|---|---|
committer | Andy Walsh <andy.walsh44+github@gmail.com> | 2018-09-11 09:57:57 +0200 |
commit | 2593bc61a79d1745cc0369d949ec939fee817af9 (patch) | |
tree | e480174d9dbac40784b8c048c50f4f5fbf94d727 /applications/luci-app-samba4/luasrc/model/cbi/samba4.lua | |
parent | 98d4eb1695ae5723cd7bd785d18284e633e26cc8 (diff) |
luci-app-samba4: add macOS compatibility option and Apple Timemachine support
Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
Diffstat (limited to 'applications/luci-app-samba4/luasrc/model/cbi/samba4.lua')
-rw-r--r-- | applications/luci-app-samba4/luasrc/model/cbi/samba4.lua | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/applications/luci-app-samba4/luasrc/model/cbi/samba4.lua b/applications/luci-app-samba4/luasrc/model/cbi/samba4.lua index e5c0a1bed0..2a1399b96b 100644 --- a/applications/luci-app-samba4/luasrc/model/cbi/samba4.lua +++ b/applications/luci-app-samba4/luasrc/model/cbi/samba4.lua @@ -15,9 +15,20 @@ h = s:taboption("general", Flag, "homes", translate("Share home-directories"), translate("Allow system users to reach their home directories via " .. "network shares")) h.rmempty = false -s:taboption("general", Flag, "disable_netbios", translate("Disable Netbios")) -s:taboption("general", Flag, "disable_ad_dc", translate("Disable Active Directory Domain Controller")) -s:taboption("general", Flag, "disable_winbind", translate("Disable Winbind")) + +macos = s:taboption("general", Flag, "macos", translate("Enable macOS compatible shares"), + translate("Enables Apple's AAPL extension globally and adds macOS compatibility options to all shares.")) +macos.rmempty = false + +if nixio.fs.access("/usr/sbin/nmbd") then + s:taboption("general", Flag, "disable_netbios", translate("Disable Netbios")) +end +if nixio.fs.access("/usr/sbin/samba") then + s:taboption("general", Flag, "disable_ad_dc", translate("Disable Active Directory Domain Controller")) +end +if nixio.fs.access("/usr/sbin/winbindd") then + s:taboption("general", Flag, "disable_winbind", translate("Disable Winbind")) +end tmpl = s:taboption("template", Value, "_tmpl", translate("Edit the template that is used for generating the samba configuration."), @@ -49,42 +60,53 @@ if nixio.fs.access("/etc/config/fstab") then pth.titleref = luci.dispatcher.build_url("admin", "system", "fstab") end -s:option(Value, "users", translate("Allowed users")).rmempty = true +br = s:option(Flag, "browseable", translate("Browse-able")) +br.enabled = "yes" +br.disabled = "no" +br.default = "yes" ro = s:option(Flag, "read_only", translate("Read-only")) -ro.rmempty = false ro.enabled = "yes" ro.disabled = "no" +ro.default = "yes" -br = s:option(Flag, "browseable", translate("Browseable")) -br.rmempty = false -br.default = "yes" -br.enabled = "yes" -br.disabled = "no" +s:option(Flag, "force_root", translate("Force Root")) + +au = s:option(Value, "users", translate("Allowed users")) +au.rmempty = true go = s:option(Flag, "guest_ok", translate("Allow guests")) -go.rmempty = false go.enabled = "yes" go.disabled = "no" +go.default = "no" gon = s:option(Flag, "guest_only", translate("Guests only")) -gon.rmempty = false gon.enabled = "yes" gon.disabled = "no" +gon.default = "no" -io = s:option(Flag, "inherit_owner", translate("Inherit owner")) -io.rmempty = false -io.enabled = "yes" -io.disabled = "no" +iown = s:option(Flag, "inherit_owner", translate("Inherit owner")) +iown.enabled = "yes" +iown.disabled = "no" +iown.default = "no" cm = s:option(Value, "create_mask", translate("Create mask")) cm.rmempty = true -cm.size = 4 +cm.maxlength = 4 +cm.placeholder = "0666" dm = s:option(Value, "dir_mask", translate("Directory mask")) dm.rmempty = true -dm.size = 4 +dm.maxlength = 4 +dm.placeholder = "0777" + +vfs = s:option(Value, "vfs_objects", translate("Vfs objects")) +vfs.rmempty = true + +s:option(Flag, "timemachine", translate("Apple Time-machine share")) -s:option(Value, "vfs_objects", translate("Vfs objects")).rmempty = true +tms = s:option(Value, "timemachine_maxsize", translate("Time-machine size in GB")) +tms.rmempty = true +tms.maxlength = 5 return m |