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

fix(core): Update frontend urls when using the --tunnel option #6898

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ export class Server extends AbstractServer {
* Returns the current settings for the frontend
*/
getSettingsForFrontend(): IN8nUISettings {
// Update all urls, in case `WEBHOOK_URL` was updated by `--tunnel`
const instanceBaseUrl = getInstanceBaseUrl();
this.frontendSettings.urlBaseWebhook = WebhookHelpers.getWebhookBaseUrl();
this.frontendSettings.urlBaseEditor = instanceBaseUrl;
this.frontendSettings.oauthCallbackUrls = {
oauth1: `${instanceBaseUrl}/${this.restEndpoint}/oauth1-credential/callback`,
oauth2: `${instanceBaseUrl}/${this.restEndpoint}/oauth2-credential/callback`,
};

// refresh user management status
Object.assign(this.frontendSettings.userManagement, {
quota: Container.get(License).getUsersLimit(),
Expand Down
Loading