forked from mattmess1221/ValhallaSkinServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
42 lines (27 loc) · 1023 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Config objects used for valhalla
Required configurations via environment:
- SECRET_KEY
Required for production:
- SECRET_KEY : Used to create and validate api tokens
- DATABASE_URL : Connects to the database. uses format in RFC-1738
- TEXTURES_FS : The filesystem URL to the textures location
- TEXTURES_DOMAIN : The domain to point users to when requesting textures
"""
import os
import dotenv
dotenv.load_dotenv()
class Config:
SECRET_KEY = os.getenv('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', "sqlite:///valhalla.db")
SQLALCHEMY_TRACK_MODIFICATIONS = False
TEXTURES_FS = os.getenv('TEXTURES_FS', './valhalla')
OFFLINE = bool(os.getenv('OFFLINE', False))
SKIN_BLACKLIST = ["cape"]
CDN_DOMAIN = os.getenv("TEXTURES_DOMAIN")
CDN_HTTPS = CDN_DOMAIN is not None
CDN_ENDPOINTS = ["textures"]
CDN_TIMESTAMP = False
RAYGUN_APIKEY = os.getenv("RAYGUN_APIKEY")
class DebugConfig(Config):
DEBUG = True
ENV = "testing"