2011-03-17 20:04:49 +00:00
|
|
|
import os, sys
|
2010-02-16 04:09:07 +00:00
|
|
|
import countershape
|
2011-01-17 03:14:20 +00:00
|
|
|
from countershape import Page, Directory, PythonModule, markup
|
2011-06-27 04:38:00 +00:00
|
|
|
import countershape.template
|
2011-03-17 20:04:49 +00:00
|
|
|
sys.path.insert(0, "..")
|
|
|
|
from libmproxy import filt
|
2011-01-17 03:14:20 +00:00
|
|
|
|
2011-03-19 03:30:45 +00:00
|
|
|
MITMPROXY_SRC = "~/git/public/mitmproxy"
|
|
|
|
|
|
|
|
if ns.options.website:
|
2011-03-19 06:47:19 +00:00
|
|
|
ns.title = countershape.template.Template(None, "<h1>@!this.title!@</h1>")
|
2011-03-19 03:30:45 +00:00
|
|
|
this.layout = countershape.Layout("_websitelayout.html")
|
|
|
|
else:
|
2011-03-19 06:47:19 +00:00
|
|
|
ns.title = countershape.template.Template(None, "<h1>@!this.title!@</h1>")
|
2011-03-19 03:30:45 +00:00
|
|
|
this.layout = countershape.Layout("_layout.html")
|
2011-08-03 07:15:01 +00:00
|
|
|
|
2011-01-17 03:14:20 +00:00
|
|
|
this.markup = markup.Markdown()
|
2010-02-16 04:09:07 +00:00
|
|
|
ns.docMaintainer = "Aldo Cortesi"
|
|
|
|
ns.docMaintainerEmail = "aldo@corte.si"
|
2012-02-19 09:43:05 +00:00
|
|
|
ns.copyright = u"\u00a9 mitmproxy project, 2012"
|
2011-02-19 06:43:44 +00:00
|
|
|
|
|
|
|
ns.index = countershape.widgets.SiblingPageIndex('/index.html', divclass="pageindex")
|
2010-02-16 04:09:07 +00:00
|
|
|
|
2011-03-19 03:30:45 +00:00
|
|
|
def mpath(p):
|
|
|
|
p = os.path.join(MITMPROXY_SRC, p)
|
|
|
|
return os.path.expanduser(p)
|
|
|
|
|
|
|
|
ns.license = file(mpath("LICENSE")).read()
|
|
|
|
ns.index_contents = file(mpath("README.mkd")).read()
|
|
|
|
|
2011-02-17 23:40:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
top = os.path.abspath(os.getcwd())
|
|
|
|
def example(s):
|
2011-03-19 03:30:45 +00:00
|
|
|
d = file(mpath(s)).read()
|
2011-08-05 01:26:39 +00:00
|
|
|
extemp = """<div class="example">%s<div class="example_legend">(%s)</div></div>"""
|
|
|
|
return extemp%(countershape.template.Syntax("py")(d), s)
|
2011-02-17 23:40:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
ns.example = example
|
|
|
|
|
2011-03-17 20:04:49 +00:00
|
|
|
filt_help = []
|
|
|
|
for i in filt.filt_unary:
|
|
|
|
filt_help.append(
|
|
|
|
("~%s"%i.code, i.help)
|
|
|
|
)
|
|
|
|
for i in filt.filt_rex:
|
|
|
|
filt_help.append(
|
|
|
|
("~%s regex"%i.code, i.help)
|
|
|
|
)
|
|
|
|
for i in filt.filt_int:
|
|
|
|
filt_help.append(
|
|
|
|
("~%s int"%i.code, i.help)
|
|
|
|
)
|
|
|
|
filt_help.sort()
|
|
|
|
filt_help.extend(
|
|
|
|
[
|
|
|
|
("!", "unary not"),
|
|
|
|
("&", "and"),
|
|
|
|
("|", "or"),
|
|
|
|
("(...)", "grouping"),
|
|
|
|
]
|
|
|
|
)
|
|
|
|
ns.filt_help = filt_help
|
2012-02-19 09:43:05 +00:00
|
|
|
|
2011-02-17 23:40:45 +00:00
|
|
|
|
2010-02-16 04:09:07 +00:00
|
|
|
|
|
|
|
pages = [
|
2011-03-19 03:30:45 +00:00
|
|
|
Page("index.html", "docs"),
|
2011-02-19 06:43:44 +00:00
|
|
|
Page("intro.html", "Introduction"),
|
2012-04-09 03:15:41 +00:00
|
|
|
Page("install.html", "Installation"),
|
2011-08-03 08:28:52 +00:00
|
|
|
Page("mitmproxy.html", "mitmproxy"),
|
|
|
|
Page("mitmdump.html", "mitmdump"),
|
2011-03-16 02:27:26 +00:00
|
|
|
Page("clientreplay.html", "Client-side replay"),
|
|
|
|
Page("serverreplay.html", "Server-side replay"),
|
2011-03-20 04:31:54 +00:00
|
|
|
Page("sticky.html", "Sticky cookies and auth"),
|
2012-04-03 23:24:58 +00:00
|
|
|
Page("upstreamcerts.html", "Upstream Certs"),
|
|
|
|
Page("replacements.html", "Replacements"),
|
2012-02-19 21:15:58 +00:00
|
|
|
Page("reverseproxy.html", "Reverse proxy mode"),
|
2011-03-17 20:04:49 +00:00
|
|
|
Page("anticache.html", "Anticache"),
|
|
|
|
Page("filters.html", "Filter expressions"),
|
2012-03-22 01:57:57 +00:00
|
|
|
Page("ssl.html", "Setting up SSL interception"),
|
2011-03-19 03:30:45 +00:00
|
|
|
Directory("certinstall"),
|
2012-09-16 23:04:57 +00:00
|
|
|
Directory("scripting"),
|
2011-03-30 22:28:58 +00:00
|
|
|
Directory("tutorials"),
|
2011-02-19 06:43:44 +00:00
|
|
|
Page("faq.html", "FAQ"),
|
|
|
|
Page("admin.html", "Administrivia")
|
2010-02-16 04:09:07 +00:00
|
|
|
]
|