示例#1
0
Config.define(
    'FILE_STORAGE_ROOT_PATH', join(tempfile.gettempdir(), 'thumbor', 'storage'),
    'The root path where the File Storage will try to find images', 'File Storage')

# PHOTO UPLOAD OPTIONS
Config.define('UPLOAD_MAX_SIZE', 0, "Max size in Kb for images uploaded to thumbor", 'Upload')
Config.define('UPLOAD_ENABLED', False, 'Indicates whether thumbor should enable File uploads', 'Upload')
Config.define(
    'UPLOAD_PHOTO_STORAGE', 'thumbor.storages.file_storage',
    'The type of storage to store uploaded images with', 'Upload')
Config.define('UPLOAD_DELETE_ALLOWED', False, 'Indicates whether image deletion should be allowed', 'Upload')
Config.define('UPLOAD_PUT_ALLOWED', False, 'Indicates whether image overwrite should be allowed', 'Upload')
Config.define('UPLOAD_DEFAULT_FILENAME', 'image', 'Default filename for image uploaded', 'Upload')

# ALIASES FOR OLD PHOTO UPLOAD OPTIONS
Config.alias('MAX_SIZE', 'UPLOAD_MAX_SIZE')
Config.alias('ENABLE_ORIGINAL_PHOTO_UPLOAD', 'UPLOAD_ENABLED')
Config.alias('ORIGINAL_PHOTO_STORAGE', 'UPLOAD_PHOTO_STORAGE')
Config.alias('ALLOW_ORIGINAL_PHOTO_DELETION', 'UPLOAD_DELETE_ALLOWED')
Config.alias('ALLOW_ORIGINAL_PHOTO_PUTTING', 'UPLOAD_PUT_ALLOWED')

