-
Notifications
You must be signed in to change notification settings - Fork 11
Description
What
Andi Public is not working correctly in the development and staging environment.
Acceptance Criteria
- Andi Public can be used to view a dataset in the dev environment
- Andi Public can be used to view a dataset in the staging environment
Why
The following error message is displayed:
5:28:20.990 [error] Could not check origin for Phoenix.Socket transport. │ │ Origin of the request: https://sharedata.dev-smartos.com │ │ This happens when you are attempting a socket connection to │ │ a different host than the one configured in your config/ │ │ files. For example, in development the host is configured │ │ to "localhost" but you may be trying to access it from │ │ "127.0.0.1". To fix this issue, you may either: │ │ 1. update [url: [host: ...]] to your actual host in the │ │ config file for your current environment (recommended) │ │ 2. pass the :check_origin option when configuring your │ │ endpoint or when configuring the transport in your │ │ UserSocket module, explicitly outlining which origins │ │ are allowed: │ │ check_origin: ["https://example.com", │ │ "//another.com:888", "//other.com"]
This seems to relate to the fact that the ANDI public URL in dev is:
https://sharedata.dev-smartos.com/datasets
And the ANDI public URL in staging is:
https://sharedata.staging-smartos.com/datasets
However, in smartcitiesdata/apps/andi/config.exc, the check origin pattern matching only includes the following urls: check_origin: ["http://localhost:4000", "https://*.smartcolumbusos.com"]
Since the pattern of the dev and staging ANDI instances do not follow this pattern, the application does not work properly.