Added new Application luci-samba offering SMB/CIFS network share configuration
This commit is contained in:
parent
b723b936c5
commit
c10065b71c
7 changed files with 136 additions and 0 deletions
2
applications/luci-samba/Makefile
Normal file
2
applications/luci-samba/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
include ../../build/config.mk
|
||||||
|
include ../../build/module.mk
|
27
applications/luci-samba/luasrc/controller/samba.lua
Normal file
27
applications/luci-samba/luasrc/controller/samba.lua
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
--[[
|
||||||
|
LuCI - Lua Configuration Interface
|
||||||
|
|
||||||
|
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||||
|
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
]]--
|
||||||
|
module("luci.controller.samba", package.seeall)
|
||||||
|
|
||||||
|
function index()
|
||||||
|
if not luci.fs.isfile("/etc/config/samba") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
require("luci.i18n")
|
||||||
|
luci.i18n.loadc("samba")
|
||||||
|
|
||||||
|
local page = entry({"admin", "services", "samba"}, cbi("samba"), luci.i18n.translate("samba"))
|
||||||
|
page.i18n = "samba"
|
||||||
|
page.dependent = true
|
||||||
|
end
|
18
applications/luci-samba/luasrc/i18n/samba.de.lua
Normal file
18
applications/luci-samba/luasrc/i18n/samba.de.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
samba = "Netzwerkfreigaben"
|
||||||
|
samba_samba_name = "Hostname"
|
||||||
|
samba_samba_description = "Beschreibung"
|
||||||
|
samba_samba_workgroup = "Arbeitsgruppe"
|
||||||
|
samba_samba_homes = "Heimatverzeichnisse freigeben"
|
||||||
|
samba_samba_homes_desc = "Systembenutzer können ihre Heimatverzeichnis über Netzwerkfreigaben erreichen."
|
||||||
|
|
||||||
|
samba_sambashare = "Dateifreigaben"
|
||||||
|
samba_sambashare_path = "Freigabepfad"
|
||||||
|
samba_sambashare_path_desc = "Physischer Pfad"
|
||||||
|
samba_sambashare_users = "Erlaubte Benutzer"
|
||||||
|
samba_sambashare_users_desc = "optional"
|
||||||
|
samba_sambashare_readonly = "Nur Lesen"
|
||||||
|
samba_sambashare_guestok = "Gäste erlauben"
|
||||||
|
samba_sambashare_createmask = "Anlegemaske"
|
||||||
|
samba_sambashare_createmask_desc = "Maske für neue Dateien"
|
||||||
|
samba_sambashare_dirmask = "Verzeichnismaske"
|
||||||
|
samba_sambashare_dirmask_desc = "Maske für neue Verzeichnisse"
|
18
applications/luci-samba/luasrc/i18n/samba.en.lua
Normal file
18
applications/luci-samba/luasrc/i18n/samba.en.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
samba = "Network Shares"
|
||||||
|
samba_samba_name = "Hostname"
|
||||||
|
samba_samba_description = "Description"
|
||||||
|
samba_samba_workgroup = "Workgroup"
|
||||||
|
samba_samba_homes = "Share home-directories"
|
||||||
|
samba_samba_homes_desc = "System users can reach their home directories via network shares."
|
||||||
|
|
||||||
|
samba_sambashare = "Shared Directories"
|
||||||
|
samba_sambashare_path = "Shared Directory"
|
||||||
|
samba_sambashare_path_desc = "Physical Path"
|
||||||
|
samba_sambashare_users = "Allowed Users"
|
||||||
|
samba_sambashare_users_desc = "optional"
|
||||||
|
samba_sambashare_readonly = "Read Only"
|
||||||
|
samba_sambashare_guestok = "Allow Guests"
|
||||||
|
samba_sambashare_createmask = "Create Mask"
|
||||||
|
samba_sambashare_createmask_desc = "Mask for new files"
|
||||||
|
samba_sambashare_dirmask = "Directory Mask"
|
||||||
|
samba_sambashare_dirmask_desc = "Mask for new directories"
|
54
applications/luci-samba/luasrc/model/cbi/samba.lua
Normal file
54
applications/luci-samba/luasrc/model/cbi/samba.lua
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
--[[
|
||||||
|
LuCI - Lua Configuration Interface
|
||||||
|
|
||||||
|
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||||
|
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
]]--
|
||||||
|
|
||||||
|
m = Map("samba")
|
||||||
|
|
||||||
|
s = m:section(TypedSection, "samba", "Samba")
|
||||||
|
s.anonymous = true
|
||||||
|
|
||||||
|
s:option(Value, "name")
|
||||||
|
s:option(Value, "description")
|
||||||
|
s:option(Value, "workgroup")
|
||||||
|
s:option(Flag, "homes")
|
||||||
|
|
||||||
|
|
||||||
|
s = m:section(TypedSection, "sambashare")
|
||||||
|
s.anonymous = true
|
||||||
|
s.addremove = true
|
||||||
|
s.template = "cbi/tblsection"
|
||||||
|
|
||||||
|
s:option(Value, "name", translate("name"))
|
||||||
|
s:option(Value, "path")
|
||||||
|
|
||||||
|
s:option(Value, "users").rmempty = true
|
||||||
|
|
||||||
|
ro = s:option(Flag, "read_only")
|
||||||
|
ro.enabled = "yes"
|
||||||
|
ro.disabled = "no"
|
||||||
|
|
||||||
|
go = s:option(Flag, "guest_ok")
|
||||||
|
go.enabled = "yes"
|
||||||
|
go.disabled = "no"
|
||||||
|
|
||||||
|
cm = s:option(Value, "create_mask")
|
||||||
|
cm.rmempty = true
|
||||||
|
cm.size = 4
|
||||||
|
|
||||||
|
dm = s:option(Value, "dir_mask")
|
||||||
|
dm.rmempty = true
|
||||||
|
dm.size = 4
|
||||||
|
|
||||||
|
|
||||||
|
return m
|
|
@ -468,6 +468,17 @@ define Package/luci-app-ddns/install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
define Package/luci-app-samba
|
||||||
|
$(call Package/luci/webtemplate)
|
||||||
|
DEPENDS+=+luci-admin-full +samba
|
||||||
|
TITLE:=Network Shares - Samba SMB/CIFS module
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/luci-app-samba/install
|
||||||
|
$(call Package/luci/install/template,$(1),applications/luci-samba)
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
### Server Gateway Interfaces ###
|
### Server Gateway Interfaces ###
|
||||||
|
|
||||||
define Package/luci-sgi-cgi
|
define Package/luci-sgi-cgi
|
||||||
|
@ -637,6 +648,10 @@ endif
|
||||||
ifneq ($(CONFIG_PACKAGE_luci-app-ddns),)
|
ifneq ($(CONFIG_PACKAGE_luci-app-ddns),)
|
||||||
PKG_SELECTED_MODULES+=applications/luci-ddns
|
PKG_SELECTED_MODULES+=applications/luci-ddns
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(CONFIG_PACKAGE_luci-app-samba),)
|
||||||
|
PKG_SELECTED_MODULES+=applications/luci-samba
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
|
ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
|
||||||
PKG_SELECTED_MODULES+=libs/sgi-cgi
|
PKG_SELECTED_MODULES+=libs/sgi-cgi
|
||||||
|
@ -706,6 +721,7 @@ $(eval $(call BuildPackage,luci-app-statistics))
|
||||||
$(eval $(call BuildPackage,luci-app-upnp))
|
$(eval $(call BuildPackage,luci-app-upnp))
|
||||||
$(eval $(call BuildPackage,luci-app-ntpc))
|
$(eval $(call BuildPackage,luci-app-ntpc))
|
||||||
$(eval $(call BuildPackage,luci-app-ddns))
|
$(eval $(call BuildPackage,luci-app-ddns))
|
||||||
|
$(eval $(call BuildPackage,luci-app-samba))
|
||||||
|
|
||||||
$(eval $(call BuildPackage,luci-sgi-cgi))
|
$(eval $(call BuildPackage,luci-sgi-cgi))
|
||||||
$(eval $(call BuildPackage,luci-sgi-luci))
|
$(eval $(call BuildPackage,luci-sgi-luci))
|
||||||
|
|
|
@ -33,6 +33,7 @@ config event uci_oncommit
|
||||||
option luci_splash "/sbin/luci-reload firewall luci_splash"
|
option luci_splash "/sbin/luci-reload firewall luci_splash"
|
||||||
option upnpd "/etc/init.d/miniupnpd enabled && /sbin/luci-reload miniupnpd || /etc/init.d/miniupnpd stop"
|
option upnpd "/etc/init.d/miniupnpd enabled && /sbin/luci-reload miniupnpd || /etc/init.d/miniupnpd stop"
|
||||||
option ntpclient "/sbin/luci-reload ntpclient"
|
option ntpclient "/sbin/luci-reload ntpclient"
|
||||||
|
option samba "/sbin/luci-reload samba"
|
||||||
|
|
||||||
config internal languages
|
config internal languages
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue