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

Fix hosting Dolos publicly on https using docker-compose #1522

Merged
merged 2 commits into from
May 21, 2024

Conversation

rien
Copy link
Member

@rien rien commented May 15, 2024

If Dolos is hosted publicly behind a reverse proxy, Rails does not appropriately detect that HTTPS should be used for urls generated by the API, causing the front-end to fetch the CSV files using http instead of https (see #1518).

This PR fixes this issue by introducing a new environment variable DOLOS_API_URL which is used to detect the hosting properties. It supersedes the environment variables DOLOS_API_HOSTS and DOLOS_API_DISABLE_FORCE_SSL.

Unfortunately there is a bug in rails where files served using ActiveStorage don't listen to the relative_root_url (rails/rails#43633). This can cause issues if the API is hosted on a subdirectory (https://example.com/api).

See #1523 for more details and a workaround.

@rien rien added the bug Something isn't working label May 15, 2024

::: info

When hosting the Dolos API **on a subdireectory** (for example: `/api/`) using Docker behind a reverse proxy (**nginx**, **apache**, **haproxy**), there is currently a bug where Rails is generating incorrect URL's not respecting this subdirectory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subdireectory → subdirectory

@rien rien enabled auto-merge May 21, 2024 09:43
@rien rien disabled auto-merge May 21, 2024 09:44
@rien rien merged commit b882ca4 into main May 21, 2024
26 checks passed
@rien rien deleted the fix/self-hosting-dolos branch May 21, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants