@@ -8,6 +8,8 @@ class DockerBaseSettings(CommunityBaseSettings):
8
8
9
9
"""Settings for local development with Docker"""
10
10
11
+ DEBUG = bool (os .environ .get ('RTD_DJANGO_DEBUG' , True ))
12
+
11
13
DOCKER_ENABLE = True
12
14
RTD_DOCKER_COMPOSE = True
13
15
RTD_DOCKER_COMPOSE_VOLUME = 'community_build-user-builds'
@@ -30,6 +32,10 @@ class DockerBaseSettings(CommunityBaseSettings):
30
32
# In the local docker environment, nginx should be trusted to set the host correctly
31
33
USE_X_FORWARDED_HOST = True
32
34
35
+ # Assume running on forwarded https
36
+ if os .environ .get ("RTD_FORCE_HTTPS" ):
37
+ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO" , "https" )
38
+
33
39
MULTIPLE_BUILD_SERVERS = ['build' ]
34
40
35
41
# https://docs.docker.com/engine/reference/commandline/run/#add-entries-to-container-hosts-file---add-host
@@ -149,6 +155,8 @@ def DATABASES(self): # noqa
149
155
}
150
156
151
157
ACCOUNT_EMAIL_VERIFICATION = "none"
158
+ if os .environ .get ("RTD_FORCE_HTTPS" ):
159
+ ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
152
160
SESSION_COOKIE_DOMAIN = None
153
161
CACHES = {
154
162
'default' : {
@@ -192,6 +200,8 @@ def DATABASES(self): # noqa
192
200
AWS_S3_USE_SSL = False
193
201
AWS_S3_ENDPOINT_URL = 'http://storage:9000/'
194
202
AWS_QUERYSTRING_AUTH = False
203
+ if os .environ .get ("RTD_FORCE_HTTPS" ):
204
+ S3_STATIC_STORAGE_OVERRIDE_PROTOCOL = "https"
195
205
196
206
RTD_SAVE_BUILD_COMMANDS_TO_STORAGE = True
197
207
RTD_BUILD_COMMANDS_STORAGE = 'readthedocs.storage.s3_storage.S3BuildCommandsStorage'
0 commit comments