Skip to content

Commit be72682

Browse files
authored
Dev: invoke options --no-django-debug and --http-domain (#10384)
* Adds docker-compose dev options to force HTTPS settings and DEBUG mode through environment * Remove settings that support https and disables suspicious host checking on Proxito
1 parent e3b5484 commit be72682

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

docs/dev/install.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ save some work while typing docker compose commands. This section explains these
114114
* ``--init`` is used the first time this command is ran to run initial migrations, create an admin user, etc
115115
* ``--no-reload`` makes all celery processes and django runserver
116116
to use no reload and do not watch for files changes
117-
* ``--ngrok`` is useful when it's required to access the local instance from outside (e.g. GitHub webhook)
117+
* ``--no-django-debug`` runs all containers with ``DEBUG=False``
118+
* ``--http-domain`` configures an external domain for the environment (useful for Ngrok or other http proxy).
119+
Note that https proxies aren't supported.
120+
There will also be issues with "suspicious domain" failures on Proxito.
118121
* ``--ext-theme`` to use the new dashboard templates
119122
* ``--webpack`` to start the Webpack dev server for the new dashboard templates
120123

readthedocs/settings/docker_compose.py

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class DockerBaseSettings(CommunityBaseSettings):
88

99
"""Settings for local development with Docker"""
1010

11+
DEBUG = bool(os.environ.get('RTD_DJANGO_DEBUG', True))
12+
1113
DOCKER_ENABLE = True
1214
RTD_DOCKER_COMPOSE = True
1315
RTD_DOCKER_COMPOSE_VOLUME = 'community_build-user-builds'
@@ -149,6 +151,7 @@ def DATABASES(self): # noqa
149151
}
150152

151153
ACCOUNT_EMAIL_VERIFICATION = "none"
154+
152155
SESSION_COOKIE_DOMAIN = None
153156
CACHES = {
154157
'default': {

readthedocs/storage/mixins.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class OverrideHostnameMixin:
1313
See: https://github.com/jschneier/django-storages/pull/658
1414
"""
1515

16-
override_hostname = None # Just the hostname without scheme (eg. 'assets.readthedocs.org')
16+
override_hostname = (
17+
None # Just the hostname without scheme (eg. 'assets.readthedocs.org')
18+
)
1719

1820
def url(self, *args, **kwargs):
1921
url = super().url(*args, **kwargs)

readthedocs/storage/s3_storage.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def __init__(self, *args, **kwargs):
7777

7878
class S3StaticStorageMixin:
7979

80-
bucket_name = getattr(settings, 'S3_STATIC_STORAGE_BUCKET', None)
81-
override_hostname = getattr(settings, 'S3_STATIC_STORAGE_OVERRIDE_HOSTNAME', None)
80+
bucket_name = getattr(settings, "S3_STATIC_STORAGE_BUCKET", None)
81+
override_hostname = getattr(settings, "S3_STATIC_STORAGE_OVERRIDE_HOSTNAME", None)
8282

8383
def __init__(self, *args, **kwargs):
8484
super().__init__(*args, **kwargs)

0 commit comments

Comments
 (0)