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

Place public urls if you plan to use Attendize as a backend service intended for internal usage, with a separate frontend #975

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

quentincaffeino
Copy link
Contributor

@quentincaffeino quentincaffeino commented Sep 17, 2021

I'm not sure how much is this an issue for other users of this repo. But in my opinion frontend is the face of the business so we develop custom frontend for our. And we encountered the issue that all the urls are built with the url from request object. Which is a problem when:

  1. You host your frontend and backend on different domains (subdomains in my case)
  2. If you access your backend using internal docker domains (example http://attendize/)

The most important part of this PR is two helpers: public_route & app_url.

First function exists to produce links to public urls. For example a link to download tickets will be opened on custom frontend.

Second was created to put absolute links to assets in emails. Because if you trigger email generation from private docker network all links would be inaccessible from public network.

Both helpers work by basically always forcing specific domain. For public_route it is a domain set in PUBLIC_URL env variable. For app_url it always forces APP_URL env var.

Both will still generate regular url if PUBLIC_URL was not set.

@johannac johannac added the feature Add a new feature label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants