-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathdocker_local_settings.py
More file actions
189 lines (150 loc) · 5.64 KB
/
docker_local_settings.py
File metadata and controls
189 lines (150 loc) · 5.64 KB
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
184
185
186
187
188
189
import logging
import os
# ===================
# = Server Settings =
# ===================
ADMINS = (("Samuel Clay", "samuel@newsblur.com"),)
SERVER_EMAIL = "server@newsblur.com"
HELLO_EMAIL = "hello@newsblur.com"
NEWSBLUR_URL = "https://localhost"
PUSH_DOMAIN = "localhost"
SESSION_COOKIE_DOMAIN = "localhost"
# ===================
# = Global Settings =
# ===================
DOCKERBUILD = True
DEBUG = False
DEBUG = True
# DEBUG_ASSETS controls JS/CSS asset packaging. Turning this off requires you to run
# `./manage.py collectstatic` first. Turn this on for development so you can see
# changes in your JS/CSS.
DEBUG_ASSETS = False # Make sure to run `./manage.py collectstatic` first
DEBUG_ASSETS = True
# DEBUG_QUERIES controls the output of the database query logs. Can be rather verbose
# but is useful to catch slow running queries. A summary is also useful in cutting
# down verbosity.
DEBUG_QUERIES = DEBUG
DEBUG_QUERIES_SUMMARY_ONLY = True
DEBUG_QUERIES_SUMMARY_ONLY = False
MEDIA_URL = "/media/"
IMAGES_URL = "/imageproxy"
# Uncomment below to debug iOS/Android widget
# IMAGES_URL = 'https://haproxy/imageproxy'
SECRET_KEY = "YOUR SECRET KEY"
AUTO_PREMIUM_NEW_USERS = True
AUTO_PREMIUM_ARCHIVE_NEW_USERS = True
AUTO_PREMIUM_PRO_NEW_USERS = True
AUTO_PREMIUM = True
# AUTO_PREMIUM = False
if not AUTO_PREMIUM:
AUTO_PREMIUM_NEW_USERS = False
AUTO_PREMIUM_ARCHIVE_NEW_USERS = False
AUTO_PREMIUM_PRO_NEW_USERS = False
AUTO_ENABLE_NEW_USERS = True
ENFORCE_SIGNUP_CAPTCHA = False
ENABLE_PUSH = False
PRO_MINUTES_BETWEEN_FETCHES = 15
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://newsblur_db_redis:6579/6",
},
}
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Set this to the username that is shown on the homepage to unauthenticated users.
HOMEPAGE_USERNAME = "popular"
# Default username for dev autologin (only works when DEBUG=True)
DEV_AUTOLOGIN_USERNAME = "samuel"
# Google Reader OAuth API Keys
OAUTH_KEY = "www.example.com"
OAUTH_SECRET = "SECRET_KEY_FROM_GOOGLE"
S3_ACCESS_KEY = "XXX"
S3_SECRET = "SECRET"
S3_BACKUP_BUCKET = "newsblur-backups"
S3_PAGES_BUCKET_NAME = "pages-XXX.newsblur.com"
S3_ICONS_BUCKET_NAME = "icons-XXX.newsblur.com"
S3_AVATARS_BUCKET_NAME = "avatars-XXX.newsblur.com"
STRIPE_SECRET = "YOUR-SECRET-API-KEY"
STRIPE_PUBLISHABLE = "YOUR-PUBLISHABLE-API-KEY"
# ===============
# = Social APIs =
# ===============
FACEBOOK_APP_ID = "111111111111111"
FACEBOOK_SECRET = "99999999999999999999999999999999"
TWITTER_CONSUMER_KEY = "ooooooooooooooooooooo"
TWITTER_CONSUMER_SECRET = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
YOUTUBE_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# =============
# = Databases =
# =============
DATABASES = {
"default": {
"NAME": "newsblur",
"ENGINE": "django_prometheus.db.backends.postgresql",
#'ENGINE': 'django.db.backends.mysql',
"USER": "newsblur",
"PASSWORD": "newsblur",
"HOST": "newsblur_db_postgres",
"PORT": 5432,
},
}
MONGO_DB = {"name": "newsblur", "host": "newsblur_db_mongo:29019"}
MONGO_ANALYTICS_DB = {
"name": "nbanalytics",
"host": "newsblur_db_mongo:29019",
}
MONGODB_SLAVE = {"host": "newsblur_db_mongo"}
# Celery RabbitMQ/Redis Broker
BROKER_URL = "redis://newsblur_db_redis:6579/0"
CELERY_RESULT_BACKEND = BROKER_URL
CELERY_WORKER_CONCURRENCY = 1
REDIS_USER = {"host": "newsblur_db_redis", "port": 6579}
REDIS_PUBSUB = {"host": "newsblur_db_redis", "port": 6579}
REDIS_STORY = {"host": "newsblur_db_redis", "port": 6579}
REDIS_SESSIONS = {"host": "newsblur_db_redis", "port": 6579}
CELERY_REDIS_DB_NUM = 4
SESSION_REDIS_DB = 5
ELASTICSEARCH_FEED_HOSTS = ["newsblur_db_elasticsearch:9200"]
ELASTICSEARCH_STORY_HOSTS = ["newsblur_db_elasticsearch:9200"]
ELASTICSEARCH_DISCOVER_HOSTS = ["newsblur_db_elasticsearch:9200"]
ELASTICSEARCH_FEED_HOST = "http://newsblur_db_elasticsearch:9200"
ELASTICSEARCH_STORY_HOST = "http://newsblur_db_elasticsearch:9200"
ELASTICSEARCH_DISCOVER_HOST = "http://newsblur_db_elasticsearch:9200"
BACKED_BY_AWS = {
"pages_on_node": False,
"pages_on_s3": False,
"icons_on_s3": False,
}
OPENAI_API_KEY = "sk-svcacct-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
ANTHROPIC_API_KEY = "sk-ant-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GOOGLE_GEMINI_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
ASK_AI_MODEL = "opus" # Options: opus, gpt-5.2, gemini-3, grok-4.1
BRIEFING_MODEL = "haiku" # Options: haiku, gpt-5-mini, gemini-flash-lite, grok-4.1-fast
# ===========
# = Logging =
# ===========
# Logging (setup for development)
LOG_TO_STREAM = True
if len(logging._handlerList) < 1:
LOG_FILE = "~/newsblur/logs/development.log"
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)-12s: %(message)s",
datefmt="%b %d %H:%M:%S",
handler=logging.StreamHandler,
)
MAILGUN_ACCESS_KEY = "key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MAILGUN_SERVER_NAME = "newsblur.com"
DO_TOKEN_LOG = "0000000000000000000000000000000000000000000000000000000000000000"
DO_TOKEN_FABRIC = "0000000000000000000000000000000000000000000000000000000000000000"
SERVER_NAME = "nblocalhost"
NEWSBLUR_URL = os.getenv("NEWSBLUR_URL", "https://localhost")
if NEWSBLUR_URL == "https://localhost":
SESSION_COOKIE_DOMAIN = "localhost"
SESSION_ENGINE = "redis_sessions.session"
# CORS_ORIGIN_REGEX_WHITELIST = ('^(https?://)?(\w+\.)?nb.local\.com$', )
RECAPTCHA_SECRET_KEY = "0000000000000000000000000000000000000000"
IMAGES_SECRET_KEY = "0000000000000000000000000000000"
# APNS settings for token-based authentication
APNS_TEAM_ID = "XXXXXXXXXX" # Apple Developer Team ID (10 characters)
APNS_KEY_ID = "XXXXXXXXXX" # APNS Key ID (10 characters)