193 lines
6.4 KiB
Django/Jinja
193 lines
6.4 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
|
|
{% if not moinmoin.main -%}
|
|
# we import config to disable the account creation at the bottom of this file
|
|
from MoinMoin import config
|
|
{% endif -%}
|
|
|
|
# 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'{{ moinmoin.site_name }}'
|
|
interwikiname = '{{ moinmoin.interwikiname }}'
|
|
|
|
# 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"{{ moinmoin.front_page }}"
|
|
|
|
data_dir = '{{ moinmoin.data_dir }}'
|
|
|
|
# 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"{{ moinmoin.mail.from }}"
|
|
mail_smarthost='{{ moinmoin.mail.server }}'
|
|
|
|
# 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= [{{ moinmoin.superuser | join(", ")}}]
|
|
|
|
# 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
|
|
|
|
page_credits = [
|
|
u'<a href="http://moinmo.in/" title="Ce site utilise le logiciel MoinMoin.">Propulsé par MoinMoin</a>',
|
|
u'<a href="/MentionsLégales" title="Voir les mentions légales.">Mentions légales</a>'
|
|
];
|
|
|
|
|
|
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|Recherche avancée]]",
|
|
u"[[SommaireDeL'Aide|Aide]]",
|
|
]
|
|
|
|
# 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('{{ moinmoin.data_dir }}')
|
|
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=[
|
|
{% for ip_range in moinmoin.new_account_ip %}
|
|
'{{ ip_range }}',
|
|
{% endfor %}
|
|
],
|
|
actions=['newaccount'],
|
|
actions_msg={'newaccount':"La création de comptes n'est autorisée que depuis le réseau du Crans 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 {{ moinmoin.ip_autorised | join(" \\\n or ")}}
|
|
{% else %}
|
|
return False
|
|
{% endif %}
|
|
|
|
{% if not moinmoin.main %}
|
|
# Stop new accounts being created
|
|
actions_excluded = config.multiconfig.DefaultConfig.actions_excluded + [
|
|
'newaccount', 'recoverpass'
|
|
]
|
|
{% endif %}
|
|
|
|
# up the cookie lifetime since we fixed ACL linked to cookies and people
|
|
# are gettings disconnected more often, default is (0,12), which means 12h
|
|
# for logged in users and disabled for anonymous.
|
|
cookie_lifetime = (0, 7*24)
|
|
|