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

Make sync server endpoints path-relative #48

Conversation

struanb
Copy link
Contributor

@struanb struanb commented Oct 6, 2024

This backwards-compatible change allows the sync server endpoint to include a path, e.g. https://example.com/syncserver/, and facilitates serving the Prompta app and sync server from the same host.

(I am using this with a Dockerfile that runs an nginx server to serve the statically-built app, and to reverse-proxy requests from /db/ to a locally-running sync server, all wrapped up with the s6 supervisor to launch and keep everything running; can share this in a separate pull request).

This backwards-compatible change allows the sync server endpoint to include a path, e.g. https://example.com/syncserver/, and facilitates serving the Prompta app and sync server from the same host.
Copy link
Owner

@iansinnott iansinnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, thanks @struanb . If you your dockerfile is open source maybe you could leave a link here as it may be helpful for other users

@iansinnott iansinnott merged commit c6c4821 into iansinnott:master Oct 7, 2024
1 check failed
@struanb
Copy link
Contributor Author

struanb commented Oct 7, 2024

Of course, here is the Dockerfile. It is built on the other two PRs you have now merged (thanks for that).

I could submit a PR for it, but I'm unsure if you'd like to overwrite your existing Dockerfile or if you'd like it to have a different name. Also, the Dockerfile contains s6 runscripts and nginx.conf as heredocs, as I didn't want to mess with or clutter the repo more than the minimum necessary (and s6 and nginx are not necessary to run Prompta) but you might prefer them to be broken out into separate files. Finally, the Dockerfile patches src/lib/sync/vlcn.ts to set the default sync-server URL relative to the app URL (could do this more neatly with u = new URL(window.location.href) and u.pathname= but that doesn't run in sed so easily); and src/lib/capture.ts to disable telemetry (an env var controlling this would be preferable). Please let me know about this if a PR for this would be useful.

@struanb struanb deleted the feat/sync-server-relative-endpoints branch October 7, 2024 08:07
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.

2 participants