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

Nextcloud Host (trusted_domains) Configuration doesn't handle port 443 condition properly #1242

Open
PhoenixEmik opened this issue Dec 26, 2024 · 0 comments

Comments

@PhoenixEmik
Copy link

The trusted_domains setting for Nextcloud using port 443 (HTTPS) should not include the port number. This has been verified to be correct according to the help notes:

- variable: host
label: Host
description: |
Nextcloud host to create application URLs</br>
Examples: </br>
cloud.domain.com:30001</br>
cloud.domain.com (if you use port 443 externally)</br>
192.168.1.100:9001 (replace ip and port with your own)</br></br>
This will be appended to the trusted domains list, but changing that will not remove it from the list.</br>

However, the docker-compose file always appends the WebUI port to the host configuration, when the host domain is set without a colon. This behavior doesn't handle port 443 condition properly.

{% set host = namespace(x="") %}
{% if values.nextcloud.host %}
{% set host.x = values.nextcloud.host if ":" in values.nextcloud.host else "%s:%d"|format(values.nextcloud.host, values.network.web_port) %}
{% endif %}

Proposed Solution:

{% if ":443" in values.nextcloud.host %}
    {% set host.x = values.nextcloud.host.split(":443")[0] %}
{% elif ":" not in values.nextcloud.host and values.network.web_port == 443 %}
    {% set host.x = values.nextcloud.host %}
{% elif ":" not in values.nextcloud.host %}
    {% set host.x = "%s:%d"|format(values.nextcloud.host, values.network.web_port) %}
{% else %}
    {% set host.x = values.nextcloud.host %}
{% endif %}
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

No branches or pull requests

1 participant