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

Allow specifying application root path via the environment #76

Merged
merged 2 commits into from
Aug 22, 2021

Conversation

CyberShadow
Copy link
Contributor

@CyberShadow CyberShadow commented Aug 21, 2021

LineageOTA needs to know the full external URL to itself in order to generate correct links in the JSON emitted by the /api endpoint.

In typical circumstances, no manual configuration is necessary - it is able to infer it from the URL that it is accessed by, or from the Forwarded header, or from the ro.build.ota.url property from .prop files. However, when it is running behind a reverse proxy (and in the absence of the .ota.url property) , the URL prefix is not available to LineageOTA, so unless it matches the prefix on the local webserver, it is unable to construct a correct URL to itself in this scenario.

To allow it to do so, a mechanism must be added to provide this information to it. There are two straight-forward approaches:

  • Provide this information externally, i.e. using a configuration file or an environment variable

  • Provide this information in an HTTP header, in the same manner as the Forwarded header.

In this pull request, the former method is implemented. The rationale for not using the latter method is that administrators would need to be aware of this change and override or block the header in their reverse proxy configuration, to prevent it being forwarded (and thus spoofed).

Fixes #75.

@julianxhokaxhiu julianxhokaxhiu merged commit a97ce10 into julianxhokaxhiu:2.0 Aug 22, 2021
@julianxhokaxhiu
Copy link
Owner

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change web root for Docker image behind reverse proxy
2 participants