# Directory and files where is stored Copr database files
DATA_DIR = '/tmp'

import time
import os

# We need to set this so copr_url() can be used in unit tests
SERVER_NAME = "localhost.localdomain"

PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', '..', '..'))
LOCAL_TMP_DIR = os.path.join(PROJECT_ROOT, '_tmp', str(int(time.time())) )

SQLALCHEMY_RECORD_QUERIES = True

# print(LOCAL_TMP_DIR)

#DATABASE = './tmp/copr.db' # when executing >1 test instances use different db
#DATABASE = os.path.join(LOCAL_TMP_DIR, 'copr.db')

DIST_GIT_CLONE_URL = "http://copr-dist-git-dev.fedorainfracloud.org/git"

OPENID_STORE = os.path.join(LOCAL_TMP_DIR, 'openid_store')
WHOOSHEE_DIR = os.path.join(LOCAL_TMP_DIR, 'whooshee')

# salt for CSRF codes
#SECRET_KEY = 'put_some_secret_here'

#BACKEND_PASSWORD = 'password_here'

# restrict access to a set of users
#USE_ALLOWED_USERS = False
#ALLOWED_USERS = ['bonnie', 'clyde']

#SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DATABASE
# in-memory
SQLALCHEMY_DATABASE_URI = 'sqlite://'

# Token length, defaults to 30 (max 255)
#API_TOKEN_LENGTH = 30

# Expiration of API token in days
#API_TOKEN_EXPIRATION = 180

# logging options
#SEND_LOGS_TO = ['root@localhost']
#LOGGING_LEVEL = 'info'

#DEBUG = False
SQLALCHEMY_ECHO = False

CSRF_ENABLED = False
# as of Flask-WTF 0.9+
WTF_CSRF_ENABLED = False

# send emails when user's perms change in project?
SEND_EMAILS = False

ENFORCE_PROTOCOL_FOR_BACKEND_URL = "https"
ENFORCE_PROTOCOL_FOR_FRONTEND_URL = "https"

PUBLIC_COPR_HOSTNAME = "localhost"

LOG_FILENAME = "copr_frontend.log"
LOG_DIR = "/tmp/"

# a place for storing srpms until they get uploaded
STORAGE_DIR = os.path.join(LOCAL_TMP_DIR, "srpm_storage")

# %check section start redis-server on this port
REDIS_HOST = "127.0.0.1"
REDIS_PORT = 7777

PAGURE_EVENTS = {
  'io.pagure.prod.pagure.git.receive' : 'https://pagure.io/',
  'io.pagure.prod.pagure.pull-request.new' : 'https://pagure.io/',
  'io.pagure.prod.pagure.pull-request.comment.added' : 'https://pagure.io/',
  'io.pagure.prod.pagure.pull-request.updated' : 'https://pagure.io/',
  'org.fedoraproject.prod.pagure.git.receive': "https://src.fedoraproject.org/",
  'org.fedoraproject.prod.pagure.pull-request.new': "https://src.fedoraproject.org/",
  'org.fedoraproject.prod.pagure.pull-request.comment.added': "https://src.fedoraproject.org/",
  'org.fedoraproject.prod.pagure.pull-request.updated': "https://src.fedoraproject.org/",
}
