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

Self-hosted server host / url requirements #885

Open
gmaclennan opened this issue Oct 2, 2024 · 1 comment
Open

Self-hosted server host / url requirements #885

gmaclennan opened this issue Oct 2, 2024 · 1 comment

Comments

@gmaclennan
Copy link
Member

Description

For a user to add an archive server (self-hosted server for syncing with CoMapeo over the internet), they need to enter a server address. This issue is to define what the requirements for the server address are. Proposal:

  1. The address that the user enters does not need to include a protocol (e.g. https://)
  2. If the user does enter a protocol, then it must be https://
  3. Server address may include a port and a path.
  4. For websocket connections, a server address with https:// should map to wss://, and http:// to ws://. Unencrypted protocols should only be allowed with dangerouslyAllowInsecureConnections.

Questions:

  1. Should the backend or frontend be responsible for parsing the URL to check if it's valid? Maybe both?
@EvanHahn
Copy link
Contributor

EvanHahn commented Oct 6, 2024

I basically agree.

The frontend should:

  • add https:// as necessary
  • validate that the URL it's sending to the backend is valid (see below)

The backend should:

  • try to parse the URL with the URL constructor, failing if it cannot
  • assert that the protocol is https: (unless dangerouslyAllowInsecureConnections is true)
  • assert that the URL lacks authentication, a query string, or a hash

I wrote the frontend's URL normalization logic here: digidem/comapeo-mobile#779

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

2 participants