From 6e42a5641587f7b3eeed990902a674f2e80fd04b Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 27 Mar 2020 17:22:35 +0800 Subject: [PATCH] luci-app-dockerman: sync with upstream source --- package/ctcgfw/luci-app-dockerman/Makefile | 2 +- package/ctcgfw/luci-app-dockerman/depends.lst | 2 +- .../luasrc/model/cbi/dockerman/newcontainer.lua | 9 --------- .../ctcgfw/luci-app-dockerman/luasrc/model/docker.lua | 6 ------ 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/package/ctcgfw/luci-app-dockerman/Makefile b/package/ctcgfw/luci-app-dockerman/Makefile index 79c96ec705..88d4d90ce7 100644 --- a/package/ctcgfw/luci-app-dockerman/Makefile +++ b/package/ctcgfw/luci-app-dockerman/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-dockerman -PKG_VERSION:=v0.5.4 +PKG_VERSION:=v0.5.5 PKG_RELEASE:=beta PKG_MAINTAINER:=lisaac PKG_LICENSE:=AGPL-3.0 diff --git a/package/ctcgfw/luci-app-dockerman/depends.lst b/package/ctcgfw/luci-app-dockerman/depends.lst index 5cf6cf03f0..8a62f6a74b 100644 --- a/package/ctcgfw/luci-app-dockerman/depends.lst +++ b/package/ctcgfw/luci-app-dockerman/depends.lst @@ -1 +1 @@ -ttyd \ No newline at end of file +ttyd docker-cli \ No newline at end of file diff --git a/package/ctcgfw/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua b/package/ctcgfw/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua index dcb19a2fb4..bda56fd871 100644 --- a/package/ctcgfw/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua +++ b/package/ctcgfw/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua @@ -294,14 +294,12 @@ d_ip:depends("network", "nil") d_ip.default = default_config.ip or nil d = s:option(DynamicList, "link", translate("Links with other containers")) -d.cfgvalue = function (self, section) return default_config.link or nil end d.placeholder = "container_name:alias" d.rmempty = true d:depends("network", "bridge") d.default = default_config.link or nil d = s:option(DynamicList, "dns", translate("Set custom DNS servers")) -d.cfgvalue = function (self, section) return default_config.dns or nil end d.placeholder = "8.8.8.8" d.rmempty = true d.default = default_config.dns or nil @@ -312,19 +310,16 @@ d.rmempty = true d.default = default_config.user or nil d = s:option(DynamicList, "env", translate("Environmental Variable(-e)"), translate("Set environment variables to inside the container")) -d.cfgvalue = function (self, section) return default_config.env or nil end d.placeholder = "TZ=Asia/Shanghai" d.rmempty = true d.default = default_config.env or nil d = s:option(DynamicList, "volume", translate("Bind Mount(-v)"), translate("Bind mount a volume")) -d.cfgvalue = function (self, section) return default_config.volume or nil end d.placeholder = "/media:/media:slave" d.rmempty = true d.default = default_config.volume or nil local d_publish = s:option(DynamicList, "publish", translate("Exposed Ports(-p)"), translate("Publish container's port(s) to the host")) -d_publish.cfgvalue = function (self, section) return default_config.publish or nil end d_publish.placeholder = "2200:22/tcp" d_publish.rmempty = true d_publish.default = default_config.publish or nil @@ -346,28 +341,24 @@ d.default = default_config.hostname or nil d:depends("advance", 1) d = s:option(DynamicList, "device", translate("Device(--device)"), translate("Add host device to the container")) -d.cfgvalue = function (self, section) return default_config.device or nil end d.placeholder = "/dev/sda:/dev/xvdc:rwm" d.rmempty = true d:depends("advance", 1) d.default = default_config.device or nil d = s:option(DynamicList, "tmpfs", translate("Tmpfs(--tmpfs)"), translate("Mount tmpfs directory")) -d.cfgvalue = function (self, section) return default_config.tmpfs or nil end d.placeholder = "/run:rw,noexec,nosuid,size=65536k" d.rmempty = true d:depends("advance", 1) d.default = default_config.tmpfs or nil d = s:option(DynamicList, "sysctl", translate("Sysctl(--sysctl)"), translate("Sysctls (kernel parameters) options")) -d.cfgvalue = function (self, section) return default_config.sysctl or nil end d.placeholder = "net.ipv4.ip_forward=1" d.rmempty = true d:depends("advance", 1) d.default = default_config.sysctl or nil d = s:option(DynamicList, "cap_add", translate("CAP-ADD(--cap-add)"), translate("A list of kernel capabilities to add to the container")) -d.cfgvalue = function (self, section) return default_config.cap_add or nil end d.placeholder = "NET_ADMIN" d.rmempty = true d:depends("advance", 1) diff --git a/package/ctcgfw/luci-app-dockerman/luasrc/model/docker.lua b/package/ctcgfw/luci-app-dockerman/luasrc/model/docker.lua index 4728509418..659334b79c 100644 --- a/package/ctcgfw/luci-app-dockerman/luasrc/model/docker.lua +++ b/package/ctcgfw/luci-app-dockerman/luasrc/model/docker.lua @@ -201,9 +201,6 @@ local upgrade = function(self, request) -- extra networks need to network connect action for k, v in pairs(extra_network) do - -- if v.IPAMConfig and next(v.IPAMConfig) == nil then v.IPAMConfig =nil end - -- if v.DriverOpts and next(v.DriverOpts) == nil then v.DriverOpts =nil end - -- if v.Aliases and next(v.Aliases) == nil then v.Aliases =nil end _docker:append_status("Networks: Connect" .. " " .. container_name .. "...") res = self.networks:connect({id = k, body = {Container = container_name, EndpointConfig = v}}) if res.code > 300 then return res end @@ -218,9 +215,6 @@ local duplicate_config = function (self, request) local container_info = self.containers:inspect({id = request.id}) if container_info.code > 300 and type(container_info.body) == "table" then return nil end local old_image_id = container_info.body.Image - -- local old_config = container_info.body.Config - -- local old_host_config = container_info.body.HostConfig - -- local old_network_setting = container_info.body.NetworkSettings.Networks or {} local image_config = self.images:inspect({id = old_image_id}).body.Config return get_config(container_info.body, image_config) end