Skip to content

Make httpSafePort work as expected when httpSafeOrigin is set#1514

Closed
dullbananas wants to merge 1 commit intocryptpad:stagingfrom
dullbananas:main
Closed

Make httpSafePort work as expected when httpSafeOrigin is set#1514
dullbananas wants to merge 1 commit intocryptpad:stagingfrom
dullbananas:main

Conversation

@dullbananas
Copy link
Copy Markdown

Fixes #907

Required for using a separate sandbox origin in a remote development environment, which I need for reproducing #973

@ghost ghost assigned yflory Jun 18, 2024
@ghost ghost requested review from yflory and removed request for yflory June 18, 2024 06:58
@ghost ghost changed the base branch from main to staging June 20, 2024 14:20
@ghost
Copy link
Copy Markdown

ghost commented Jun 20, 2024

Hello, can you please rebase your branch on staging?

@dullbananas dullbananas marked this pull request as draft June 20, 2024 21:28
@dullbananas dullbananas marked this pull request as ready for review June 21, 2024 02:47
@ghost
Copy link
Copy Markdown

ghost commented Jun 21, 2024

Thanks a lot @dullbananas!

@ghost
Copy link
Copy Markdown

ghost commented Jun 21, 2024

Hello,

Reading about your proposed changes with our lead developer, we understand there is a misunderstanding.

While I will try to rephrase the explicative sentence as best as I can in the config.js example, you only need to use the httpSafePort if you can't have a second domain name. If you are working on a local, development instance, with localhost per example.

Then you'll need something to emulate the other origin, here comes httpSafePort. Where you will have https://localhost:3000 for the main one and https://localhost:3001 for the sandbox.

In any other case, where you have 2 domains, you do not need httpSafePort at all.
Hope it helps clarify. :)

@ghost ghost closed this Jun 21, 2024
@dullbananas
Copy link
Copy Markdown
Author

I'm using a remote development environment where the URL used in the local browser to access the ports is more like 3000.example.com and 3001.example.com

@ghost
Copy link
Copy Markdown

ghost commented Jun 21, 2024

If you have 2 subdomains it's fine, it's the same. You don't need httpSafePort.

  • 3000.example.com is your httpUnsafeOrigin
  • 3001.example.com is your httpSafeOrigin

You don't need anything else.

@dullbananas
Copy link
Copy Markdown
Author

That's not true. Setting httpSafeOrigin causes the server to not use port 3001, which causes 3001.example.com to not exist.

This pull request was closed.
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

Successfully merging this pull request may close these issues.

httpSafePort is not loaded from config when httpSafeOrigin is set

2 participants