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

Syncthing in Docker doesn't redirect to HTTPS when "Use HTTPS for GUI" is checked #9385

Open
huyi51462 opened this issue Feb 1, 2024 · 10 comments
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement)

Comments

@huyi51462
Copy link

huyi51462 commented Feb 1, 2024

Syncthing version : Docker 1.26.* 1.27.*
os : docker
browser version : Chrome 120.0.6099.225
what happened : when enable "Use HTTPS for GUI", syncthing gui can not redirect to https
expected : when enable "Use HTTPS for GUI" , syncthing gui can redirect http to https

here is compose file

version: "3"
syncthing:
    image: syncthing/syncthing:1.25
    container_name: syncthing
    restart: unless-stopped
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /syncthing/syncthing:/var/syncthing
@huyi51462 huyi51462 added bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated labels Feb 1, 2024
@bt90
Copy link
Contributor

bt90 commented Feb 1, 2024

syncthing gui can not redirect to https

Browser screenshots?

@calmh calmh removed the needs-triage New issues needed to be validated label Feb 1, 2024
@calmh calmh changed the title syncthing gui can not redirect to https Syncthing in Docker doesn't redirect to HTTPS when "Use HTTPS for GUI" is checked Feb 1, 2024
@calmh
Copy link
Member

calmh commented Feb 1, 2024

Yeah, this is a legit issue. The reason is that the Docker image sets STGUIADDRESS=0.0.0.0:8384 which implies not-TLS and overrides the GUI settings.

@huyi51462
Copy link
Author

Yeah, this is a legit issue. The reason is that the Docker image sets STGUIADDRESS=0.0.0.0:8384 which implies not-TLS and overrides the GUI settings.

got it thanks

@huyi51462 huyi51462 reopened this Feb 1, 2024
@huyi51462
Copy link
Author

huyi51462 commented Feb 1, 2024

Yeah, this is a legit issue. The reason is that the Docker image sets STGUIADDRESS=0.0.0.0:8384 which implies not-TLS and overrides the GUI settings.

How can this issue be resolved through configuration?
I have read the syncthing/README-Docker.md, and in the last section 'GUI Security,' it mentions, 'With the environment variable unset, Syncthing will follow what is set in the configuration file / GUI settings dialog.' However, even with version 1.25, this parameter is set, and the redirection is working correctly.

@huyi51462
Copy link
Author

syncthing gui can not redirect to https

Browser screenshots?

image

@calmh
Copy link
Member

calmh commented Feb 1, 2024

Workaround is something like docker run -e STGUIADDRESS=https://0.0.0.0:8384 ... to enable HTTPS from that side.

This behavior has been unchanged for quite a while, certainly 1.25.0 should behave the same as current.

@bt90
Copy link
Contributor

bt90 commented Feb 1, 2024

127.0.0.1 would onlybe accessible from within the container itself.

Networkmode host is the better approach anyway. The isolation cripples our network discovery.

@huyi51462
Copy link
Author

Workaround is something like docker run -e STGUIADDRESS=https://0.0.0.0:8384 ... to enable HTTPS from that side.

This behavior has been unchanged for quite a while, certainly 1.25.0 should behave the same as current.

yeah it works

@calmh calmh reopened this Feb 2, 2024
@calmh
Copy link
Member

calmh commented Feb 2, 2024

I still think this is an issue that should be handled somehow, if only by a documentation update on how to user the Docker image.

@huyi51462
Copy link
Author

huyi51462 commented Feb 2, 2024

I still think this is an issue that should be handled somehow, if only by a documentation update on how to user the Docker image.

Yeah, I totally agree with you. I mean, it's supposed to be an out of the box feature, but it can be pretty confusing.
The issue is only brought up at the end of the README-Docker, and there's no clear solution or explanation of how the options are related. It can be easily misunderstood as if STGUIADDRESS only affects the address and not the protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement)
Projects
None yet
Development

No branches or pull requests

3 participants