2013-10-01 03:54:12 +00:00
|
|
|
import logging
|
2013-10-01 04:16:03 +00:00
|
|
|
import sys
|
2013-10-01 03:54:12 +00:00
|
|
|
|
2013-09-30 23:10:27 +00:00
|
|
|
from peewee import MySQLDatabase, SqliteDatabase
|
|
|
|
|
2013-10-01 03:54:12 +00:00
|
|
|
|
|
|
|
LOG_FORMAT = '%(asctime)-15s - %(levelname)s - %(pathname)s - ' + \
|
|
|
|
'%(funcName)s - %(message)s'
|
|
|
|
|
|
|
|
|
2013-09-27 23:29:01 +00:00
|
|
|
class FlaskConfig(object):
|
|
|
|
SECRET_KEY = '1cb18882-6d12-440d-a4cc-b7430fb5f884'
|
|
|
|
|
2013-09-28 00:03:07 +00:00
|
|
|
|
2013-09-27 23:29:01 +00:00
|
|
|
class MailConfig(object):
|
|
|
|
MAIL_SERVER = 'email-smtp.us-east-1.amazonaws.com'
|
|
|
|
MAIL_USE_TLS = True
|
|
|
|
MAIL_PORT = 587
|
|
|
|
MAIL_USERNAME = 'AKIAIXV5SDGCPVMU3N4Q'
|
|
|
|
MAIL_PASSWORD = 'AhmX/vWE91uQ2RtcEKTkfNrzZehEjPNXOXeOXgQNfLao'
|
2013-10-01 19:48:53 +00:00
|
|
|
DEFAULT_MAIL_SENDER = 'support@quay.io'
|
2013-09-27 23:29:01 +00:00
|
|
|
MAIL_FAIL_SILENTLY = False
|
|
|
|
TESTING = False
|
|
|
|
|
2013-09-28 00:03:07 +00:00
|
|
|
|
2013-09-30 23:10:27 +00:00
|
|
|
class SQLiteDB(object):
|
|
|
|
DB_NAME = 'test.db'
|
|
|
|
DB_CONNECTION_ARGS = {
|
|
|
|
'threadlocals': True
|
|
|
|
}
|
|
|
|
DB_DRIVER = SqliteDatabase
|
|
|
|
|
|
|
|
|
|
|
|
class RDSMySQL(object):
|
|
|
|
DB_NAME = 'quay'
|
|
|
|
DB_CONNECTION_ARGS = {
|
|
|
|
'host': 'fluxmonkeylogin.cb0vumcygprn.us-east-1.rds.amazonaws.com',
|
|
|
|
'user': 'fluxmonkey',
|
|
|
|
'passwd': '8eifM#uoZ85xqC^',
|
2013-10-01 03:54:12 +00:00
|
|
|
'threadlocals': True,
|
2013-09-30 23:10:27 +00:00
|
|
|
}
|
|
|
|
DB_DRIVER = MySQLDatabase
|
|
|
|
|
|
|
|
|
|
|
|
class S3Storage(object):
|
|
|
|
AWS_ACCESS_KEY = 'AKIAJWZWUIS24TWSMWRA'
|
|
|
|
AWS_SECRET_KEY = 'EllGwP+noVvzmsUGQJO1qOMk3vm10Vg+UE6xmmpw'
|
|
|
|
REGISTRY_S3_BUCKET = 'quay-registry'
|
|
|
|
STORAGE_KIND = 's3'
|
|
|
|
|
|
|
|
|
|
|
|
class LocalStorage(object):
|
|
|
|
STORAGE_KIND = 'local'
|
|
|
|
LOCAL_STORAGE_DIR = '/tmp/registry'
|
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class StripeTestConfig(object):
|
|
|
|
STRIPE_SECRET_KEY = 'sk_test_PEbmJCYrLXPW0VRLSnWUiZ7Y'
|
|
|
|
STRIPE_PUBLISHABLE_KEY = 'pk_test_uEDHANKm9CHCvVa2DLcipGRh'
|
|
|
|
|
|
|
|
|
|
|
|
class StripeLiveConfig(object):
|
|
|
|
STRIPE_SECRET_KEY = 'sk_live_TRuTHYwTvmrLeU3ib7Z9hpqE'
|
|
|
|
STRIPE_PUBLISHABLE_KEY = 'pk_live_P5wLU0vGdHnZGyKnXlFG4oiu'
|
|
|
|
|
|
|
|
|
|
|
|
class DebugConfig(FlaskConfig, MailConfig, LocalStorage, SQLiteDB,
|
|
|
|
StripeTestConfig):
|
2013-09-30 18:39:10 +00:00
|
|
|
REGISTRY_SERVER = 'localhost:5000'
|
2013-10-01 03:54:12 +00:00
|
|
|
LOGGING_CONFIG = {
|
|
|
|
'level': logging.DEBUG,
|
|
|
|
'format': LOG_FORMAT
|
|
|
|
}
|
2013-09-30 23:10:27 +00:00
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class LocalHostedConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
|
|
|
StripeLiveConfig):
|
2013-10-01 21:23:29 +00:00
|
|
|
REGISTRY_SERVER = 'localhost:5000'
|
|
|
|
LOGGING_CONFIG = {
|
|
|
|
'level': logging.DEBUG,
|
|
|
|
'format': LOG_FORMAT
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class ProductionConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
|
|
|
StripeLiveConfig):
|
2013-09-30 23:10:27 +00:00
|
|
|
REGISTRY_SERVER = 'quay.io'
|
2013-10-01 03:54:12 +00:00
|
|
|
LOGGING_CONFIG = {
|
2013-10-01 04:16:03 +00:00
|
|
|
'stream': sys.stderr,
|
2013-10-01 03:54:12 +00:00
|
|
|
'level': logging.DEBUG,
|
|
|
|
'format': LOG_FORMAT,
|
2013-10-02 20:42:12 +00:00
|
|
|
'filename': 'application.log',
|
2013-10-01 03:54:12 +00:00
|
|
|
}
|