use new configuration system

This commit is contained in:
Jérôme Schneider 2014-07-23 15:55:19 +02:00
parent ed41a84ad7
commit cdee447640
5 changed files with 43 additions and 52 deletions

36
config.ini Normal file
View File

@ -0,0 +1,36 @@
[database]
; http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html
url: postgresql://mandaye-meyzieu@/mandaye_meyzieu
[dirs]
config_root: /etc/mandaye-meyzieu/sites-enabled
data_dir: /var/lib/mandaye-meyzieu/data
static_root: /usr/share/mandaye-meyzieu/static
static_url: /mandaye/static
[debug]
debug: false
use_long_trace: true
log_debug: false
; you need to install python-raven for this feature
sentry_dsn:
[mandaye]
toolbar: false
a2_auto_connection: false
auto_decompress: true
; if you want to encypt password set to true
; you need to install pycrypto for this feature
encrypt_sp_password: false
; if encrypt_sp_password then you need to choose a secret
; must be a 16, 24, or 32 bytes long
encrypt_secret:
[session]
; file, dbm, memory or memcached
; if memcached you need to install python-memcached and memcached
type: file
url:
cookie_expires: true
timeout: 3600
data_dir: /var/lib/mandaye-meyzieu/sessions

6
dirs
View File

@ -2,3 +2,9 @@ etc/mandaye-meyzieu
etc/mandaye-meyzieu/certs
etc/mandaye-meyzieu/sites-available
etc/mandaye-meyzieu/sites-enabled
var/lib/mandaye-meyzieu
var/lib/mandaye-meyzieu/data
var/lib/mandaye-meyzieu/sessions
var/run/mandaye-meyzieu
var/log/mandaye-meyzieu
usr/share/mandaye-meyzieu

View File

@ -1 +1 @@
debian/local_config.py /etc/mandaye-meyzieu/
debian/config.ini /etc/mandaye-meyzieu/

View File

@ -1,42 +0,0 @@
## SQL Backend config
# http://docs.sqlalchemy.org/en/rel_0_7/core/engines.html
# rfc 1738 https://tools.ietf.org/html/rfc1738
# dialect+driver://username:password@host:port/database
db_url = 'postgresql://mandaye-meyzieu@/mandaye_meyzieu'
## Logging configuration
debug = False
# Configuration directory
config_root = '/etc/mandaye-meyzieu/sites-enabled'
# Static folder
static_root = '/usr/share/mandaye-meyzieu/static'
# Data directory
data_dir = '/var/lib/mandaye-meyzieu/data'
# Raven Sentry configuration
raven_dsn = None
## Email notification configuration
email_notification = False
smtp_host = 'localhost'
smtp_port = 25
email_from = 'admin+mandaye-meyzieu@entrouvert.com'
email_to = ['admin+mandaye-meyzieu@entrouvert.com']
## Session configuration
# http://beaker.readthedocs.org/en/latest/configuration.html#options-for-sessions-and-caching
session_opts = {
'session.type': 'file',
'session.cookie_expires': True,
'session.timeout': 3600,
'session.data_dir': '/var/lib/mandaye-meyzieu/sessions'
}
## Encrypt service provider passwords with a secret
# You should install pycypto to use this feature
encrypt_sp_password = True
# Must be a 16, 24, or 32 bytes long
encrypt_secret = 'CHANGEME'

9
rules
View File

@ -7,13 +7,4 @@ BUILD_DIR=$(CURDIR)/debian/mandaye-meyzieu
override_dh_install:
dh_install
for ver in $(shell pyversions -vr); do \
ln -s /etc/mandaye-meyzieu/local_config.py $(BUILD_DIR)/usr/lib/python$$ver/dist-packages/rp_meyzieu/; \
done
install -d -m 0755 $(BUILD_DIR)/var/lib/mandaye-meyzieu
install -d -m 0755 $(BUILD_DIR)/var/lib/mandaye-meyzieu/data
install -d -m 0750 $(BUILD_DIR)/var/lib/mandaye-meyzieu/sessions
install -d -m 0755 $(BUILD_DIR)/var/run/mandaye-meyzieu
install -d -m 0755 $(BUILD_DIR)/var/log/mandaye-meyzieu
install -d -m 0755 $(BUILD_DIR)/usr/share/mandaye-meyzieu
cp -R rp_meyzieu/static $(BUILD_DIR)/usr/share/mandaye-meyzieu