diff --git a/package/lean/luci-app-docker/Makefile b/package/lean/luci-app-docker/Makefile new file mode 100755 index 0000000000..458ad39f35 --- /dev/null +++ b/package/lean/luci-app-docker/Makefile @@ -0,0 +1,18 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Luci for Docker-CE +LUCI_DEPENDS:=+docker-ce +LUCI_PKGARCH:=all +PKG_VERSION:=1 +PKG_RELEASE:=5 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/package/lean/luci-app-docker/luasrc/controller/docker.lua b/package/lean/luci-app-docker/luasrc/controller/docker.lua new file mode 100644 index 0000000000..46ef03ce28 --- /dev/null +++ b/package/lean/luci-app-docker/luasrc/controller/docker.lua @@ -0,0 +1,17 @@ +module("luci.controller.docker", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/docker") then + return + end + + entry({"admin", "services", "docker"}, cbi("docker"), _("Docker CE Container"), 199).dependent = true + entry({"admin","services","docker","status"},call("act_status")).leaf=true +end + +function act_status() + local e={} + e.running=luci.sys.call("pgrep /usr/bin/dockerd >/dev/null")==0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end \ No newline at end of file diff --git a/package/lean/luci-app-docker/luasrc/model/cbi/docker.lua b/package/lean/luci-app-docker/luasrc/model/cbi/docker.lua new file mode 100644 index 0000000000..e998670d8d --- /dev/null +++ b/package/lean/luci-app-docker/luasrc/model/cbi/docker.lua @@ -0,0 +1,46 @@ +local running = (luci.sys.call("pidof portainer >/dev/null") == 0) +local button = "" + +if running then + button = "      

" +end + +m = Map("docker", "Docker CE", translate("Docker is a set of platform-as-a-service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.")) + + +m:section(SimpleSection).template = "docker/docker_status" + +s = m:section(TypedSection, "docker") +s.anonymous = true + +wan_mode = s:option(Flag, "enabled", translate("Enable WAN access Dokcer")) +wan_mode.default = 0 +wan_mode.rmempty = false +wan_mode.description = translate(("!") .. button) + +o = s:option(Button,"certificate",translate("Docker Readme First")) +o.inputtitle = translate("Download DockerReadme.pdf") +o.description = translate("Please download DockerReadme.pdf to read when first-running") +o.inputstyle = "reload" +o.write = function() + Download() +end + +function Download() + local t,e + t=nixio.open("/www/DockerReadme.pdf","r") + luci.http.header('Content-Disposition','attachment; filename="DockerReadme.pdf"') + luci.http.prepare_content("application/octet-stream") + while true do + e=t:read(nixio.const.buffersize) + if(not e)or(#e==0)then + break + else + luci.http.write(e) + end + end + t:close() + luci.http.close() +end + +return m \ No newline at end of file diff --git a/package/lean/luci-app-docker/luasrc/view/docker/docker_status.htm b/package/lean/luci-app-docker/luasrc/view/docker/docker_status.htm new file mode 100644 index 0000000000..4d2c714684 --- /dev/null +++ b/package/lean/luci-app-docker/luasrc/view/docker/docker_status.htm @@ -0,0 +1,22 @@ + + +
+

+ <%:Collecting data...%> +

+
\ No newline at end of file diff --git a/package/lean/luci-app-docker/po/zh-cn/docker.po b/package/lean/luci-app-docker/po/zh-cn/docker.po new file mode 100644 index 0000000000..c0b24e3155 --- /dev/null +++ b/package/lean/luci-app-docker/po/zh-cn/docker.po @@ -0,0 +1,39 @@ +msgid "" +msgstr "" +"Project-Id-Version: Luci ARP Bind\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-23 20:16+0800\n" +"PO-Revision-Date: 2015-06-23 20:17+0800\n" +"Last-Translator: 981213 \n" +"Language-Team: PandoraBox Team\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 1.8.1\n" +"X-Poedit-SourceCharset: UTF-8\n" + +msgid "Docker CE Container" +msgstr "Docker CE 容器" + +msgid "Open Portainer Docker Admin" +msgstr "打开 Portainer Docker 管理页面" + +msgid "Docker is a set of platform-as-a-service (PaaS) products that use OS-level virtualization to deliver software in packages called containers." +msgstr "Docker是一组平台即服务(platform-as-a-service,PaaS)产品,它使用操作系统级容器虚拟化来交付软件包。" + +msgid "Enable WAN access Dokcer" +msgstr "允许 WAN 访问 Dokcer" + +msgid "Enable WAN access docker mapped ports" +msgstr "允许 WAN 访问 Dokcer 映射后的端口(易受攻击,不推荐!)" + +msgid "Docker Readme First" +msgstr "Docker 初始化无脑配置教程" + +msgid "Download DockerReadme.pdf" +msgstr "下载 Docker 初始化无脑配置教程" + +msgid "Please download DockerReadme.pdf to read when first-running" +msgstr "初次在OpenWrt中运行Docker必读(只需执行一次流程)" \ No newline at end of file diff --git a/package/lean/luci-app-docker/root/etc/docker-pppoe b/package/lean/luci-app-docker/root/etc/docker-pppoe new file mode 100755 index 0000000000..a9989aadab --- /dev/null +++ b/package/lean/luci-app-docker/root/etc/docker-pppoe @@ -0,0 +1,13 @@ +#!/bin/sh + +sleep 10 + +docker_ok=$(iptables -t filter -L FORWARD | grep DOCKER) + +while [ -z "$docker_ok" ]; do + echo "DOCKER Chain not ready" && sleep 10 + docker_ok=$(iptables -t filter -L FORWARD | grep DOCKER) +done + +iptables -D FORWARD -i pppoe-wan -o docker0 -j DROP 2>/dev/null +iptables -I FORWARD -i pppoe-wan -o docker0 -j DROP diff --git a/package/lean/luci-app-docker/root/etc/init.d/dockerd b/package/lean/luci-app-docker/root/etc/init.d/dockerd new file mode 100755 index 0000000000..9a3d72f6c5 --- /dev/null +++ b/package/lean/luci-app-docker/root/etc/init.d/dockerd @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=25 + +start_service() { + local nofile=$(cat /proc/sys/fs/nr_open) + + procd_open_instance + procd_set_param stderr 1 + procd_set_param command /usr/bin/dockerd + procd_set_param limits nofile="${nofile} ${nofile}" + procd_close_instance + + /etc/docker-pppoe &>/dev/null & +} diff --git a/package/lean/luci-app-docker/root/etc/uci-defaults/docker b/package/lean/luci-app-docker/root/etc/uci-defaults/docker new file mode 100755 index 0000000000..d7bfee271d --- /dev/null +++ b/package/lean/luci-app-docker/root/etc/uci-defaults/docker @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/package/lean/luci-app-docker/root/www/DockerReadme.pdf b/package/lean/luci-app-docker/root/www/DockerReadme.pdf new file mode 100644 index 0000000000..8a9a94b832 Binary files /dev/null and b/package/lean/luci-app-docker/root/www/DockerReadme.pdf differ diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index cf664e4306..4fc9cf49c0 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -21,11 +21,11 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += partx-utils mkf2fs fdisk e2fsprogs wpad kmod-usb-hid \ kmod-ath5k kmod-ath9k kmod-ath9k-htc kmod-ath10k kmod-rt2800-usb kmod-e1000e kmod-igb kmod-igbvf kmod-ixgbe kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-i40e kmod-i40evf kmod-fs-f2fs \ -htop lm-sensors autocore automount autosamba luci-app-zerotier luci-app-ipsec-vpnd luci-app-pptp-server luci-proto-bonding luci-app-zerotier luci-app-unblockmusic \ +htop lm-sensors autocore automount autosamba luci-app-zerotier luci-app-ipsec-vpnd luci-app-pptp-server luci-proto-bonding luci-app-zerotier luci-app-unblockmusic luci-app-docker \ ath10k-firmware-qca988x ath10k-firmware-qca9888 ath10k-firmware-qca9984 brcmfmac-firmware-43602a1-pcie intel-microcode amd64-microcode\ alsa-utils kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-usb-audio \ kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8150 kmod-usb-net-rtl8152 \ -shadowsocks-libev-ss-redir v2ray shadowsocksr-libev-server shadowsocksr-libev-ssr-local dsmboot cfdisk docker-ce +shadowsocks-libev-ss-redir v2ray shadowsocksr-libev-server shadowsocksr-libev-ssr-local dsmboot cfdisk $(eval $(call BuildTarget))