2018-02-01 15:13:05 +01:00
|
|
|
import os
|
|
|
|
from collections import defaultdict
|
2018-03-23 16:37:58 +01:00
|
|
|
|
2018-02-01 15:13:05 +01:00
|
|
|
DEBUG = False
|
|
|
|
|
|
|
|
SCHEME = 'https'
|
|
|
|
PREFERRED_URL_SCHEME = 'https'
|
|
|
|
SERVER_NAME = 'cloud.blender.org'
|
|
|
|
|
2018-03-23 16:37:58 +01:00
|
|
|
# os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = 'true'
|
2018-02-01 15:13:05 +01:00
|
|
|
os.environ['PILLAR_MONGO_DBNAME'] = 'cloud'
|
|
|
|
os.environ['PILLAR_MONGO_PORT'] = '27017'
|
|
|
|
os.environ['PILLAR_MONGO_HOST'] = 'mongo'
|
|
|
|
|
|
|
|
USE_X_SENDFILE = True
|
|
|
|
|
|
|
|
STORAGE_BACKEND = 'gcs'
|
|
|
|
|
|
|
|
CDN_SERVICE_DOMAIN = 'blendercloud-pro.r.worldssl.net'
|
|
|
|
CDN_CONTENT_SUBFOLDER = ''
|
|
|
|
CDN_STORAGE_ADDRESS = 'push-11.cdnsun.com'
|
|
|
|
|
2018-03-23 16:37:58 +01:00
|
|
|
CACHE_TYPE = 'redis' # null
|
2018-02-01 15:13:05 +01:00
|
|
|
CACHE_KEY_PREFIX = 'pw_'
|
|
|
|
CACHE_REDIS_HOST = 'redis'
|
|
|
|
CACHE_REDIS_PORT = '6379'
|
|
|
|
CACHE_REDIS_URL = 'redis://redis:6379'
|
|
|
|
|
|
|
|
PILLAR_SERVER_ENDPOINT = 'https://cloud.blender.org/api/'
|
|
|
|
|
2018-08-30 12:46:58 +02:00
|
|
|
BLENDER_ID_ENDPOINT = 'https://www.blender.org/id/'
|
2018-02-01 15:13:05 +01:00
|
|
|
|
|
|
|
GCLOUD_APP_CREDENTIALS = '/data/config/google_app.json'
|
|
|
|
GCLOUD_PROJECT = 'blender-cloud'
|
|
|
|
|
|
|
|
MAIN_PROJECT_ID = '563a9c8cf0e722006ce97b03'
|
|
|
|
# MAIN_PROJECT_ID = '57aa07c088bef606e89078bd'
|
|
|
|
|
|
|
|
ALGOLIA_INDEX_USERS = 'pro_Users'
|
|
|
|
ALGOLIA_INDEX_NODES = 'pro_Nodes'
|
|
|
|
|
|
|
|
ZENCODER_NOTIFICATIONS_URL = 'https://cloud.blender.org/api/encoding/zencoder/notifications'
|
|
|
|
|
|
|
|
FILE_LINK_VALIDITY = defaultdict(
|
|
|
|
lambda: 3600 * 24 * 30, # default of 1 month.
|
|
|
|
gcs=3600 * 23, # 23 hours for Google Cloud Storage.
|
|
|
|
cdnsun=3600 * 23
|
|
|
|
)
|
|
|
|
|
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
|
|
|
'formatters': {
|
2018-03-27 16:42:34 +02:00
|
|
|
'default': {'format': '%(levelname)8s %(name)s %(message)s'}
|
2018-02-01 15:13:05 +01:00
|
|
|
},
|
|
|
|
'handlers': {
|
|
|
|
'console': {
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
'formatter': 'default',
|
|
|
|
'stream': 'ext://sys.stderr',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'loggers': {
|
|
|
|
'pillar': {'level': 'INFO'},
|
2018-03-23 16:37:58 +01:00
|
|
|
# 'pillar.auth': {'level': 'DEBUG'},
|
|
|
|
# 'pillar.api.blender_id': {'level': 'DEBUG'},
|
|
|
|
# 'pillar.api.blender_cloud.subscription': {'level': 'DEBUG'},
|
2018-02-01 15:13:05 +01:00
|
|
|
'bcloud': {'level': 'INFO'},
|
|
|
|
'cloud': {'level': 'INFO'},
|
|
|
|
'attract': {'level': 'INFO'},
|
|
|
|
'flamenco': {'level': 'INFO'},
|
2018-03-23 16:37:58 +01:00
|
|
|
# 'pillar.api.file_storage': {'level': 'DEBUG'},
|
|
|
|
# 'pillar.api.file_storage.ensure_valid_link': {'level': 'INFO'},
|
2018-02-01 15:13:05 +01:00
|
|
|
'pillar.api.file_storage.refresh_links_for_backend': {'level': 'DEBUG'},
|
|
|
|
'werkzeug': {'level': 'DEBUG'},
|
|
|
|
'eve': {'level': 'WARNING'},
|
2018-03-23 16:37:58 +01:00
|
|
|
# 'elasticsearch': {'level': 'DEBUG'},
|
2018-02-01 15:13:05 +01:00
|
|
|
},
|
|
|
|
'root': {
|
|
|
|
'level': 'WARNING',
|
|
|
|
'handlers': [
|
|
|
|
'console',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-05 13:40:24 +02:00
|
|
|
# Latest version of the add-on.
|
|
|
|
BLENDER_CLOUD_ADDON_VERSION = '1.9.0'
|
|
|
|
|
2018-02-01 15:13:05 +01:00
|
|
|
REDIRECTS = {
|
|
|
|
# For old links, refer to the services page (hopefully it refreshes then)
|
|
|
|
'downloads/blender_cloud-latest-bundle.zip': 'https://cloud.blender.org/services#blender-addon',
|
|
|
|
|
2018-09-05 13:40:24 +02:00
|
|
|
# Latest Blender Cloud add-on.
|
2018-02-01 15:13:05 +01:00
|
|
|
'downloads/blender_cloud-latest-addon.zip':
|
2018-09-05 13:40:24 +02:00
|
|
|
f'https://storage.googleapis.com/institute-storage/addons/'
|
|
|
|
f'blender_cloud-{BLENDER_CLOUD_ADDON_VERSION}.addon.zip',
|
2018-02-01 15:13:05 +01:00
|
|
|
|
|
|
|
# Redirect old Grafista endpoint to /stats
|
|
|
|
'/stats/': '/stats',
|
|
|
|
}
|
|
|
|
|
|
|
|
UTM_LINKS = {
|
|
|
|
'cartoon_brew': {
|
|
|
|
'image': 'https://imgur.com/13nQTi3.png',
|
|
|
|
'link': 'https://store.blender.org/product/membership/'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SVNMAN_REPO_URL = 'https://svn.blender.cloud/repo/'
|
|
|
|
SVNMAN_API_URL = 'https://svn.blender.cloud/api/'
|
|
|
|
|
|
|
|
# Mail options, see pillar.celery.email_tasks.
|
|
|
|
SMTP_HOST = 'proog.blender.org'
|
|
|
|
SMTP_PORT = 25
|
|
|
|
SMTP_USERNAME = 'server@blender.cloud'
|
|
|
|
SMTP_TIMEOUT = 30 # timeout in seconds, https://docs.python.org/3/library/smtplib.html#smtplib.SMTP
|
|
|
|
MAIL_RETRY = 180 # in seconds, delay until trying to send an email again.
|
|
|
|
MAIL_DEFAULT_FROM_NAME = 'Blender Cloud'
|
|
|
|
MAIL_DEFAULT_FROM_ADDR = 'cloudsupport@blender.org'
|
2018-03-23 17:25:47 +01:00
|
|
|
|
|
|
|
# MUST be 8 characters long, see pillar.flask_extra.HashedPathConverter
|
|
|
|
# STATIC_FILE_HASH = '12345678'
|
|
|
|
# The value used in production is appended from Dockerfile.
|