cal.com
cal.com copied to clipboard
[CAL-3415] WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed
Latest cal version on Docker.
Server logs:
WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed {
WEBAPP_URL: 'https://cal.mydomain.com',
ALLOWED_HOSTNAMES: [
[
'cal.mydomain.com'
]
]
}
.env File
ALLOWED_HOSTNAMES='["cal.mydomain.com"]'
NEXT_PUBLIC_WEBAPP_URL=https://cal.mydomain.com
UPDATED: I updated the .env File to the following, and I can no more see the warning
ALLOWED_HOSTNAMES='"mydomain.com"'
NEXT_PUBLIC_WEBAPP_URL=https://cal.mydomain.com
Thank you for opening your first issue, one of our team members will review it as soon as it possible. ❤️🎉
I noticed the same failed match on my domain, but when I use the following:
ALLOWED_HOSTNAMES='"mydomain.com"' NEXT_PUBLIC_WEBAPP_URL=https://cal.mydomain.com
I get a 404 error:
I also see this error
same error here
Thanks for your update, this error no longer appear.
However now, I get redirect to http://localhost:3000 after login
I'm having the same issue when trying to visit my public page.
Allowed hostnames is properly defined in .env:
ALLOWED_HOSTNAMES='"mydomain.com"'
There might be a problem if the hostname is under a subdomain, see https://github.com/calcom/cal.com/blob/b38807cb0f9cc024f4b614d1cb631245bb95117e/packages/features/ee/organizations/lib/orgDomains.ts#L38
subdomain will never match here becuase of the dot
There might be a problem if the hostname is under a subdomain
That seems like a likely culprit. I was indeed trying to host under book.mydomain.com. Unfortunately I already just went for a free account with embedding instead of hosting it myself - so can't quickly test.
I have the same problem with the same situation (subdomain)
I am also having the same issues on two deployments all under book.mydomain.com
There might be a problem if the hostname is under a subdomain, see
https://github.com/calcom/cal.com/blob/b38807cb0f9cc024f4b614d1cb631245bb95117e/packages/features/ee/organizations/lib/orgDomains.ts#L38
subdomain will never match here becuase of the dot
You are right, thanks! @zomars @PeerRich could you have a look at it?
Using a 1 level upper the used domain breaks all schedule pages... so it cannot just be left like that.
@zomars Is this a known issue that is being worked on?
@zomars @PeerRich Should we reopen this issue? If it's something separate I can create a new issue.
I am also hosting under a subdomain and having this issue. Deploying to a subdomain is pretty popular in the self-hosting community so hope to see this addressed soon!
Thanks for the great software.
I'm joigning the rank of the people having the same issue, under the same condition apparently (self-hosted on a subdomain).
I've tried many:
WEBAPP_URL: 'https://cal.domain.tld'
ALLOWED_HOSTNAMES: [
@calcom/web:start: [
@calcom/web:start: 'https://cal.domain.tld',
@calcom/web:start: 'cal.domain.tld',
@calcom/web:start: 'cal.com',
@calcom/web:start: 'cal.dev',
@calcom/web:start: 'cal-staging.com',
@calcom/web:start: 'cal.community',
@calcom/web:start: 'cal.local:3000',
@calcom/web:start: 'localhost:3000'
@calcom/web:start: ]
@calcom/web:start: ]
as per the .env.example provided.
All resulting in the same error:
WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed
I'm joigning the rank of the people having the same issue, under the same condition apparently (self-hosted on a subdomain). I've tried many:
WEBAPP_URL: 'https://cal.domain.tld'
This is the worst project I tinkered with for self-hosting, I already ditched it. It's probably meant to be anti-self-hosted. Sad thing is this behavior only affect poor enthusiasts, as I believe someone with enough money can hire a dev to fix it for their own benefit.
Same boat as well. Same issues.
First of all sorry about the delay here, somehow I missed this ticket 🙏
It seems like a configuration and expectations issue to me. Cal.com supports organization with subdomains only at the moment.
ALLOWED_HOSTNAMES
holds a list of domains, on the subdomains of which the booking links and dashboard would work.
So, if ALLOWED_HOSTNAMES='"cal.com", "cal.dev"' then,
acme.cal.com
is a valid organization booking domain and WEBAPP_URL can be set to http://app.cal.com
dunder.cal.dev
is also a valid organization subdomain and WEBAPP_URL can be set to http://app.cal.dev
If ALLOWED_HOSTNAMES='"cal.domain.tld"" then WEBAPP_URL should be app.cal.domain.tld and acme.cal.domain.tld, dunder.cal.domain.tld, xxxx.cal.domain.tld are valid domains.
Also, to get organizations working please follow https://github.com/calcom/cal.com/blob/main/packages/features/ee/organizations/README.md#app-setup
Though I realize that we need to improve the DX here with better documentation and simplifying things more. Expect improvements soon !!
So, if ALLOWED_HOSTNAMES='"cal.com", "cal.dev"' then,
acme.cal.com
is a valid organization booking domain and WEBAPP_URL can be set tohttp://app.cal.com
dunder.cal.dev
is also a valid organization subdomain and WEBAPP_URL can be set tohttp://app.cal.dev
If ALLOWED_HOSTNAMES='"cal.domain.tld"" then WEBAPP_URL should be app.cal.domain.tld and acme.cal.domain.tld, dunder.cal.domain.tld, xxxx.cal.domain.tld are valid domains.
Thanks for the reply. If I understand this correctly then the following shouldn't show up?
@calcom/web:start: 08:47:32:454 WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed {
@calcom/web:start: WEBAPP_URL: 'https://calendar.convertain.com',
@calcom/web:start: ALLOWED_HOSTNAMES: [
@calcom/web:start: [
@calcom/web:start: 'convertain.com',
@calcom/web:start: 'convertain.dev'
@calcom/web:start: ]
@calcom/web:start: ]
@calcom/web:start: }
If I set NEXT_PUBLIC_WEBAPP_URL
just to calendar.convertain.com without the HTTPS in the Docker settings then I don't get the app to run at all because of...
+ scripts/replace-placeholder.sh http://localhost:3000 calendar.convertain.com
Replacing all statically built instances of http://localhost:3000 with calendar.convertain.com.
@hariombalhara In the Organization setup instructions, we have to enable Organizations in the web app before we can use them. But we can't access the web app because organizations aren't enabled.
Therefore, I can't host Cal on a subdomain from the start. It's a classic catch-22: I need organizations, but can't enable them. Can you confirm this interpretation or offer a work around? Thanks so much! I deeply appreciate your work.
Edit: and 'Organizations' requires an EE license. Hm... what's the recommended self hosting solution then? Can I use Cloudflare tunnels to host it on mydomain.com/cal
instead of cal.mydomain.com
?
I'll add to this, I have two instances one with a reverse proxy at localhost that does not work and has the same error everyone else is describing
However I have another setup with a reverse proxy on a different server, both of which use caddy.
Oddy enough, the one with the DIFFERENT server running the reverse proxy, appears to work with a subdomain and https without fail.
@RauchenwaldC Based on what you've posted, it indeed seems like the warning should be gone.
We are working on improvements to orgs setups, domain config, Dockerization, etc. at the moment so will report back here with updates over the coming days/weeks. Appreciate your all's patience and understanding.