# MONGO STORAGE OPTIONS
Config.define('MONGO_STORAGE_SERVER_HOST', 'localhost', 'MongoDB storage server host', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_PORT', 27017, 'MongoDB storage server port', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_DB', 'thumbor', 'MongoDB storage server database name', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_COLLECTION', 'images', 'MongoDB storage image collection', 'MongoDB Storage')

# REDIS STORAGE OPTIONS
Config.define('REDIS_STORAGE_SERVER_HOST', 'localhost', 'Redis storage server host', 'Redis Storage')
Config.define('REDIS_STORAGE_SERVER_PORT', 6379, 'Redis storage server port', 'Redis Storage')
Config.define('REDIS_STORAGE_SERVER_DB', 0, 'Redis storage database index', 'Redis Storage')
示例#2
0
文件: config.py 项目: krynble/thumbor
# PHOTO UPLOAD OPTIONS
Config.define('UPLOAD_MAX_SIZE', 0,
              "Max size in Kb for images uploaded to thumbor", 'Upload')
Config.define('UPLOAD_ENABLED', False,
              'Indicates whether thumbor should enable File uploads', 'Upload')
Config.define('UPLOAD_PHOTO_STORAGE', 'thumbor.storages.file_storage',
              'The type of storage to store uploaded images with', 'Upload')
Config.define('UPLOAD_DELETE_ALLOWED', False,
              'Indicates whether image deletion should be allowed', 'Upload')
Config.define('UPLOAD_PUT_ALLOWED', False,
              'Indicates whether image overwrite should be allowed', 'Upload')
Config.define('UPLOAD_DEFAULT_FILENAME', 'image',
              'Default filename for image uploaded', 'Upload')

# ALIASES FOR OLD PHOTO UPLOAD OPTIONS
Config.alias('MAX_SIZE', 'UPLOAD_MAX_SIZE')
Config.alias('ENABLE_ORIGINAL_PHOTO_UPLOAD', 'UPLOAD_ENABLED')
Config.alias('ORIGINAL_PHOTO_STORAGE', 'UPLOAD_PHOTO_STORAGE')
Config.alias('ALLOW_ORIGINAL_PHOTO_DELETION', 'UPLOAD_DELETE_ALLOWED')
Config.alias('ALLOW_ORIGINAL_PHOTO_PUTTING', 'UPLOAD_PUT_ALLOWED')

# MONGO STORAGE OPTIONS
Config.define('MONGO_STORAGE_SERVER_HOST', 'localhost',
              'MongoDB storage server host', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_PORT', 27017,
              'MongoDB storage server port', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_DB', 'thumbor',
              'MongoDB storage server database name', 'MongoDB Storage')
Config.define('MONGO_STORAGE_SERVER_COLLECTION', 'images',
              'MongoDB storage image collection', 'MongoDB Storage')
示例#3
0
# PHOTO UPLOAD OPTIONS
Config.define("UPLOAD_MAX_SIZE", 0, "Max size in Kb for images uploaded to thumbor", "Upload")
Config.define("UPLOAD_ENABLED", False, "Indicates whether thumbor should enable File uploads", "Upload")
Config.define(
    "UPLOAD_PHOTO_STORAGE",
    "thumbor.storages.file_storage",
    "The type of storage to store uploaded images with",
    "Upload",
)
Config.define("UPLOAD_DELETE_ALLOWED", False, "Indicates whether image deletion should be allowed", "Upload")
Config.define("UPLOAD_PUT_ALLOWED", False, "Indicates whether image overwrite should be allowed", "Upload")
Config.define("UPLOAD_DEFAULT_FILENAME", "image", "Default filename for image uploaded", "Upload")

# ALIASES FOR OLD PHOTO UPLOAD OPTIONS
Config.alias("MAX_SIZE", "UPLOAD_MAX_SIZE")
Config.alias("ENABLE_ORIGINAL_PHOTO_UPLOAD", "UPLOAD_ENABLED")
Config.alias("ORIGINAL_PHOTO_STORAGE", "UPLOAD_PHOTO_STORAGE")
Config.alias("ALLOW_ORIGINAL_PHOTO_DELETION", "UPLOAD_DELETE_ALLOWED")
Config.alias("ALLOW_ORIGINAL_PHOTO_PUTTING", "UPLOAD_PUT_ALLOWED")

# MONGO STORAGE OPTIONS
Config.define("MONGO_STORAGE_SERVER_HOST", "localhost", "MongoDB storage server host", "MongoDB Storage")
Config.define("MONGO_STORAGE_SERVER_PORT", 27017, "MongoDB storage server port", "MongoDB Storage")
Config.define("MONGO_STORAGE_SERVER_DB", "thumbor", "MongoDB storage server database name", "MongoDB Storage")
Config.define("MONGO_STORAGE_SERVER_COLLECTION", "images", "MongoDB storage image collection", "MongoDB Storage")

# REDIS STORAGE OPTIONS
Config.define("REDIS_STORAGE_SERVER_HOST", "localhost", "Redis storage server host", "Redis Storage")
Config.define("REDIS_STORAGE_SERVER_PORT", 6379, "Redis storage server port", "Redis Storage")
Config.define("REDIS_STORAGE_SERVER_DB", 0, "Redis storage database index", "Redis Storage")
示例#4
0
 def topic(self):
     Config.alias('OTHER_ENGINE', 'ENGINE')
     return Config(OTHER_ENGINE='x')
示例#5
0
 def topic(self):
     Config.alias('LOADER_ALIAS', 'LOADER')
     return Config(LOADER='y')
示例#6
0
 def topic(self):
     Config.alias('LOADER_ALIAS', 'LOADER')
     return Config(LOADER='y')
示例#7
0
 def topic(self):
     Config.alias('STORAGE_ALIAS', 'STORAGE')
     Config.alias('STORAGE_ALIAS_ALIAS', 'STORAGE_ALIAS')
     return Config(STORAGE_ALIAS_ALIAS='z')
示例#8
0
 def topic(self):
     Config.alias('OTHER_ENGINE', 'ENGINE')
     return Config(OTHER_ENGINE='x')
示例#9
0
 def topic(self):
     Config.alias('STORAGE_ALIAS', 'STORAGE')
     Config.alias('STORAGE_ALIAS_ALIAS', 'STORAGE_ALIAS')
     return Config(STORAGE_ALIAS_ALIAS='z')
示例#10
0
)
Config.define(
    "UPLOAD_PUT_ALLOWED",
    False,
    "Indicates whether image overwrite should be allowed",
    "Upload",
)
Config.define(
    "UPLOAD_DEFAULT_FILENAME",
    "image",
    "Default filename for image uploaded",
    "Upload",
)

# ALIASES FOR OLD PHOTO UPLOAD OPTIONS
Config.alias("MAX_SIZE", "UPLOAD_MAX_SIZE")
Config.alias("ENABLE_ORIGINAL_PHOTO_UPLOAD", "UPLOAD_ENABLED")
Config.alias("ORIGINAL_PHOTO_STORAGE", "UPLOAD_PHOTO_STORAGE")
Config.alias("ALLOW_ORIGINAL_PHOTO_DELETION", "UPLOAD_DELETE_ALLOWED")
Config.alias("ALLOW_ORIGINAL_PHOTO_PUTTING", "UPLOAD_PUT_ALLOWED")

