/
config.py.sample
183 lines (142 loc) · 5.99 KB
/
config.py.sample
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import os
DEBUG = True # set to False in production mode
SECRET_KEY = "CHANGE_ME"
# DATABASES
# ListenBrainz
SQLALCHEMY_DATABASE_URI = "postgresql://listenbrainz:listenbrainz@lb_db:5432/listenbrainz"
POSTGRES_ADMIN_URI = "postgresql://postgres:postgres@lb_db/postgres"
POSTGRES_ADMIN_LB_URI = "postgresql://postgres:postgres@lb_db/listenbrainz"
# Timescale
SQLALCHEMY_TIMESCALE_URI = "postgresql://listenbrainz_ts:listenbrainz_ts@lb_db/listenbrainz_ts"
TIMESCALE_ADMIN_URI = "postgresql://postgres:postgres@lb_db/postgres"
TIMESCALE_ADMIN_LB_URI = "postgresql://postgres:postgres@lb_db/listenbrainz_ts"
# MessyBrainz
MESSYBRAINZ_SQLALCHEMY_DATABASE_URI = "postgresql://messybrainz:messybrainz@lb_db:5432/messybrainz"
MESSYBRAINZ_ADMIN_URI = "postgresql://postgres:postgres@lb_db/postgres"
MESSYBRAINZ_ADMIN_MSB_URI = "postgresql://postgres:postgres@lb_db/messybrainz"
# MusicBrainz & others
MBID_MAPPING_DATABASE_URI = ""
MB_DATABASE_URI = ""
# for use in playlists admin view
SQLALCHEMY_BINDS = {
'timescale': SQLALCHEMY_TIMESCALE_URI
}
# Redis
REDIS_HOST = "redis"
REDIS_PORT = 6379
REDIS_NAMESPACE = "listenbrainz"
# RabbitMQ
RABBITMQ_HOST = "rabbitmq"
RABBITMQ_PORT = 5672
RABBITMQ_USERNAME = "guest"
RABBITMQ_PASSWORD = "guest"
RABBITMQ_VHOST = "/"
MAXIMUM_RABBITMQ_CONNECTIONS = 20
# RabbitMQ exchanges and queues
INCOMING_EXCHANGE = "incoming"
INCOMING_QUEUE = "incoming"
UNIQUE_EXCHANGE = "unique"
UNIQUE_QUEUE = "unique"
WEBSOCKETS_QUEUE = "follow_list"
PLAYING_NOW_EXCHANGE = "playing_now"
PLAYING_NOW_QUEUE = "playing_now"
SPARK_RESULT_EXCHANGE = "spark_result"
SPARK_RESULT_QUEUE = "spark_result"
SPARK_REQUEST_EXCHANGE = "spark_request"
SPARK_REQUEST_QUEUE = "spark_request"
# Typesense -- this is only needed if you plan to run the Labs API end point for MBID mapping
TYPESENSE_HOST = "localhost"
TYPESENSE_PORT = 8108
TYPESENSE_API_KEY = "API_KEY"
# MusicBrainz OAuth
MUSICBRAINZ_CLIENT_ID = "CLIENT_ID"
MUSICBRAINZ_CLIENT_SECRET = "CLIENT_SECRET"
# Lastfm API
LASTFM_API_URL = "https://ws.audioscrobbler.com/2.0/"
LASTFM_API_KEY = "USE_LASTFM_API_KEY"
# Libre.fm API
LIBREFM_API_URL = "https://libre.fm/2.0/"
LIBREFM_API_KEY = "USE_LIBREFM_API_KEY"
# Stats
STATS_ENTITY_LIMIT = 100 # the number of entities to calculate at max with BQ
STATS_CALCULATION_LOGIN_TIME = 30 # users must have logged in to LB in the past 30 days for stats to be calculated
STATS_CALCULATION_INTERVAL = 7 # stats are calculated every 7 days
# Max time in seconds after which the playing_now stream will expire.
PLAYING_NOW_MAX_DURATION = 10 * 60
# LOGGING
# Uncomment any of the following logging stubs if you want to enable logging
# during development. In general you shouldn't need to do this
# LOG_FILE = {
# 'filename': './logs/listenbrainz.txt',
# 'max_bytes': 512 * 1024, # optional
# 'backup_count': 100, # optional
# }
# LOG_SENTRY = {
# 'dsn':'',
# 'environment': 'development',
# 'level': 'ERROR',
# 'traces_sample_rate': 1.0,
# }
# MISCELLANEOUS
# MAX file size to be allowed for the lastfm-backup import, default is infinite
# Size is in bytes
MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16MB
# Specify the upload folder where all the lastfm-backup will be stored
# The path must be absolute path
UPLOAD_FOLDER = "/tmp/lastfm-backup-upload"
# Set to "https://api.listenbrainz.org" if you want to work on frontend for user statistics
# without going through the process of generating the stats in local environment. Otherwise,
# set it to "http://localhost:7000"
API_URL = 'https://api.listenbrainz.org'
LASTFM_PROXY_URL = 'http://localhost:7080/'
SERVER_ROOT_URL = 'http://localhost:7000'
WEBSOCKETS_SERVER_URL = 'http://localhost:7082'
MUSICBRAINZ_OAUTH_URL = 'https://musicbrainz.org/oauth2/userinfo'
LISTENBRAINZ_LABS_API_URL = 'https://labs.api.listenbrainz.org'
# Flask Debug redirect
# Set to True if you want Flask-Debug to intercept redirects
DEBUG_TB_INTERCEPT_REDIRECTS = False
# Users who are allowed to view the LB admin interface
ADMINS = []
# Users who are allowed to submit playlists made for someone else.
APPROVED_PLAYLIST_BOTS = ['troi-bot']
# SPOTIFY
SPOTIFY_CLIENT_ID = 'needs a non empty default value for tests, change this'
SPOTIFY_CLIENT_SECRET = 'needs a non empty default value for tests, change this'
SPOTIFY_CALLBACK_URL = 'http://localhost/profile/music-services/spotify/callback/'
# CRITIQUEBRAINZ
CRITIQUEBRAINZ_CLIENT_ID = 'needs a non empty default value for tests, change this'
CRITIQUEBRAINZ_CLIENT_SECRET = 'needs a non empty default value for tests, change this'
CRITIQUEBRAINZ_REDIRECT_URI = 'http://localhost/profile/music-services/critiquebrainz/callback/'
# YOUTUBE
YOUTUBE_CONFIG = {
"web": {
"client_id": "fake-client-id",
"project_id": "test-project",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "fake-client-secret",
"redirect_uris": ["http://localhost/profile/music-services/youtube/callback/"],
"javascript_origins": ["http://localhost"]
}
}
YOUTUBE_API_KEY = 'change me'
YOUTUBE_REDIRECT_URI = 'http://localhost/profile/music-services/youtube/callback/'
# This is set to False to stop a warning from flask_sqlalchemy.
# We do not use this feature at all, so it is safe to set to False.
# See https://stackoverflow.com/a/33790196 for more details.
SQLALCHEMY_TRACK_MODIFICATIONS = False
TESTING = True # this flag is used by the mail module to check if mails need to be sent or not
# Mail server
SMTP_SERVER = 'listenbrainz-mail'
SMTP_PORT = 25
MAIL_FROM_DOMAIN = 'listenbrainz.org'
# expiration of 'Remember me' cookie
SESSION_REMEMBER_ME_DURATION = 365
# listen dumps creation dir
LISTEN_DUMP_TEMP_DIR_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'tmp')
# If set to True, reject listens from users who do not have an email
REJECT_LISTENS_WITHOUT_USER_EMAIL = False
# If set to True, do not allow new users without email to register
REJECT_NEW_USERS_WITHOUT_EMAIL = False