From 9035fd3f6f1d5bf512bdcaae915010865a513c3d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 25 Aug 2026 17:22:21 +0530 Subject: [PATCH 1/4] feat(console): allow GitLab and Bitbucket sign-in to the console project The console project only ever defined a GitHub slot in its oAuthProviders, so createOAuth2Session for any other provider failed the `{provider}Enabled` check regardless of what credentials were configured - there was nowhere to put them. Adds GitLab and Bitbucket alongside GitHub, following the same `{provider}Enabled` / `{provider}Appid` / `{provider}Secret` key contract that app/controllers/api/account.php reads at sign-in. Unlike GitHub these are opt-in rather than unconditionally enabled: they advertise as enabled only once an app ID is present, so installs that haven't configured them report the provider as disabled rather than half-configured. Note the new _APP_CONSOLE_* variables are deliberately distinct from the existing _APP_VCS_* ones. Those power repository integration (installations, webhooks); console sign-in reads the project document's oAuthProviders, which is a separate credential pair. --- app/config/console.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/config/console.php b/app/config/console.php index bf1850182a..6a98b72e49 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -57,7 +57,18 @@ $console = [ 'oAuthProviders' => [ 'githubEnabled' => true, 'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''), - 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '') + 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', ''), + // GitLab and Bitbucket are opt-in: unlike GitHub they are not assumed + // to be configured on every install, so they only advertise as enabled + // once credentials are actually present. Note these are distinct from + // the _APP_VCS_* credentials, which power repository integration + // (installations/webhooks) rather than console sign-in. + 'gitlabEnabled' => !empty(System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', '')), + 'gitlabSecret' => System::getEnv('_APP_CONSOLE_GITLAB_SECRET', ''), + 'gitlabAppid' => System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', ''), + 'bitbucketEnabled' => !empty(System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', '')), + 'bitbucketSecret' => System::getEnv('_APP_CONSOLE_BITBUCKET_SECRET', ''), + 'bitbucketAppid' => System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', ''), ], 'smtpBaseTemplate' => APP_BRANDED_EMAIL_BASE_TEMPLATE, ]; From 6cdb60c38bf60c23accb378c9848f93b0f8fc6c5 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 25 Aug 2026 17:25:12 +0530 Subject: [PATCH 2/4] refactor: trim comment to match the file's style --- app/config/console.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/config/console.php b/app/config/console.php index 6a98b72e49..d8d0ec0b56 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -58,11 +58,7 @@ $console = [ 'githubEnabled' => true, 'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''), 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', ''), - // GitLab and Bitbucket are opt-in: unlike GitHub they are not assumed - // to be configured on every install, so they only advertise as enabled - // once credentials are actually present. Note these are distinct from - // the _APP_VCS_* credentials, which power repository integration - // (installations/webhooks) rather than console sign-in. + // Distinct from _APP_VCS_*, which powers repository integration, not sign-in 'gitlabEnabled' => !empty(System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', '')), 'gitlabSecret' => System::getEnv('_APP_CONSOLE_GITLAB_SECRET', ''), 'gitlabAppid' => System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', ''), From 982340e7f01d86c1819723034900097a6dc7103e Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 25 Aug 2026 17:32:07 +0530 Subject: [PATCH 3/4] refactor: enable GitLab and Bitbucket unconditionally, matching GitHub The conditional !empty() guard was redundant for sign-in: account.php already rejects empty appId/secret with the same PROJECT_PROVIDER_DISABLED exception immediately after the Enabled check. Matches the adjacent githubEnabled line instead. --- app/config/console.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/console.php b/app/config/console.php index d8d0ec0b56..7ef52ec06c 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -59,10 +59,10 @@ $console = [ 'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''), 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', ''), // Distinct from _APP_VCS_*, which powers repository integration, not sign-in - 'gitlabEnabled' => !empty(System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', '')), + 'gitlabEnabled' => true, 'gitlabSecret' => System::getEnv('_APP_CONSOLE_GITLAB_SECRET', ''), 'gitlabAppid' => System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', ''), - 'bitbucketEnabled' => !empty(System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', '')), + 'bitbucketEnabled' => true, 'bitbucketSecret' => System::getEnv('_APP_CONSOLE_BITBUCKET_SECRET', ''), 'bitbucketAppid' => System::getEnv('_APP_CONSOLE_BITBUCKET_APP_ID', ''), ], From fbb244b23bade0431e6de2fef09624616c3d5166 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 25 Aug 2026 17:34:33 +0530 Subject: [PATCH 4/4] refactor: drop the _APP_VCS_* comment --- app/config/console.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/config/console.php b/app/config/console.php index 7ef52ec06c..262dbc41c4 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -58,7 +58,6 @@ $console = [ 'githubEnabled' => true, 'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''), 'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', ''), - // Distinct from _APP_VCS_*, which powers repository integration, not sign-in 'gitlabEnabled' => true, 'gitlabSecret' => System::getEnv('_APP_CONSOLE_GITLAB_SECRET', ''), 'gitlabAppid' => System::getEnv('_APP_CONSOLE_GITLAB_APP_ID', ''),