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):
|
2013-10-18 20:36:11 +00:00
|
|
|
DB_NAME = 'test/data/test.db'
|
2013-09-30 23:10:27 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2013-10-25 05:14:38 +00:00
|
|
|
class AWSCredentials(object):
|
2013-09-30 23:10:27 +00:00
|
|
|
AWS_ACCESS_KEY = 'AKIAJWZWUIS24TWSMWRA'
|
|
|
|
AWS_SECRET_KEY = 'EllGwP+noVvzmsUGQJO1qOMk3vm10Vg+UE6xmmpw'
|
|
|
|
REGISTRY_S3_BUCKET = 'quay-registry'
|
2013-10-25 05:14:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
class S3Storage(AWSCredentials):
|
2013-09-30 23:10:27 +00:00
|
|
|
STORAGE_KIND = 's3'
|
|
|
|
|
|
|
|
|
|
|
|
class LocalStorage(object):
|
|
|
|
STORAGE_KIND = 'local'
|
2013-10-18 20:36:11 +00:00
|
|
|
LOCAL_STORAGE_DIR = 'test/data/registry'
|
2013-09-30 23:10:27 +00:00
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
2013-10-03 20:19:01 +00:00
|
|
|
class MixpanelTestConfig(object):
|
|
|
|
MIXPANEL_KEY = '38014a0f27e7bdc3ff8cc7cc29c869f9'
|
|
|
|
|
|
|
|
|
|
|
|
class MixpanelProdConfig(object):
|
|
|
|
MIXPANEL_KEY = '50ff2b2569faa3a51c8f5724922ffb7e'
|
|
|
|
|
|
|
|
|
2013-10-10 03:00:34 +00:00
|
|
|
class GitHubTestConfig(object):
|
|
|
|
GITHUB_CLIENT_ID = 'cfbc4aca88e5c1b40679'
|
|
|
|
GITHUB_CLIENT_SECRET = '7d1cc21e17e10cd8168410e2cd1e4561cb854ff9'
|
|
|
|
GITHUB_TOKEN_URL = 'https://github.com/login/oauth/access_token'
|
|
|
|
GITHUB_USER_URL = 'https://api.github.com/user'
|
|
|
|
GITHUB_USER_EMAILS = GITHUB_USER_URL + '/emails'
|
|
|
|
|
|
|
|
|
|
|
|
class GitHubProdConfig(GitHubTestConfig):
|
|
|
|
GITHUB_CLIENT_ID = '5a8c08b06c48d89d4d1e'
|
|
|
|
GITHUB_CLIENT_SECRET = 'f89d8bb28ea3bd4e1c68808500d185a816be53b1'
|
|
|
|
|
|
|
|
|
2013-10-24 20:37:03 +00:00
|
|
|
class DigitalOceanConfig():
|
|
|
|
DO_CLIENT_ID = 'LJ44y2wwYj1MD0BRxS6qHA'
|
|
|
|
DO_CLIENT_SECRET = 'b9357a6f6ff45a33bb03f6dbbad135f9'
|
|
|
|
DO_SSH_KEY_ID = '46986'
|
2013-10-25 05:14:38 +00:00
|
|
|
DO_SSH_PRIVATE_KEY_FILENAME = 'certs/digital_ocean'
|
2013-10-24 20:37:03 +00:00
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class DebugConfig(FlaskConfig, MailConfig, LocalStorage, SQLiteDB,
|
2013-10-24 20:37:03 +00:00
|
|
|
StripeTestConfig, MixpanelTestConfig, GitHubTestConfig,
|
2013-10-25 05:14:38 +00:00
|
|
|
DigitalOceanConfig, AWSCredentials):
|
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-10-04 18:44:18 +00:00
|
|
|
SEND_FILE_MAX_AGE_DEFAULT = 0
|
2013-10-10 03:52:28 +00:00
|
|
|
POPULATE_DB_TEST_DATA = True
|
2013-10-25 19:47:34 +00:00
|
|
|
INCLUDE_TEST_ENDPOINTS = True
|
2013-09-30 23:10:27 +00:00
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class LocalHostedConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
2013-10-10 03:00:34 +00:00
|
|
|
StripeLiveConfig, MixpanelTestConfig,
|
2013-10-24 20:37:03 +00:00
|
|
|
GitHubProdConfig, DigitalOceanConfig):
|
2013-10-01 21:23:29 +00:00
|
|
|
REGISTRY_SERVER = 'localhost:5000'
|
|
|
|
LOGGING_CONFIG = {
|
|
|
|
'level': logging.DEBUG,
|
|
|
|
'format': LOG_FORMAT
|
|
|
|
}
|
2013-10-04 18:44:18 +00:00
|
|
|
SEND_FILE_MAX_AGE_DEFAULT = 0
|
2013-10-01 21:23:29 +00:00
|
|
|
|
|
|
|
|
2013-10-02 04:48:03 +00:00
|
|
|
class ProductionConfig(FlaskConfig, MailConfig, S3Storage, RDSMySQL,
|
2013-10-10 03:00:34 +00:00
|
|
|
StripeLiveConfig, MixpanelProdConfig,
|
2013-10-24 20:37:03 +00:00
|
|
|
GitHubProdConfig, DigitalOceanConfig):
|
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
|
|
|
}
|
2013-10-04 18:44:18 +00:00
|
|
|
SEND_FILE_MAX_AGE_DEFAULT = 0
|