Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support and test the reverse proxy configuration #28

Merged
merged 3 commits into from
Apr 15, 2023

Conversation

shankari
Copy link
Contributor

  • Check in a simple docker-compose to run the app behind an ngnix proxy
  • Set the relative path prefix to /admin/
  • change all the hrefs to use relative paths

So that we can test the reverse proxy configuration fixes in dev

This fixes #24 (comment)

The `docker-compose` (except for `nginx`) should be kept consistent with the
production `docker-compose-prod.yml` with the exception of `DASH_DEBUG_MODE`,
which is set to true so that we can debug errors in the setup more easily

Testing done:
- Built and ran the docker-compose
- Accessing http://localhost:8060/admin gives the same error as
#24 (comment)

```
Uncaught ReferenceError: DashRenderer is not defined
    <anonymous> http://localhost:8060/admin/:58
```
This internally sets the `requests_pathname_prefix`, which allows us to load
all the assets (including the javascript files) correctly. This is a partial
fix for #24
that implements the first step in
#24 (comment)
This fixes
#24 (comment)
#24 (comment)
#24 (comment)

Since there are not a lot of hrefs and they are all in the same file
#24 (comment)

```
$ grep -r href . | grep -v .git
./utils/cognito_utils.py:                dbc.Button('Login with AWS Cognito', id='login-button', href=CognitoConfig.AUTH_URL, style={
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/"),
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/data"),
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/tokens"),
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/map"),
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/push_notification"),
./app_sidebar_collapsible.py:                    href=dash.get_relative_path("/settings"),
```
@shankari
Copy link
Contributor Author

This fixes #24

@shankari shankari merged commit ac266f3 into dev Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant