forked from supermy/mytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,162 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM debian:latest | ||
FROM debian:7.8 | ||
|
||
#2015-01-24修订,中文语言 | ||
MAINTAINER supermy <[email protected]> | ||
|
@@ -12,6 +12,7 @@ MAINTAINER supermy <[email protected]> | |
# deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib \n \ | ||
# deb-src http://mirrors.163.com/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
# deb-src http://mirrors.163.com/debian-security/ wheezy/updates main contrib non-free \n \ | ||
# \ | ||
# ' /etc/apt/sources.list | ||
|
||
# 慢 | ||
|
@@ -22,13 +23,10 @@ MAINTAINER supermy <[email protected]> | |
# deb-src http://ftp.sjtu.edu.cn/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
# deb-src http://ftp.sjtu.edu.cn/debian-security/ wheezy/updates main contrib non-free \n \ | ||
|
||
RUN cat /etc/apt/sources.list | ||
#RUN cat /etc/apt/sources.list | ||
|
||
|
||
RUN apt-get -y update | ||
#&& apt-get -y upgrade | ||
|
||
RUN apt-get install -qq -y curl wget sudo | ||
RUN apt-get -y update && apt-get install -qq -y curl wget sudo | ||
|
||
RUN apt-get -y install locales && \ | ||
sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
|
@@ -80,4 +78,4 @@ ENV LANG zh_CN.UTF-8 | |
ENV LANGUAGE zh_CN:zh | ||
|
||
#userage | ||
#docker build -t supermy/docker-debian:7 mydebian | ||
#docker build -t supermy/docker-debian:7 mydebian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
2015-07-03 | ||
lua+template 与 spring-data-rest 完成整合; | ||
http://192.168.59.103/channel-manage?page=0&start=0&size=15 | ||
|
||
todo 翻页函数 | ||
|
||
lua 模板引擎,好用得令人发指 | ||
https://github.com/bungle/lua-resty-template | ||
lua 的url 调用类,好用得令人发指 | ||
https://github.com/pintsized/lua-resty-http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/usr/bin/env bash | ||
docker build -t supermy/docker-mynginx:2.1 mynginx | ||
docker build -t supermy/docker-mytomcat:7 mytomcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
FROM debian:latest | ||
#latest=8.1 wheezy=7.8 | ||
FROM debian:7.8 | ||
#FROM supermy/docker-debian:7 | ||
|
||
|
||
MAINTAINER supermy <[email protected]> | ||
|
||
#RUN sed -i '1,3d' /etc/apt/sources.list | ||
#RUN echo '#hello'>> /etc/apt/sources.list | ||
RUN sed -i '1,3d' /etc/apt/sources.list | ||
RUN echo '#hello'>> /etc/apt/sources.list | ||
|
||
#RUN sed -i '1a \ | ||
# deb http://mirrors.163.com/debian/ wheezy main non-free contrib \n \ | ||
# deb http://mirrors.163.com/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
# deb http://mirrors.163.com/debian-security/ wheezy/updates main contrib non-free \n \ | ||
# deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib \n \ | ||
# deb-src http://mirrors.163.com/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
# deb-src http://mirrors.163.com/debian-security/ wheezy/updates main contrib non-free \n \ | ||
# ' /etc/apt/sources.list | ||
RUN sed -i '1a \ | ||
deb http://mirrors.163.com/debian/ wheezy main non-free contrib \n \ | ||
deb http://mirrors.163.com/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
deb http://mirrors.163.com/debian-security/ wheezy/updates main contrib non-free \n \ | ||
deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib \n \ | ||
deb-src http://mirrors.163.com/debian/ wheezy-proposed-updates main contrib non-free \n \ | ||
deb-src http://mirrors.163.com/debian-security/ wheezy/updates main contrib non-free \n \ | ||
' /etc/apt/sources.list | ||
|
||
# sohu 更新服务器: | ||
#RUN sed -i '1a \ | ||
|
@@ -52,9 +55,11 @@ WORKDIR /tmp | |
RUN wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz | ||
RUN wget http://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz | ||
|
||
#RUN export http_proxy=http://10.77.45.191:8087 | ||
RUN wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz | ||
RUN wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz | ||
#RUN export http_proxy=http://172.16.71.25:8087 | ||
RUN wget -e http_proxy=172.16.71.25:8087 http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz | ||
#RUN wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz | ||
RUN wget -e http_proxy=172.16.71.25:8087 http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz | ||
#RUN wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz | ||
|
||
|
||
# mysql depends bit ,不兼容lua-5.3.0 ,兼容lua-5.2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,95 @@ | ||
local args = ngx.req.get_uri_args() | ||
--local args = ngx.req.get_post_args() | ||
local myargs = '' | ||
|
||
local function isempty(s) | ||
return s == nil or s == '' or s == ngx.null | ||
end | ||
|
||
for key, val in pairs(args) do | ||
-- if type(val) == "table" then | ||
-- ngx.say(key, ": ", table.concat(val, ", ")) | ||
-- else | ||
-- ngx.say(key, ": ", val) | ||
-- end | ||
if isempty(myargs) then | ||
|
||
else | ||
myargs=myargs.."&" | ||
end | ||
myargs=myargs..key.."="..val; | ||
|
||
end | ||
|
||
-- ngx.say(myargs); | ||
|
||
local http = require "resty.http" | ||
|
||
local httpc = http.new() | ||
local res, err = httpc:request_uri("http://192.168.0.121:8080/channel_auth/filter?"..myargs, { | ||
method = "GET", | ||
body = myargs, | ||
headers = { | ||
["Content-Type"] = "application/x-www-form-urlencoded", | ||
} | ||
}) | ||
|
||
if not res then | ||
ngx.say("failed to request: ", err) | ||
return | ||
end | ||
|
||
-- In this simple form, there is no manual connection step, so the body is read | ||
-- all in one go, including any trailers, and the connection closed or keptalive | ||
-- for you. | ||
|
||
ngx.status = res.status | ||
|
||
for k,v in pairs(res.headers) do | ||
-- | ||
end | ||
|
||
--ngx.say(res.body); | ||
|
||
local jsonvalue=cjson.decode(res.body); | ||
-- | ||
--ngx.say("================"); | ||
-- | ||
--for name, value in pairs(jsonvalue._embedded.channel_auth[1]) do | ||
-- ngx.say(name); | ||
-- ngx.say(cjson.encode(value)); | ||
---- for name, value in pairs(value) do | ||
---- ngx.say(name); | ||
---- end | ||
--end | ||
|
||
|
||
|
||
local template = require "resty.template" | ||
|
||
|
||
template.render("channel-list.html", { | ||
channels = jsonvalue._embedded.channel_auth , | ||
page = jsonvalue.page | ||
}) | ||
|
||
--模板嵌套的例子 | ||
--id/name/code/pwd/token/token_expire/iplist/ip_bind_time/ip_time_out/connect_count/limit_bandwidth/status/ | ||
template.render("channel-list.html", { channels = { | ||
{id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
iplist="192.168.59.3", | ||
ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
{id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
iplist="192.168.59.3", | ||
ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
{id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
iplist="192.168.59.3", | ||
ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
{id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
iplist="192.168.59.3", | ||
ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
{id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
iplist="192.168.59.3", | ||
ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1} | ||
}}) | ||
--template.render("channel-list-test.html", { channels = { | ||
-- {id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
-- iplist="192.168.59.3", | ||
-- ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
-- {id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
-- iplist="192.168.59.3", | ||
-- ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
-- {id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
-- iplist="192.168.59.3", | ||
-- ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
-- {id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
-- iplist="192.168.59.3", | ||
-- ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1}, | ||
-- {id=1,name = "Jane", code = "1001" ,pwd="asdfkjs;dlkfjqwer",token_expire="10", | ||
-- iplist="192.168.59.3", | ||
-- ip_bind_time=60,ip_time_out=60,connect_count=300,limit_bandwidth="10M",status=1} | ||
--}}) | ||
|
Oops, something went wrong.