-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from dstufft/wiki
Begin the start of a wiki configuration
- Loading branch information
Showing
16 changed files
with
575 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ SERVERS = [ | |
"speed-web", | ||
"tracker", | ||
"pypa-web", | ||
"wiki", | ||
] | ||
|
||
SUBNET1 = "192.168.50" | ||
|
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,21 @@ | ||
moin: | ||
wikis: | ||
python: | ||
name: Python Wiki | ||
regex: '^https?://[^/]+(:\d+)?/moin.*$' | ||
logo: '</a><a href="http://www.python.org"><img src="/wiki/europython/img/python-logo.gif" alt="Python" ></a><a name="logo">' | ||
theme: europython | ||
psf: | ||
name: Private PSF Wiki | ||
regex: '^https?://[^/]+(:\d+)?/psf.*$' | ||
logo: Private PSF Wiki | ||
acls: | ||
before: "AdminGroup:read,write,delete,revert,admin" | ||
default: "" | ||
after: "MembersGroup:read,write,delete,revert All:" | ||
linkspam: False | ||
jython: | ||
name: Jython Wiki | ||
regex: '^https?://[^/]+(:\d+)?/jython.*$' | ||
logo: '<img src="/wiki/europython/img/jython-new-small.gif" alt="JythonWiki"> ' | ||
interwiki: JythonWiki |
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 |
---|---|---|
|
@@ -54,6 +54,10 @@ tls: | |
roles: | ||
- speed-web | ||
|
||
wiki.psf.io: | ||
roles: | ||
- wiki | ||
|
||
bootstrap.pypa.psf.io: | ||
roles: | ||
- web-pypa |
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
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,176 @@ | ||
#!python2 | ||
# -*- coding: utf-8 -*- | ||
# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a | ||
# western country and you don't know that you use utf-8, you probably want to | ||
# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode | ||
# encoding) you MUST use: coding: utf-8 | ||
# That setting must match the encoding your editor uses when you modify the | ||
# settings below. If it does not, special non-ASCII chars will be wrong. | ||
|
||
""" | ||
MoinMoin - Configuration for a wiki farm | ||
If you run a single wiki only, you can keep the "wikis" list "as is" | ||
(it has a single rule mapping all requests to mywiki.py). | ||
Note that there are more config options than you'll find in | ||
the version of this file that is installed by default; see | ||
the module MoinMoin.config.multiconfig for a full list of names and their | ||
default values. | ||
Also, the URL http://moinmo.in/HelpOnConfiguration has | ||
a list of config options. | ||
""" | ||
|
||
|
||
# Wikis in your farm -------------------------------------------------- | ||
|
||
# If you run multiple wikis, you need this list of pairs (wikiname, url | ||
# regular expression). moin processes that list and tries to match the | ||
# regular expression against the URL of this request - until it matches. | ||
# Then it loads the <wikiname>.py config for handling that request. | ||
|
||
# Important: | ||
# * the left part is the wikiname enclosed in double quotes | ||
# * the left part must be a valid python module name, so better use only | ||
# lower letters "a-z" and "_". Do not use blanks, dots or minus there! | ||
# E.g. use "foo_bar_org", NOT: "foo-bar.org"! | ||
# * the right part is the url re, use r"..." for it | ||
# * in the right part ".*" means "everything". Just "*" does not work like | ||
# for filenames on the shell / commandline, you must use ".*" as it is a RE. | ||
# * in the right part, "^" means "beginning" and "$" means "end" | ||
|
||
wikis = [ | ||
|
||
# wikiname, url regular expression | ||
# --------------------------------------------------------------- | ||
{% for wiki, config in pillar["moin"]["wikis"].items() %} | ||
("{{ wiki }}", r"{{ config.regex }}"), | ||
{% endfor %} | ||
|
||
# for multiple wikis, do something like this: | ||
# ("wiki1", r"^http://wiki1\.example\.org/.*$"), | ||
# ("wiki2", r"^https?://wiki2\.example\.org/.*$"), | ||
] | ||
|
||
|
||
# Common configuration for all wikis ---------------------------------- | ||
|
||
# Everything that should be configured the same way should go here, | ||
# anything else that should be different should go to the single wiki's | ||
# config. | ||
# In that single wiki's config, we will use the class FarmConfig we define | ||
# below as the base config settings and only override what's different. | ||
# | ||
# In exactly the same way, we first include MoinMoin's Config Defaults here - | ||
# this is to get everything to sane defaults, so we need to change only what | ||
# we like to have different: | ||
|
||
from MoinMoin.config import multiconfig, url_prefix_static | ||
|
||
|
||
# Now we subclass this DefaultConfig. This means that we inherit every setting | ||
# from the DefaultConfig, except those we explicitely define different. | ||
|
||
class FarmConfig(multiconfig.DefaultConfig): | ||
|
||
url_prefix = "/wiki" | ||
url_prefix_static = "/static" | ||
|
||
include_doctype = True | ||
|
||
traceback_show = False | ||
|
||
# Disallow edits by users that are not logged in | ||
acl_rights_default = u"Known:read,write,delete,revert All:read" | ||
|
||
page_front_page = u"FrontPage" | ||
|
||
# This isn't modified, so it can be shared amongst all the instances | ||
data_underlay_dir = "/srv/moin/instances/underlay" | ||
|
||
shared_intermap = "/etc/moin/shared_intermap.txt" | ||
|
||
xapian_search = True | ||
xapian_index_dir = "/srv/moin/xapian" | ||
|
||
# Options people are likely to change due to personal taste | ||
show_hosts = True # show hostnames? | ||
nonexist_qm = False # show '?' for nonexistent? | ||
backtick_meta = True # allow `inline typewriter`? | ||
allow_extended_names = True # allow ["..."] markup? | ||
edit_rows = 20 # editor size | ||
edit_cols = 50 | ||
max_macro_size = 50 # max size of RecentChanges in KB (0=unlimited) | ||
bang_meta = True # use ! to escape WikiNames? | ||
show_section_numbers = False # enumerate headlines? | ||
user_checkbox_defaults = { | ||
"edit_on_doubleclick": False, | ||
} | ||
|
||
# Charting needs "gdchart" installed! (None to disable charting) | ||
chart_options = {"width": 600, "height": 300} | ||
|
||
# Disable certain actions that aren't very useful for us. | ||
# by default this is "xmlrpc", "CopyPages", "MyPages" | ||
actions_excluded = multiconfig.DefaultConfig.actions_excluded[:] | ||
|
||
# this disables the user to create a zip file from a page | ||
# and download this file | ||
actions_excluded.append("PackagePages") | ||
|
||
# this disables the user to sync pages to an other wiki, this works onl | ||
# if xmlrpc is enabled | ||
actions_excluded.append("SyncPages") | ||
|
||
# the content should not be rendered as docbook | ||
actions_excluded.append("RenderAsDocbook") | ||
|
||
# noone on this wikis wants to mass (un)subscribe users to a page | ||
actions_excluded.append("SubscribeUser") | ||
|
||
# makes it impossible for users to save a raw copy of the markup easy to a | ||
# file | ||
actions_excluded.append("Save") | ||
|
||
actions_excluded.append("Load") | ||
actions_excluded.append("twikidraw") | ||
actions_excluded.append("anywikidraw") | ||
|
||
# check where that in 1.9 is used | ||
# actions_excluded.append("cache") | ||
|
||
actions_excluded.append("chart") | ||
# can be removed after language packs are installed | ||
# actions_excluded("LanguageSetup") | ||
|
||
actions_excluded.append("pollsistersites") | ||
|
||
# language setup only needs to be done after update/reinstall | ||
actions_excluded.append("language_setup") | ||
|
||
# don't need a server | ||
actions_excluded.append("serveopenid") | ||
|
||
actions_excluded.append("showtags") | ||
actions_excluded.append("sisterpages") | ||
actions_excluded.append("thread_monitor") | ||
|
||
# mail functions. use empty mail_smarthost to disable. | ||
# mail_smarthost = 'mail.python.org' | ||
mail_smarthost = 'localhost' | ||
mail_from = 'Python Wiki <wiki@python.org>' | ||
|
||
language_default = "en" | ||
language_ignore_browser = True | ||
|
||
page_category_regex = ur"(?P<all>Category(?P<key>\S+))" | ||
page_dict_regex = ur"(?P<all>(?P<key>\S+)Dict)" | ||
page_group_regex = ur"(?P<all>(?P<key>\S+)Group)" | ||
page_template_regex = ur"(?P<all>(?P<key>\S+)Template)" | ||
|
||
# caching_formats = [] | ||
|
||
# Link spam protection for public wikis (uncomment to enable). | ||
# Needs a reliable internet connection. | ||
from MoinMoin.security.antispam import SecurityPolicy |
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,11 @@ | ||
CONFIG = { | ||
"mode": "wsgi", | ||
"user": "moin", | ||
"group": "moin", | ||
"args": [ | ||
"--bind", "unix:/var/run/gunicorn/moin.sock", | ||
"--workers", "{{ grains.num_cpus * 4 }}", | ||
"--pythonpath", "/usr/share/moin/server/", | ||
"moin_wsgi", | ||
], | ||
} |
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,36 @@ | ||
upstream app_server { | ||
server unix:/var/run/gunicorn/moin.sock fail_timeout=0; | ||
} | ||
|
||
server { | ||
listen 9000 ssl; | ||
server_name wiki.python.org; | ||
|
||
ssl_certificate /etc/ssl/private/wiki.psf.io.pem; | ||
ssl_certificate_key /etc/ssl/private/wiki.psf.io.pem; | ||
|
||
include fastly_params; | ||
|
||
error_log /var/log/nginx/wiki.error.log; | ||
access_log /var/log/nginx/wiki.access.log main; | ||
|
||
location = / { | ||
return 301 /moin/; | ||
} | ||
|
||
location /static/europython/ { | ||
alias /srv/moin/europython/; | ||
} | ||
|
||
location /static/ { | ||
alias /usr/share/moin/htdocs/; | ||
} | ||
|
||
location / { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
|
||
proxy_pass http://app_server; | ||
} | ||
} |
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,32 @@ | ||
import sys | ||
import urlparse | ||
|
||
from MoinMoin.web.serving import make_application | ||
|
||
sys.path.insert(0, "/etc/moin") | ||
|
||
|
||
class ScriptFixerMiddleware(object): | ||
|
||
def __init__(self, application): | ||
self.application = application | ||
|
||
def __call__(self, environ, start_response): | ||
if not environ.get("SCRIPT_NAME"): | ||
path = environ.get("PATH_INFO", "") | ||
if path.startswith("/"): | ||
path = path[1:] | ||
|
||
parsed = urlparse.urlparse(path) | ||
|
||
script_name = "/".join(parsed.path.split("/")[:1]) | ||
if not script_name.startswith("/"): | ||
script_name = "/" + script_name | ||
|
||
environ["SCRIPT_NAME"] = script_name | ||
environ["PATH_INFO"] = "/".join(parsed.path.split("/")[1:]) | ||
|
||
return self.application(environ, start_response) | ||
|
||
|
||
application = ScriptFixerMiddleware(make_application(shared=False)) |
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,5 @@ | ||
PEP http://www.python.org/dev/peps/pep-$PAGE/ | ||
SF http://bugs.python.org/issue$PAGE | ||
PythonMac http://pythonmac.org/wiki/ | ||
WxPython http://wiki.wxpython.org/index.cgi/ | ||
ISBN http://www.amazon.com/exec/obidos/ASIN/$PAGE/pythonsoftwar-20 |
Oops, something went wrong.