#!/usr/bin/env python
# coding: utf-8

# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2009  David Decotigny
# Copyright (C) 2009  Frédéric Lehobey
# Copyright (C) 2009  David Mentré
# Copyright (C) 2009  Maxime Petazzoni
# Copyright (C) 2009  Thomas Petazzoni
# Copyright (C) 2009  Gaël Utard
# Copyright (C) 2019  Hartmut Holzgraefe

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import logging
import os
import sys

# Optional: if you need to extend the Python search path, for example to
# include your OCitySMap installation, then write something like the following:
# sys.path.append('/path/to/ocitysmap')
# sys.path.append('/path/to/lib/python/site-packages')

DEBUG = True

ADMINS = (
    ('MapOSMatic admin', 'your-name@example.org'),
)

DATABASES = {
    # default MapOSMatic django database    
    'default': {
       'ENGINE': 'django.db.backends.postgresql_psycopg2',
       'NAME': 'maposmatic',
       'USER': 'maposmatic',
       'PASSWORD': 'secret',
       'HOST': 'localhost',
       'PORT': '5432'
     },
    # OSM data imported by osm2pgsql, and helper tables
    'osm': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'gis',
        'USER': 'maposmatic',
        'PASSWORD': 'secret',
        'HOST': 'gis-db',
        'PORT': '5432'
        },
    # WayMarkedTrails data
    'waymarked': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'planet',
        'USER': 'maposmatic',
        'PASSWORD': 'secret',
        'HOST': 'gis-db',
        'PORT': '5432'
        },
}

# Path to ocitysmap's config file to use, or None for the default
# (~/.ocitysmap.conf)
OCITYSMAP_CFG_PATH = None

RENDERING_RESULT_PATH = '/path/to/rendering/results/'
RENDERING_RESULT_URL = '/results/' # Either a relative URL or an absolute URL
RENDERING_RESULT_FORMATS = ['pdf', 'svgz', 'png', 'csv']
RENDERING_RESULT_MAX_SIZE_GB = 10
RENDERING_RESULT_MAX_PURGE_ITERATIONS = 10

# Default output log file when the env variable MAPOSMATIC_LOG_FILE is not set
DEFAULT_MAPOSMATIC_LOG_FILE = '/path/to/maposmatic/logs/maposmatic.log'

# Default log level when the env variable DEFAULT_MAPOSMATIC_LOG_LEVEL
# is not set
DEFAULT_MAPOSMATIC_LOG_LEVEL = logging.INFO
DEFAULT_MAPOSMATIC_LOG_FORMAT = "%(asctime)s - %(name)s@%(process)d - %(levelname)s - %(message)s"

# Base bounding box, this is the default view area 
# if no current location or access history information
# is available
BASE_BOUNDING_BOX = (51.7, 7.5, 52.2, 9.5)

# Maximum length of the bounding box to be rendered. This length is
# checked in both directions (longitude and latitude).
# Note: if you change this you should probably change
# BBOX_MAXIMUM_LENGTH_IN_KM in osm_map.js too.
BBOX_MAXIMUM_LENGTH_IN_METERS = 20000

# Restrict map rendering to this bounding box
# Set to False on full planet setups or if
# you don't care to get back maps with no data
MAX_BOUNDING_BOX = False

# geojson multipolygon for the area *not* 
# covered by the data import
# this area will be grayed out on the slippy map
MAX_BOUNDING_OUTER = False

# Number of items displayed per page in the jobs and maps pages
ITEMS_PER_PAGE = 25

# PID file location for the rendering daemon associated with this
# instance; normally managed by the /etc/init.d scripts such as
# start-stop-daemon(8) in debian systems:
MAPOSMATIC_PID_FILE = '/var/run/maposmaticd.pid'

# Feed URL for the RRS feed on the front page
FRONT_PAGE_FEED = 'http://blog.osm-baustelle.de/index.php/feed/?cat=2'

# Settings for exception emails: the from email address, and the list of
# receipient email addresses. No emails are sent if the SMTP host is not
# defined.
DAEMON_ERRORS_SMTP_HOST = None
DAEMON_ERRORS_SMTP_PORT = 25
DAEMON_ERRORS_SMTP_ENCRYPT = None
DAEMON_ERRORS_SMTP_USER = None
DAEMON_ERRORS_SMTP_PASSWORD = None
DAEMON_ERRORS_EMAIL_FROM = 'daemon@example.org'
DAEMON_ERRORS_EMAIL_REPLY_TO = 'noreply@example.org'
DAEMON_ERRORS_JOB_URL = 'http://example.org/jobs/%d'

# example email settings for using a Google Mail account
# DAEMON_ERRORS_SMTP_HOST = 'smtp.googlemail.com'
# DAEMON_ERRORS_SMTP_PORT = 587
# DAEMON_ERRORS_SMTP_ENCRYPT = 'TLS'
# DAEMON_ERRORS_SMTP_USER = '...@gmail.com'
# DAEMON_ERRORS_SMTP_PASSWORD = "..."
# DAEMON_ERRORS_EMAIL_FROM = '...@gmail.com'
# DAEMON_ERRORS_EMAIL_REPLY_TO = '...@gmail.com'
# DAEMON_ERRORS_JOB_URL = 'http://example.com/jobs/%d'

# highest rendering request ID still using the old filename scheme
# before the switch to sluggify 

LAST_OLD_ID = 0


# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/home/media/media.lawrence.com/'


# put a PayPal "hosted_button_id" here to enable the donation page
# see also: https://developer.paypal.com/docs/integration/web/
# e.g.   PAYPAL_ID = 'YQPBAUM3JW8T2'  # original MapOSMatic doation ID
PAYPAL_ID = ''

# Piwik base URL - enable tracking if set
# exclude http:/https:, this will be added dynamically
# example: PIWIK_BASE_URL = '//stats.maposmatic.org/piwik/'

PIWIK_BASE_URL = ''

# how long to store the submitter IP address in the database
# value in hours, 0 for no storage at all, -1 for unlimited
# storage without purging
SUBMITTER_IP_LIFETIME=-1

# how many hours to store the optonal submitter IP address in
# the database after the related rendering job finished
# set to 0 to keep them forever
SUBMITTER_MAIL_LIFETIME=24

# Weblate base URL - link to translation service
WEBLATE_BASE_URL = 'https://translate.get-map.org/'

# contact information, to be displayed in page footer if set
CONTACT_EMAIL = 'your-name@example.org'
CONTACT_CHAT  = 'irc://irc.freenode.net/#maposmatic'

# custom footer text
EXTRA_FOOTER = ''

# show this in a warning box on top of the page when set
MAINTENANCE_NOTICE = ''

