Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:hg [2024/07/16 00:00] – [Test] darron | tools:hg [2024/07/16 23:26] (current) – darron | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Mercurial===== | + | ====Mercurial==== |
- | ====Install==== | + | This example install mercurial as a web service. |
+ | |||
+ | ===Install=== | ||
< | < | ||
Line 8: | Line 10: | ||
- | ====UWSGI==== | + | ===UWSGI=== |
- | ===Test=== | + | ==Test== |
- | ==Application== | + | __Application__ |
- | __foobar.py__ | + | foobar.py |
< | < | ||
def application(env, | def application(env, | ||
Line 21: | Line 23: | ||
</ | </ | ||
- | ==Server== | + | __Server__ |
< | < | ||
uwsgi --plugins http, | uwsgi --plugins http, | ||
</ | </ | ||
- | ==Client== | + | __Client__ |
< | < | ||
$ telnet 127.0.0.1 9090 | $ telnet 127.0.0.1 9090 | ||
Line 40: | Line 42: | ||
</ | </ | ||
- | ====TODO==== | + | ===Run it=== |
+ | |||
+ | ==CGI== | ||
+ | |||
+ | __/ | ||
< | < | ||
- | uwsgi --plugins http, | + | config |
+ | import os | ||
+ | os.environ[" | ||
+ | import cgitb; cgitb.enable() | ||
+ | from mercurial import demandimport; | ||
+ | from mercurial.hgweb import hgweb | ||
+ | application = hgweb(config) | ||
</ | </ | ||
- | ====Resources==== | + | |
+ | ==CONF== | ||
+ | |||
+ | __/ | ||
+ | < | ||
+ | [collections] | ||
+ | / | ||
+ | |||
+ | [web] | ||
+ | staticurl = /static/ | ||
+ | allow_archive = gz | ||
+ | </ | ||
+ | |||
+ | ==RUN== | ||
+ | |||
+ | __http__ | ||
+ | < | ||
+ | #! /bin/bash | ||
+ | |||
+ | #LOG | ||
+ | exec 2>& | ||
+ | ulimit -l unlimited | ||
+ | ulimit -i unlimited | ||
+ | ulimit -q unlimited | ||
+ | ulimit -n 8192 | ||
+ | ulimit -aH | ||
+ | |||
+ | #RUN | ||
+ | export TZ=" | ||
+ | exec /bin/uwsgi --die-on-term --plugins http, | ||
+ | </ | ||
+ | |||
+ | |||
+ | __UWSGI__ | ||
+ | |||
+ | < | ||
+ | #! /bin/bash | ||
+ | |||
+ | #LOG | ||
+ | exec 2>& | ||
+ | ulimit -l unlimited | ||
+ | ulimit -i unlimited | ||
+ | ulimit -q unlimited | ||
+ | ulimit -n 8192 | ||
+ | ulimit -aH | ||
+ | |||
+ | #RUN | ||
+ | export TZ=" | ||
+ | mkdir -p / | ||
+ | chown -R www-data: | ||
+ | exec /bin/uwsgi --die-on-term --plugins python3 --uwsgi-socket / | ||
+ | </ | ||
+ | ===NGINX=== | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | location / { | ||
+ | uwsgi_pass unix:/ | ||
+ | include uwsgi_params; | ||
+ | |||
+ | limit_except GET HEAD { | ||
+ | auth_basic " | ||
+ | auth_basic_user_file / | ||
+ | } | ||
+ | } | ||
+ | |||
+ | location /static/ { | ||
+ | alias / | ||
+ | expires 30d; | ||
+ | } | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ===Resources=== | ||
[[https:// | [[https:// | ||
[[https:// | [[https:// |