# MIXED STORAGE OPTIONS
Config.define(
    "MIXED_STORAGE_FILE_STORAGE",
    "thumbor.storages.no_storage",
    "Mixed Storage file storage. This must be the full name "
    "of a python module (python must be able to import it)",
    "Mixed Storage",
)
Config.define(
    "MIXED_STORAGE_CRYPTO_STORAGE",
示例#11
0
Config.define(
    'DB_HOST', 'localhost',
    'Host of your sentry installation MySQL database. Set this to None if you do not wish to load project keys from the database. In that case, you will have to fill the PROJECT_KEYS variable.',
    'Database')
Config.define('DB_PORT', 3306,
              'Port of your sentry installation MySQL database.', 'Database')
Config.define('DB_NAME', 'sentry',
              'Name of your sentry installation MySQL database.', 'Database')
Config.define('DB_USER', 'root',
              'User of your sentry installation MySQL database.', 'Database')
Config.define('DB_PASS', '',
              'Password of your sentry installation MySQL database.',
              'Database')

# Deprecated names
Config.alias('MYSQL_HOST', 'DB_HOST')
Config.alias('MYSQL_PORT', 'DB_PORT')
Config.alias('MYSQL_DB', 'DB_NAME')
Config.alias('MYSQL_USER', 'DB_USER')
Config.alias('MYSQL_PASS', 'DB_PASS')

Config.define(
    'URL_CACHE_EXPIRATION', 1,
    'The amount of seconds to cache a given URL of error. This is meant to be a way to avoid flooding your sentry farm with repeated errors. Set to 0 if you don\'t want to cache any errors.',
    'Cache')
Config.define(
    'MAX_CACHE_USES', 10,
    'Number of requests to accept in the specified expiration of the cache per url.',
    'Cache')

Config.define(
示例#12
0
Config.define('MAX_DUMP_INTERVAL', 1000, 'Cyclops will try to send the errors it receives to sentry as fast as possible. This is done using a percentile average of 90% of the last sentry requests time. If those requests were serviced in 30ms average, then cyclops will keep sending requests every 30ms. This setting specify a maximum interval in miliseconds to send requests to sentry.', 'Performance')
Config.define('MAX_REQUESTS_TO_AVERAGE', 5000, 'In order to calculate the average requests, Cyclops keeps track of the times of the last requests sent to sentry. This setting specifies the maximum number of requests to average.', 'Performance')
Config.define('IGNORE_PERCENTAGE', {}, 'Use this rate to ignore a percentage of requests if flooded. The keys for this dictionary are the project IDs and the value are the percentage of requests to ignore.', 'Performance')

Config.define('PROJECT_KEYS', None, 'List of (project_id, public_key, secret_key) tuples that describe the projects handled by this Cyclops instance.', 'Projects')
Config.define('RESTRICT_API_ACCESS', True, 'If True, validate project keys before sending request to Sentry', 'Projects')

Config.define('DB_BACKEND', 'mysql', 'Database backend (either "mysql", "postgres" or "sqlite").')
Config.define('DB_HOST', 'localhost', 'Host of your sentry installation MySQL database. Set this to None if you do not wish to load project keys from the database. In that case, you will have to fill the PROJECT_KEYS variable.', 'Database')
Config.define('DB_PORT', 3306, 'Port of your sentry installation MySQL database.', 'Database')
Config.define('DB_NAME', 'sentry', 'Name of your sentry installation MySQL database.', 'Database')
Config.define('DB_USER', 'root', 'User of your sentry installation MySQL database.', 'Database')
Config.define('DB_PASS', '', 'Password of your sentry installation MySQL database.', 'Database')

# Deprecated names
Config.alias('MYSQL_HOST', 'DB_HOST')
Config.alias('MYSQL_PORT', 'DB_PORT')
Config.alias('MYSQL_DB', 'DB_NAME')
Config.alias('MYSQL_USER', 'DB_USER')
Config.alias('MYSQL_PASS', 'DB_PASS')

Config.define('URL_CACHE_EXPIRATION', 1, 'The amount of seconds to cache a given URL of error. This is meant to be a way to avoid flooding your sentry farm with repeated errors. Set to 0 if you don\'t want to cache any errors.', 'Cache')
Config.define('MAX_CACHE_USES', 10, 'Number of requests to accept in the specified expiration of the cache per url.', 'Cache')

Config.define('CACHE_IMPLEMENTATION_CLASS', 'cyclops.cache.RedisCache', 'The cache implementation to use to avoid sending the same error again to sentry.', 'Cache')
Config.define('REDIS_HOST', '127.0.0.1', 'The host where the Redis server is running. If you are not using redis, set this to None.', 'Cache')
Config.define('REDIS_PORT', 7780, 'The port that Redis server is running.', 'Cache')
Config.define('REDIS_DB_COUNT', 0, 'The number of redis db.', 'Cache')
Config.define('REDIS_PASSWORD', None, 'The redis password', 'Cache')

if __name__ == '__main__':