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

ADAPT_DOMAIN does not take into account the specified port #1319

Open
1 of 2 tasks
peauc opened this issue Nov 22, 2024 · 6 comments
Open
1 of 2 tasks

ADAPT_DOMAIN does not take into account the specified port #1319

peauc opened this issue Nov 22, 2024 · 6 comments

Comments

@peauc
Copy link

peauc commented Nov 22, 2024

Describe the current behavior

When using ADAPT_DOMAIN env var there is an issue when two of the domains are using different schemes.

Im self hosting grist on a private cloud.
Grist is accessed in http between servers and https over the internet.

I cannot get grist to work using ADAPT_DOMAIN. It tries to send back packets to the scheme configured in GRIST_HOME_URL.
When setting this GRIST_HOME_URL variable to empty. it then use the port specified by PORT which is also wrong.

Steps to reproduce

Host a grist using docker. Have it being reachable over two domains using both https & http.

You won't be able to use the two routers

Describe the expected behavior

It should adapt to the scheme passed in the host header

Where have you encountered this bug?

Instance information (when self-hosting only)

  • Grist instance:
    • Version: latest
    • Installation mode: docker
    • Architecture: single-worker
@paulfitz
Copy link
Member

@fflorent this report reminds me of a fix you make in #1247

@fflorent
Copy link
Collaborator

fflorent commented Nov 22, 2024

Indeed. I guess you specifically talk about this line: efdf400#diff-fc1da3a0a5d0e38041484575c01e5c8af0a44c54b5bdcf120ccbf6771e333d61R43

@peauc Cloning the repository, fetching my branch and building a docker image is something that you can do? If so, I would like to know if this PR fixes your issue by chance: #1247

Otherwise I can create an unofficial image for you so you can test.

@peauc
Copy link
Author

peauc commented Nov 22, 2024

Hello @fflorent, I would appreciate if you could build the image. It would be way easier that way

@peauc
Copy link
Author

peauc commented Nov 22, 2024

For better understanding of the problem I've drawn a schema
image

Please note that the internal router for grist uses http and the external uses https.
I use those env vars

GRIST_TEMPLATE_ORG="template"

PORT=80
GRIST_FORCE_LOGIN=true
GRIST_IGNORE_SESSION=false
GRIST_FORWARD_AUTH_HEADER="X-Forwarded-User"
GRIST_ADAPT_DOMAIN=true

So my http router works but not the https

@fflorent
Copy link
Collaborator

I failed to build the docker image, I think it is related to the recent changes in Dockerfile:

 ---> e59a558778ca
Step 36/55 : COPY --from=collector-py2 /usr/local/lib/libffi.so.6* /usr/local/lib
When using COPY with more than one source file, the destination must be a directory and end with a /

@peauc
Copy link
Author

peauc commented Nov 25, 2024

Alrighty @fflorent, i'll be watching this ticket then :D. We've found a dirty workaround for the meantime

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

3 participants