This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
mandaye/mandaye/config.py

83 lines
2.3 KiB
Python

# Mandaye configuration
host = "127.0.0.1"
port = 8088
# Needed if ssl is activate
ssl = False
keyfile = ""
certfile = ""
# Template directory
template_directory = "mandaye/templates"
# Database configuration
# Follow the rfc 1738 http://rfc.net/rfc1738.html
db_url = 'sqlite:///test.db'
from filters.vincennes import biblio_html_login_page
from filters.default import MandayeFilter
biblio_mapping = {
'/mandaye/login': {
'method': 'GET',
'response': {
'dispatcher_method': 'login',
'values': {
'form_action': '/sezhame/page/connexion-abonne',
'from_headers': { 'Content-Type': 'application/x-www-form-urlencoded' },
'form_values': { 'user': '',
'password': '',
'op': 'Se connecter',
'form_id': 'dk_opac15_login_form' },
'username_field': 'user',
'password_field': 'password'
}
}
},
'/mandaye/connection': {
'method': 'GET',
'response': {
'dispatcher_method': 'connection',
'values': {
'destination': 'https://test.vincennes.fr/comptecitoyen/auth',
'next_url': 'http://biblio.local:8088/mandaye/login',
'service_name': 'biblio'
}
}
},
'/sezhame/page/connexion-abonne': {
'method': 'GET',
'on_response_filters': [{
'type': 'data',
'filter': biblio_html_login_page
},]
},
}
from dispatchers.default import Dispatcher
from dispatchers.vincennes import VincennesDispatcher
hosts = {
'sfd.local:8088': [
(r'/', Dispatcher('http://www.sfdiabete.org')),
],
'linuxfr.local:8088': [
(r'/', Dispatcher('http://linuxfr.org')),
],
'biblio.local:8088': [
(r'/', VincennesDispatcher('http://biblio.vincennes.fr', biblio_mapping)),
],
'localhost:8088': [
(r'/', Dispatcher('http://localhost')),
],
}
session_opts = {
'session.type': 'file',
'session.cookie_expires': True,
}
from mandaye.local_config import *