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

Fast follows on 0.34 #9034

Merged
merged 6 commits into from
Dec 12, 2024
Merged

Fast follows on 0.34 #9034

merged 6 commits into from
Dec 12, 2024

Conversation

charlesBochet
Copy link
Member

No description provided.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 existing twentycrm_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-docker/docker-compose.yml Outdated Show resolved Hide resolved
packages/twenty-docker/docker-compose.yml Outdated Show resolved Hide resolved
packages/twenty-docker/k8s/terraform/deployment-server.tf Outdated Show resolved Hide resolved
packages/twenty-docker/k8s/terraform/variables.tf Outdated Show resolved Hide resolved
packages/twenty-docker/k8s/terraform/variables.tf Outdated Show resolved Hide resolved
packages/twenty-server/.env.test Show resolved Hide resolved
@Weiko Weiko enabled auto-merge (squash) December 12, 2024 15:38
@Weiko Weiko merged commit 77c2961 into main Dec 12, 2024
18 of 19 checks passed
@Weiko Weiko deleted the fast-follows-0.34 branch December 12, 2024 15:46
Comment on lines +24 to +42
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;
}
Copy link
Contributor

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:

Suggested change
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;
}

Copy link
Member Author

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?

Copy link

@DillonMercz DillonMercz left a comment

Choose a reason for hiding this comment

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

good enough

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.

4 participants