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 14:36] – [TODO] darron | tools:hg [2024/07/16 23:26] (current) – darron | ||
---|---|---|---|
Line 1: | Line 1: | ||
====Mercurial==== | ====Mercurial==== | ||
+ | |||
+ | This example install mercurial as a web service. | ||
===Install=== | ===Install=== | ||
Line 42: | Line 44: | ||
===Run it=== | ===Run it=== | ||
+ | ==CGI== | ||
+ | |||
+ | __/ | ||
+ | |||
+ | < | ||
+ | config = b"/ | ||
+ | import os | ||
+ | os.environ[" | ||
+ | import cgitb; cgitb.enable() | ||
+ | from mercurial import demandimport; | ||
+ | from mercurial.hgweb import hgweb | ||
+ | application = hgweb(config) | ||
+ | </ | ||
+ | |||
+ | ==CONF== | ||
+ | |||
+ | __/ | ||
+ | < | ||
+ | [collections] | ||
+ | / | ||
+ | |||
+ | [web] | ||
+ | staticurl = /static/ | ||
+ | allow_archive = gz | ||
+ | </ | ||
+ | |||
+ | ==RUN== | ||
+ | |||
+ | __http__ | ||
< | < | ||
#! /bin/bash | #! /bin/bash | ||
Line 55: | Line 86: | ||
#RUN | #RUN | ||
export TZ=" | export TZ=" | ||
- | exec /bin/uwsgi --plugins http, | + | exec / |
+ | </ | ||
+ | |||
+ | |||
+ | __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; | ||
+ | } | ||
+ | ... | ||
</ | </ | ||