from __future__ import unicode_literals
import os

DB = 'sqlite:///database.sqlite'
DEBUG = True
static = '/static'
LOGIN = '/login'
PUBLIC_PATHS = (r'^/user/login.*', )

curdir = os.path.abspath(os.path.dirname(__file__))

# i18n directory.
staticdir = os.path.join(curdir, 'static')
localedir = os.path.join(curdir, 'i18n')
pluginsdir = os.path.join(curdir, 'plugins')
langs = ('en', 'es')

sitename = "Opengnsys"
siteurl = "http://0.0.0.0:8080/"
noreply_email = u"noreply@opengnsys.es"
admin_email =  u"admin@opengnsys.es"

## Logging

# Path of the log file
log_file = os.path.join('log', 'opengnsys')

# Backup interval
log_interval = 'h'

# Number of backup files
log_backups = 1

## Client
client_daemon_port = 1100

## Server Daemon
server_daemon_ip = "0.0.0.0"
server_daemon_port = 1101
server_daemon_name = "localhost"

# SSL configuration
key_file = os.path.join(curdir, 'ssl', 'localhost.key')
cert_file = os.path.join(curdir, 'ssl', 'localhost.pem')
ca_cert = os.path.join(curdir, 'ssl', 'ca-cert.pem')

# LDAP
LDAP = False
LDAP_SERVER = 'sandia'
LDAP_BASE = 'dc=sugus,dc=eii,dc=us,dc=es'
LDAP_DN = 'uid=%s,' + LDAP_BASE

# NOTE: Do NOT enter any configuration after this line, otherwise that configuration will
# override the configuration in test mode
if os.environ.has_key('OG_SERVER_CONFIG'):
    exec open(os.environ['OG_SERVER_CONFIG']).read()
