ansible/roles/moinmoin/templates/moin/mywiki.py.j2

182 lines
6.2 KiB
Django/Jinja

# -*- coding: utf-8 -*-
{{ ansible_header | comment }}
# 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.
"""
This is a sample config for a wiki that is part of a wiki farm and uses
farmconfig for common stuff. Here we define what has to be different from
the farm's common settings.
"""
# we import the FarmConfig class for common defaults of our wikis:
from farmconfig import FarmConfig
# now we subclass that config (inherit from it) and change what's different:
class Config(FarmConfig):
# basic options (you normally need to change these)
sitename = u'Cr@ns Wiki'
interwikiname = 'CransWiki'
# name of entry page / front page [Unicode], choose one of those:
# a) if most wiki content is in a single language
#page_front_page = u"MyStartingPage"
# b) if wiki content is maintained in many languages
page_front_page = u"PageAccueil"
data_dir = '/var/local/wiki/data'
# From here every parameters was added by the Crans --
data_underlay_dir = '/var/local/wiki/underlay/'
# The URL prefix we use to access the static stuff (img, css, js).
url_prefix_static = '/wiki'
# UTF-8 encoding is the future
charset='utf-8'
# Mailing
mail_from = u"Crans Wiki <wiki@crans.org>"
mail_smarthost='smtp.adm.crans.org'
# This is checked by some rather critical and potentially harmful actions,
# like despam or PackageInstaller action:
# WikiShirenn is a giant avocado https://youtu.be/UJeH8gcjuj0
superuser= [u"PeBecue", u"Wiki20-100", u"WikiB2moo", u"WikiBoudy", u"Benjamin", u"WikiPollion", u"Fardale", u"WikiErdnaxe", u"WikiShirenn"]
# Custom logo
logo_string = u'<img src="/wiki/logo.svg" alt="Crans" height="60">'
# French by default
language_default = 'fr'
# Advertise Wiki search to browser
html_head = '<link rel="search" type="application/opensearchdescription+xml" title="CransWiki - Recherche dans les titres" href="/wiki/additional/crans_opensearch.xml">'
theme_default = 'memodump'
stylesheets = [
('all', '/wiki/additional/css/boxes.css'),
('all', '/wiki/additional/css/EventCalendar.css'),
('all', '/wiki/additional/css/pagesPersos.css'),
('all', '/wiki/additional/css/portal.css'),
]
solenoid_full_screen = False
solenoid_shadow = True
solenoid_userprefs = True
solenoid_theme_credit = False
chart_options = {'width': 600, 'height': 300}
refresh = (0, 'external')
user_checkbox_defaults = {'edit_on_doubleclick': 0}
show_rename_redirect = True
# Catégories
page_category_regex = u'^Catégorie([A-Z][a-zàâéêèëîïôùû]+)+(/[A-Za-zàâéêèëîïôùû]+)*'
page_group_regex = u'^Groupe([A-Z][a-z]+)+'
# Acls
acl_enabled=1
allowed_actions = ['DeletePage', 'RenamePage', 'AttachFile']
acl_rights_default = "GroupeAdmin:read,write,delete,revert,admin"
acl_rights_before = "GroupeNounous:read,write,admin,delete,revert"
acl_rights_after = "Trusted:read,write,revert Crans:read,write,revert Known:read Connexion:read All:"
# Barre de navigation
navi_bar = [
u"[[ModificationsRécentes|Modifications récentes]]",
u"[[RechercherUnePage|Rechercher]]",
u"[[SommaireDeL'Aide|Aide]]",
u"[[MentionsLégales|Mentions Légales]]"
]
# Lock
edit_locking = 'lock 10'
# Surge
surge_action_limits = {
# allow max. <count> <action> requests per
# <dt> secs action: (count, dt)
'all': (30, 30),
'default': (30, 60),
'show': (30, 60),
'recall': (10, 120),
'raw': (20, 40),
'diff': (30, 60),
'fullsearch': (10, 120),
'edit': (30, 300),
'rss_rc': (30, 60),
'AttachFile': (290, 60),
'cache': (600, 30),
}
surge_action_limits = None # disable surge protection
surge_lockout_time = 0 # secs you get locked out when you ignore warnings
show_timings = 0
traceback_log_dir = "/var/log/moin"
# Import auth methods
import sys
sys.path.append('/var/local/wiki/data')
from plugin.auth import categorie_public, ip_range, cas, moin
# Si la methode d'authentification est trusted
# les acl du pseudo groupe Trusted s'appliquent après authentification
# sinon se sont les acl de Known qui s'appliquent
auth_methods_trusted = ['moin', 'IpRange', 'CAS']
auth = [
moin.MoinAuth(),
{% if moinmoin.main %}
cas.CASAuth("https://cas.crans.org",
fallback_url='https://wiki.crans.org/',
ticket_path='/var/local/wiki/tickets/',
assoc_path='/var/local/wiki/assowiki/',
),
ip_range.IpRange(
local_nets=[
'185.230.76.0/22', # ENS
'185.230.79.0/23', # test pour zamok
'10.53.0.0/16',
'10.54.0.0/16',
'2a0c:700:0::/40',
'45.66.108.0/22', # IPv4 Aurore
'2a09:6840::/29' # IPv6 Aurore
],
actions=['newaccount'],
actions_msg={'newaccount':"La cr&eacute;ation de comptes n'est autoris&eacute;e que depuis le r&eacute;seau du Cr@ns ou sur zamok."},
),
categorie_public.PublicCategories(pub_cats=[u'Cat\xe9goriePagePublique']), # Avec trusted à False, les acl de Known s'appliquent
{% endif %}
]
# Force text editor as CKEditor is broken
editor_force = True
def ip_autorised_create_account(self,ip):
{% if moinmoin.main %}
return ip.startswith('185.230.76.') or ip.startswith('185.230.77.') or ip.startswith('185.230.78.') or ip.startswith('185.230.79.') or ip.startswith('10.') or ip.startswith('2a0c:700:0:')
{% else %}
return False
{% endif %}
{% if not moinmoin.main %}
# Stop new accounts being created
actions_excluded = config.multiconfig.DefaultConfig.actions_excluded + [
'newaccount', 'recoverpass'
]
{% endif %}