-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fast follows on 0.34 #9034
Fast follows on 0.34 #9034
Conversation
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.
PR Summary
This PR refactors frontend URL configuration by splitting FRONT_BASE_URL into three separate environment variables (FRONT_DOMAIN, FRONT_PORT, FRONT_PROTOCOL) across Docker, K8s, and server configurations.
- Introduces granular frontend URL control in
/packages/twenty-docker/.env.example
with new variables FRONT_DOMAIN, FRONT_PORT, and FRONT_PROTOCOL - Updates K8s manifests in
/packages/twenty-docker/k8s/manifests/
to use split URL variables for both server and worker deployments - Adds new
front_domain
variable in/packages/twenty-docker/k8s/terraform/variables.tf
that overlaps with existingtwentycrm_app_hostname
- Updates upgrade guide in
/packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx
with inconsistent section headers vs content - Removes FRONT_BASE_URL from test configurations in
/packages/twenty-server/.env.test
10 file(s) reviewed, 11 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/domain-manager/service/domain-manager.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/domain-manager/service/domain-manager.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-website/src/content/developers/self-hosting/upgrade-guide.mdx
Outdated
Show resolved
Hide resolved
getFrontUrl() { | ||
let baseUrl: URL; | ||
|
||
if (!this.environmentService.get('FRONT_DOMAIN')) { | ||
baseUrl = new URL(this.environmentService.get('SERVER_URL')); | ||
} else { | ||
baseUrl = new URL( | ||
`${this.environmentService.get('FRONT_PROTOCOL')}://${this.environmentService.get('FRONT_DOMAIN')}`, | ||
); | ||
|
||
const port = this.environmentService.get('FRONT_PORT'); | ||
|
||
if (port) { | ||
baseUrl.port = port.toString(); | ||
} | ||
} | ||
|
||
return baseUrl; | ||
} |
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 PORT of the SERVER_URL should differ from the frontend.
We should allow to set the FRONT_PORT without the FRONT_PROTOCOL and FRONT_DOMAIN.
Like that:
getFrontUrl() { | |
let baseUrl: URL; | |
if (!this.environmentService.get('FRONT_DOMAIN')) { | |
baseUrl = new URL(this.environmentService.get('SERVER_URL')); | |
} else { | |
baseUrl = new URL( | |
`${this.environmentService.get('FRONT_PROTOCOL')}://${this.environmentService.get('FRONT_DOMAIN')}`, | |
); | |
const port = this.environmentService.get('FRONT_PORT'); | |
if (port) { | |
baseUrl.port = port.toString(); | |
} | |
} | |
return baseUrl; | |
} | |
getFrontUrl() { | |
let baseUrl: URL; | |
if (!this.environmentService.get('FRONT_DOMAIN')) { | |
baseUrl = new URL(this.environmentService.get('SERVER_URL')); | |
} else { | |
baseUrl = new URL( | |
`${this.environmentService.get('FRONT_PROTOCOL')}://${this.environmentService.get('FRONT_DOMAIN')}`, | |
); | |
} | |
const port = this.environmentService.get('FRONT_PORT'); | |
if (port) { | |
baseUrl.port = port.toString(); | |
} | |
return baseUrl; | |
} |
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.
Our main concern is to lower the number of env variables needed
- in self hosting main case: we want front to be served on same url as server and we only have to specify SERVER_URL
- in local development case: we only have to specify FRONT_DOMAIN and FRONT_PORT in .env
Actually, I don't disagree with you, we could change port and protocol in separate if conditions and achieve the same goal
@Weiko what do you think?
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.
good enough
No description provided.