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

Commits on Apr 15, 2023

  1. Check in a simple docker-compose to run the app behind an nginx proxy

    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
    ```
    shankari committed Apr 15, 2023
    Configuration menu
    Copy the full SHA
    712cb98 View commit details
    Browse the repository at this point in the history
  2. Set the relative path prefix to /admin/

    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)
    shankari committed Apr 15, 2023
    Configuration menu
    Copy the full SHA
    e19dd49 View commit details
    Browse the repository at this point in the history
  3. Change all the hrefs to relative paths

    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 committed Apr 15, 2023
    Configuration menu
    Copy the full SHA
    d6cfdd2 View commit details
    Browse the repository at this point in the history