Skip to content

Commit

Permalink
add editorWebUrl to tunnelApplicationConfig (microsoft#166872)
Browse files Browse the repository at this point in the history
* add editorWebUrl to tunnelApplicationConfig

* bump distro & compile 'build'
  • Loading branch information
aeschli committed Nov 21, 2022
1 parent 857debc commit 0131be0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions build/azure-pipelines/cli/prepare.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/azure-pipelines/cli/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const setLauncherEnvironmentVars = () => {
['VSCODE_CLI_NAME_LONG', product.nameLong],
['VSCODE_CLI_QUALITYLESS_PRODUCT_NAME', product.nameLong.replace(/ - [a-z]+$/i, '')],
['VSCODE_CLI_APPLICATION_NAME', product.applicationName],
['VSCODE_CLI_EDITOR_WEB_URL', product.editorWebUrl],
['VSCODE_CLI_EDITOR_WEB_URL', product.tunnelApplicationConfig?.editorWebUrl],
['VSCODE_CLI_COMMIT', commit],
[
'VSCODE_CLI_WIN32_APP_IDS',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.74.0",
"distro": "22b60ce5f0f5a4db5d17091721f4d84891aec3b8",
"distro": "9a729adfa65f93dfd4fa871a118a494adb07e1b8",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -237,4 +237,4 @@
"elliptic": "^6.5.3",
"nwmatcher": "^1.4.4"
}
}
}
10 changes: 0 additions & 10 deletions product.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@
"serverApplicationName": "code-server-oss",
"serverDataFolderName": ".vscode-server-oss",
"tunnelApplicationName": "code-tunnel-oss",
"tunnelApplicationConfig": {
"authenticationProviders": {
"github": {
"scopes": [
"user:email",
"read:org"
]
}
}
},
"win32DirName": "Microsoft Code OSS",
"win32NameVersion": "Microsoft Code OSS",
"win32RegValueName": "CodeOSS",
Expand Down
5 changes: 4 additions & 1 deletion src/vs/base/common/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export interface IProductConfiguration {
readonly serverDataFolderName?: string;

readonly tunnelApplicationName?: string;
readonly tunnelApplicationConfig?: { authenticationProviders: IStringDictionary<{ scopes: string[] }> };
readonly tunnelApplicationConfig?: {
authenticationProviders: IStringDictionary<{ scopes: string[] }>;
editorWebUrl: string;
};

readonly npsSurveyUrl?: string;
readonly cesSurveyUrl?: string;
Expand Down
3 changes: 2 additions & 1 deletion src/vs/code/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export async function main(argv: string[]): Promise<any> {
return new Promise((resolve, reject) => {
let tunnelProcess;
if (process.env['VSCODE_DEV']) {
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...argv.slice(5)], { cwd: join(getAppRoot(), 'cli') });
const env = { ...process.env, VSCODE_CLI_EDITOR_WEB_URL: product.tunnelApplicationConfig?.editorWebUrl };
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...argv.slice(5)], { cwd: join(getAppRoot(), 'cli'), env });
} else {
const appPath = process.platform === 'darwin'
// ./Contents/MacOS/Electron => ./Contents/Resources/app/bin/code-tunnel-insiders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export class RemoteTunnelService extends Disposable implements IRemoteTunnelServ
if (process.env['VSCODE_DEV']) {
onOutput('Compiling tunnel CLI from sources and run', false);
onOutput(`${logLabel} Spawning: cargo run -- tunnel ${commandArgs.join(' ')}`, false);
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...commandArgs], { cwd: join(this.environmentService.appRoot, 'cli') });
const env = { ...process.env, VSCODE_CLI_EDITOR_WEB_URL: this.productService.tunnelApplicationConfig?.editorWebUrl };
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...commandArgs], { cwd: join(this.environmentService.appRoot, 'cli'), env });
} else {
onOutput('Running tunnel CLI', false);
const tunnelCommand = this.getTunnelCommandLocation();
Expand Down

0 comments on commit 0131be0

Please sign in to comment.