mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 14:13:30 +00:00
dockerman: add wan mode option (#3486)
* dockerman: add wan mode option * fix mistake * impove notice
This commit is contained in:
parent
4a25e1c2c0
commit
e3adb6b347
@ -4,7 +4,7 @@ LUCI_TITLE:=Docker Manager interface for LuCI
|
||||
LUCI_DEPENDS:=+luci-lib-docker +docker-ce +e2fsprogs +fdisk
|
||||
PKG_NAME:=luci-app-dockerman
|
||||
PKG_VERSION:=v0.3.0
|
||||
PKG_RELEASE:=beta
|
||||
PKG_RELEASE:=leanmod-3
|
||||
PKG_MAINTAINER:=lisaac <https://github.com/lisaac/luci-app-dockerman>
|
||||
PKG_LICENSE:=AGPL-3.0
|
||||
|
||||
|
@ -83,6 +83,9 @@ s = m:section(NamedSection, "local", "section", translate("Setting"))
|
||||
|
||||
socket_path = s:option(Value, "socket_path", translate("Socket Path"))
|
||||
status_path = s:option(Value, "status_path", translate("Action Status Tempfile Path"), translate("Where you want to save the docker status file"))
|
||||
wan_mode = s:option(Flag, "wan_mode", translate("Enable WAN access Dokcer"), translate("Enable WAN access docker mapped ports (need reload Docker-ce service)"))
|
||||
wan_mode.enabled="true"
|
||||
wan_mode.disabled="false"
|
||||
debug = s:option(Flag, "debug", translate("Enable Debug"), translate("For debug, It shows all docker API actions of luci-app-dockerman in Debug Tempfile Path"))
|
||||
debug.enabled="true"
|
||||
debug.disabled="false"
|
||||
|
@ -245,11 +245,17 @@ msgid "Socket Path"
|
||||
msgstr "Socket路径"
|
||||
|
||||
msgid "Action Status Tempfile Path"
|
||||
msgstr "docker 动作状态的临时文件路径"
|
||||
msgstr "Docker 动作状态的临时文件路径"
|
||||
|
||||
msgid "Where you want to save the docker status file"
|
||||
msgstr "保存docker status文件的位置"
|
||||
|
||||
msgid "Enable WAN access Dokcer"
|
||||
msgstr "允许 WAN 访问 Dokcer"
|
||||
|
||||
msgid "Enable WAN access docker mapped ports (need reload Docker-ce service)"
|
||||
msgstr "允许 WAN 访问 Dokcer 映射后的端口(易受攻击!)。<br /><br />如已更改此选项,需要点击应用并保存后重启docker服务。<br />推荐禁用该选项后,用系统防火墙选择性映射 172.17.0.X:XX 端口到 WAN"
|
||||
|
||||
msgid "Enable Debug"
|
||||
msgstr "启用调试"
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
config section 'local'
|
||||
option socket_path '/var/run/docker.sock'
|
||||
option status_path '/tmp/.docker_action_status'
|
||||
option wan_mode 'false'
|
||||
option debug_path '/tmp/.docker_debug'
|
||||
option debug 'false'
|
||||
|
22
package/lean/luci-app-dockerman/root/etc/init.d/dockerd
Executable file
22
package/lean/luci-app-dockerman/root/etc/init.d/dockerd
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=25
|
||||
|
||||
start_service() {
|
||||
local nofile=$(cat /proc/sys/fs/nr_open)
|
||||
local wanmode=$(uci get dockerman.local.wan_mode)
|
||||
|
||||
if [ $wanmode = "true" ] ;then
|
||||
dockerwan=" "
|
||||
else
|
||||
dockerwan="--iptables=false"
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param stderr 1
|
||||
procd_set_param command /usr/bin/dockerd $dockerwan
|
||||
procd_set_param limits nofile="${nofile} ${nofile}"
|
||||
procd_close_instance
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user