-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(subdomain): use subdomain by workspace #8378
base: main
Are you sure you want to change the base?
Conversation
TODOs/FIXMEs:
|
1866118
to
ce86332
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started having a quick look but not in depth. Looks like great work!!! Big piece!
.../twenty-server/src/database/typeorm/core/migrations/1730137590546-addSubdomainToWorkspace.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,13 @@ | |||
export const getWorkspaceSubdomainByOrigin = (origin: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really understand what origin meant in this context, is it getWorkspaceSubdomainFromUrl or fromHostName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's from the origin header:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin
|
||
const subdomain = hostParts[0]; | ||
|
||
if (subdomain === 'app') return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have SERVER_URL
and FRONT_BASE_URL
I think. Could we re-use that instead of hardcoding app maybe?
# v0.32.0 to v0.33.0 | ||
|
||
Upgrade your Twenty instance to use v0.33.0 image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we need to do I think is deprecate IS_SIGN_UP_DISABLED
, instead it might be handy to introduce something like IS_MULTIWORKSPACE_ENABLED
which defaults to false, could that help simplifying the code in other places? I'm not sure if this should be fully handled as part of this PR as there might be a few edge cases that are not well covered with the current IS_SIGN_UP_DISABLED
(for the first time the user is signing up on a host instance / if workspaces.count === 0 then he's allowed to create a workspace)
packages/twenty-server/test/utils/createTestingService.utils.ts
Outdated
Show resolved
Hide resolved
``` | ||
|
||
The `yarn database:migrate:prod` command will apply the migrations to the database structure (core and metadata schemas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add instructions somewhere in the doc on how to setup/test multi-sub domains locally? That would help me review the PR also, as I didn't figure out how to test this locally
import { isDefined } from '~/utils/isDefined'; | ||
import { sleep } from '~/utils/sleep'; | ||
import { buildWorkspaceUrl } from '~/utils/workspace-url.helper'; | ||
|
||
export const useWorkspaceSwitching = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workspace switcher still works locally even though I'm in mono-domain mode, is that expected? I thought we wouldn't manage to make it work without multi-domain
# Conflicts: # packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx # Conflicts: # packages/twenty-front/vite.config.ts
# Conflicts: # packages/twenty-front/src/generated/graphql.tsx
# Conflicts: # packages/twenty-front/src/modules/settings/security/components/SettingsSecurityOptionsList.tsx
d6b17ee
to
42eafbb
Compare
42eafbb
to
d80e940
Compare
No description provided.