Repository: armada-ths/ais

Issue:
Production settings crashes
Output from AWS:

```
5/22/2023, 9:26:58 PM GMT+2 | return self._call_chain(*args) | web
-- | -- | --
5/22/2023, 9:26:58 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain | web
5/22/2023, 9:26:58 PM GMT+2 | result = func(*args) | web
5/22/2023, 9:26:58 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 643, in http_error_default | web
5/22/2023, 9:26:58 PM GMT+2 | raise HTTPError(req.full_url, code, msg, hdrs, fp) | web
5/22/2023, 9:26:58 PM GMT+2 | urllib.error.HTTPError: HTTP Error 403: Forbidden | web
5/22/2023, 9:26:58 PM GMT+2 | ERROR  2023-05-22 21:26:58,433 base 19 139762861427512 ["Invalid HTTP_HOST  header: '10.0.123.79:3000'. You may need to add '10.0.123.79' to  ALLOWED_HOSTS."] | web
5/22/2023, 9:26:57 PM GMT+2 | DEBUG 2023-05-22 21:26:57,751 base 19 139762860354360 Sending message of length 1052 to https://sentry.io/api/None/store/ | web
5/22/2023, 9:26:31 PM GMT+2 | ERROR  2023-05-22 21:26:31,831 base 19 139762861427512 Sentry responded with  an error: HTTP Error 403: Forbidden (url:  https://sentry.io/api/None/store/) | web
5/22/2023, 9:26:31 PM GMT+2 | Traceback (most recent call last): | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/transport/threaded.py", line 165, in send_sync | web
5/22/2023, 9:26:31 PM GMT+2 | super(ThreadedHTTPTransport, self).send(url, data, headers) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/transport/http.py", line 38, in send | web
5/22/2023, 9:26:31 PM GMT+2 | response = urlopen( | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/utils/http.py", line 66, in urlopen | web
5/22/2023, 9:26:31 PM GMT+2 | return opener.open(url, data, timeout) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 525, in open | web
5/22/2023, 9:26:31 PM GMT+2 | response = meth(req, response) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 634, in http_response | web
5/22/2023, 9:26:31 PM GMT+2 | response = self.parent.error( | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 563, in error | web
5/22/2023, 9:26:31 PM GMT+2 | return self._call_chain(*args) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain | web
5/22/2023, 9:26:31 PM GMT+2 | result = func(*args) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 643, in http_error_default | web
5/22/2023, 9:26:31 PM GMT+2 | raise HTTPError(req.full_url, code, msg, hdrs, fp) | web
5/22/2023, 9:26:31 PM GMT+2 | urllib.error.HTTPError: HTTP Error 403: Forbidden | web
5/22/2023, 9:26:31 PM GMT+2 | ERROR  2023-05-22 21:26:31,831 base 19 139762861427512 ["Invalid HTTP_HOST  header: '10.0.123.79:3000'. You may need to add '10.0.123.79' to  ALLOWED_HOSTS."] | web
5/22/2023, 9:26:31 PM GMT+2 | ERROR  2023-05-22 21:26:31,132 base 19 139762861427512 ["Invalid HTTP_HOST  header: '10.0.123.79:3000'. You may need to add '10.0.123.79' to  ALLOWED_HOSTS."] | web
5/22/2023, 9:26:31 PM GMT+2 | ERROR  2023-05-22 21:26:31,131 base 19 139762861427512 Sentry responded with  an error: HTTP Error 403: Forbidden (url:  https://sentry.io/api/None/store/) | web
5/22/2023, 9:26:31 PM GMT+2 | Traceback (most recent call last): | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/transport/threaded.py", line 165, in send_sync | web
5/22/2023, 9:26:31 PM GMT+2 | super(ThreadedHTTPTransport, self).send(url, data, headers) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/transport/http.py", line 38, in send | web
5/22/2023, 9:26:31 PM GMT+2 | response = urlopen( | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/site-packages/raven/utils/http.py", line 66, in urlopen | web
5/22/2023, 9:26:31 PM GMT+2 | return opener.open(url, data, timeout) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 525, in open | web
5/22/2023, 9:26:31 PM GMT+2 | response = meth(req, response) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 634, in http_response | web
5/22/2023, 9:26:31 PM GMT+2 | response = self.parent.error( | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 563, in error | web
5/22/2023, 9:26:31 PM GMT+2 | return self._call_chain(*args) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain | web
5/22/2023, 9:26:31 PM GMT+2 | result = func(*args) | web
5/22/2023, 9:26:31 PM GMT+2 | File "/usr/local/lib/python3.10/urllib/request.py", line 643, in http_error_default | web
5/22/2023, 9:26:31 PM GMT+2 | raise HTTPError(req.full_url, code, msg, hdrs, fp) | web
5/22/2023, 9:26:31 PM GMT+2 | urllib.error.HTTPError: HTTP Error 403: Forbidden | web
5/22/2023, 9:26:30 PM GMT+2 | DEBUG 2023-05-22 21:26:30,450 base 19 139762864003896 Sending message of length 1054 to https://sentry.io/api/None/store/ | web
5/22/2023, 9:26:30 PM GMT+2 | DEBUG 2023-05-22 21:26:30,440 base 19 139762865077048 Sending message of length 1050 to https://sentry.io/api/None/store/ | web
5/22/2023, 9:26:12 PM GMT+2 | Django version 2.2.24, using settings 'ais.production.settings' | web
5/22/2023, 9:26:12 PM GMT+2 | Starting development server at http://0.0.0.0:3000/ | web
5/22/2023, 9:26:12 PM GMT+2 | Quit the server with CONTROL-C. | web
5/22/2023, 9:26:12 PM GMT+2 | You have 2 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): banquet, fair. | web
5/22/2023, 9:26:12 PM GMT+2 | Run 'python manage.py migrate' to apply them. | web
5/22/2023, 9:26:12 PM GMT+2 | May 22, 2023 - 21:26:12 | web
5/22/2023, 9:26:10 PM GMT+2 | System check identified some issues: | web
5/22/2023, 9:26:10 PM GMT+2 | WARNINGS: | web
5/22/2023, 9:26:10 PM GMT+2 | ?:  (urls.W001) Your URL pattern ' uses include with a route ending with a  '. Remove the dollar from the route to avoid problems including URLs. | web
5/22/2023, 9:26:10 PM GMT+2 | ?: (urls.W005) URL namespace 'fair' isn't unique. You may not be able to reverse all URLs in this namespace | web
5/22/2023, 9:26:10 PM GMT+2 | System check identified 2 issues (0 silenced). | web
5/22/2023, 9:26:09 PM GMT+2 | Performing system checks... | web
5/22/2023, 9:26:09 PM GMT+2 | DEBUG 2023-05-22 21:26:09,745 base 19 139763070081864 Configuring Raven for host: https://sentry.io | web
5/22/2023, 9:26:06 PM GMT+2 | DEBUG 2023-05-22 21:26:06,582 base 8 139763928816456 Configuring Raven for host: https://sentry.io | web
5/22/2023, 9:26:03 PM GMT+2 | PostgreSQL started | web
5/22/2023, 9:26:03 PM GMT+2 | Waiting for postgres...
```


Discussion:

Resolving patch:
diff --git a/ais/common/settings.py b/ais/common/settings.py
--- a/ais/common/settings.py
+++ b/ais/common/settings.py
@@ -19,6 +19,7 @@
 
 INSTALLED_APPS = (
     "whitenoise.runserver_nostatic",
+    "ebhealthcheck.apps.EBHealthCheckConfig",
     "django.contrib.admin",
     "django.contrib.auth",
     "django.contrib.contenttypes",
diff --git a/ais/production/settings.py b/ais/production/settings.py
--- a/ais/production/settings.py
+++ b/ais/production/settings.py
@@ -9,6 +9,8 @@
 
 SECRET_KEY = os.environ.get("SECRET_KEY")
 
+ALLOWED_HOSTS = [".armada.nu", "localhost", "armada.nu"]
+
 DEBUG = False
 
 # The URL scheme is slightly different in a production environment


Test patch: