diff options
Diffstat (limited to 'applications/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua')
-rw-r--r-- | applications/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/applications/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua b/applications/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua deleted file mode 100644 index e8a2c0b7eb..0000000000 --- a/applications/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua +++ /dev/null @@ -1,20 +0,0 @@ -require "luci.util" -docker = require "luci.docker" -uci = (require "luci.model.uci").cursor() -dk = docker.new({socket_path = "/var/run/docker.sock"}) - -if dk:_ping().code ~= 200 then return end -containers_list = dk.containers:list({query = {all=true}}).body -allowed_container = uci:get("dockerman", "local", "ac_allowed_container") - -if not allowed_container or next(allowed_container)==nil then return end -allowed_ip = {} -for i, v in ipairs(containers_list) do - for ii, vv in ipairs(allowed_container) do - if v.Id:sub(1,12) == vv and v.NetworkSettings and v.NetworkSettings.Networks and v.NetworkSettings.Networks.bridge and v.NetworkSettings.Networks.bridge.IPAddress then - print(v.NetworkSettings.Networks.bridge.IPAddress) - luci.util.exec("iptables -I DOCKER-MAN -d "..v.NetworkSettings.Networks.bridge.IPAddress.." -o docker0 -j RETURN") - table.remove(allowed_container, ii) - end - end -end |