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

feat(subdomain): use subdomain by workspace #8378

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

AMoreaux
Copy link
Contributor

@AMoreaux AMoreaux commented Nov 6, 2024

No description provided.

Copy link

github-actions bot commented Nov 6, 2024

Warnings
⚠️ Changes were made to the environment variables, but not to the documentation - Please review your changes and check if a change needs to be documented!

TODOs/FIXMEs:

  • // TODO: improve error management: packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts
  • // TODO: improve error management: packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts
  • /* TODO AMOREAUX: Need design for this */}: packages/twenty-front/src/pages/auth/SignInUp.tsx

Generated by 🚫 dangerJS against 2e7a73c

@AMoreaux AMoreaux force-pushed the feat/use-subdomain-by-workspace branch 3 times, most recently from 1866118 to ce86332 Compare November 7, 2024 17:08
Copy link
Member

@FelixMalfait FelixMalfait left a 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!

@@ -0,0 +1,13 @@
export const getWorkspaceSubdomainByOrigin = (origin: string) => {
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


const subdomain = hostParts[0];

if (subdomain === 'app') return;
Copy link
Member

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
Copy link
Member

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)

```

The `yarn database:migrate:prod` command will apply the migrations to the database structure (core and metadata schemas)
Copy link
Member

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 = () => {
Copy link
Member

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
@AMoreaux AMoreaux force-pushed the feat/use-subdomain-by-workspace branch from d6b17ee to 42eafbb Compare November 8, 2024 18:09
@AMoreaux AMoreaux force-pushed the feat/use-subdomain-by-workspace branch from 42eafbb to d80e940 Compare November 12, 2024 09:33
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