Skip to content

Commit b5e4cb5

Browse files
author
Matthew Fisher
committed
Merge pull request #1147 from deis/1114-disable-web
fix(controller): disable web UI from django urls
2 parents 8e2df84 + a3ed364 commit b5e4cb5

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

controller/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ full-clean: clean
3131
$(call ssh_all,'sudo docker rmi deis/controller')
3232

3333
test:
34-
python manage.py test --noinput api web
34+
python manage.py test --noinput api
3535

3636
runserver:
3737
python manage.py runserver
@@ -40,7 +40,7 @@ db:
4040
python manage.py syncdb --migrate --noinput
4141

4242
coverage:
43-
coverage run manage.py test --noinput api web
43+
coverage run manage.py test --noinput api
4444
coverage html
4545

4646
flake8:

controller/bin/boot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ etcd_safe_set protocol ${DEIS_PROTOCOL:-http}
3434
etcd_safe_set secretKey ${DEIS_SECRET_KEY:-`openssl rand -base64 64 | tr -d '\n'`}
3535
etcd_safe_set builderKey ${DEIS_BUILDER_KEY:-`openssl rand -base64 64 | tr -d '\n'`}
3636
etcd_safe_set registrationEnabled 1
37+
etcd_safe_set webEnabled 0
3738

3839
# wait for confd to run once and install initial templates
3940
until confd -onetime -node $ETCD -config-file /app/confd.toml 2>/dev/null; do

controller/deis/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@
283283
# check if we can register users with `deis register`
284284
REGISTRATION_ENABLED = True
285285

286+
# check if we should enable the web UI module
287+
WEB_ENABLED = False
288+
286289
# default to sqlite3, but allow postgresql config through envvars
287290
DATABASES = {
288291
'default': {

controller/deis/urls.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from __future__ import unicode_literals
99

10+
from django.conf import settings
1011
from django.conf.urls import patterns, include, url
1112
from django.contrib import admin
1213

@@ -17,7 +18,12 @@
1718
urlpatterns = patterns(
1819
'',
1920
url(r'^accounts/', include('allauth.urls')),
20-
url(r'^admin/', include(admin.site.urls)),
2121
url(r'^api/', include('api.urls')),
22-
url(r'^', include('web.urls')),
2322
)
23+
24+
if settings.WEB_ENABLED:
25+
urlpatterns += patterns(
26+
'',
27+
url(r'^', include('web.urls')),
28+
url(r'^admin/', include(admin.site.urls)),
29+
)

controller/templates/confd_settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@
2828
{{ if .deis_controller_registrationEnabled }}
2929
REGISTRATION_ENABLED = bool({{ .deis_controller_registrationEnabled }})
3030
{{ end }}
31+
32+
{{ if .deis_controller_webEnabled }}
33+
WEB_ENABLED = bool({{ .deis_controller_webEnabled }})
34+
{{ end }}

0 commit comments

Comments
 (0)