Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e480f6527e | ||
|
|
26584f2060 | ||
|
|
a4c0fd1fdc | ||
|
|
6c104c016e | ||
|
|
599670136d | ||
|
|
ce637d318d | ||
|
|
d8654b5a19 | ||
|
|
12c3ccd6c7 | ||
|
|
7954656610 | ||
|
|
87ebf03eb7 | ||
|
|
df1c34e291 | ||
|
|
4a65b58772 | ||
|
|
11fdb8854b | ||
|
|
0a92bb1607 | ||
|
|
5bac2cbdb8 | ||
|
|
511c3e95b2 |
11
.travis.yml
11
.travis.yml
@@ -4,17 +4,17 @@ jobs:
|
||||
include:
|
||||
- name: Test
|
||||
if: tag IS blank
|
||||
script: ./ci/image/run.sh "yarn && GITHUB_TOKEN=3229b0eec0a1622d6d1d1e00fca5b626070f5a10 yarn vscode && ./ci/ci.sh"
|
||||
script: ./ci/image/run.sh "yarn && git submodule update --init && yarn vscode:patch && ./ci/ci.sh"
|
||||
deploy: null
|
||||
- name: Linux Release
|
||||
if: tag IS present
|
||||
script:
|
||||
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
||||
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh"
|
||||
- ./ci/release-image/push.sh
|
||||
- name: Linux ARM64 Release
|
||||
if: tag IS present
|
||||
script:
|
||||
- ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
||||
- ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh && ./ci/build-test.sh"
|
||||
- ./ci/release-image/push.sh
|
||||
arch: arm64
|
||||
- name: MacOS Release
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
os: osx
|
||||
language: node_js
|
||||
node_js: 12
|
||||
script: yarn && yarn vscode && travis_wait 60 ci/release.sh
|
||||
script: yarn && yarn vscode && travis_wait 60 ci/release.sh && ./ci/build-test.sh
|
||||
|
||||
before_deploy:
|
||||
- echo "$JSON_KEY" | base64 --decode > ./ci/key.json
|
||||
@@ -31,6 +31,7 @@ deploy:
|
||||
- provider: releases
|
||||
edge: true
|
||||
draft: true
|
||||
overwrite: true
|
||||
tag_name: $TRAVIS_TAG
|
||||
target_commitish: $TRAVIS_COMMIT
|
||||
name: $TRAVIS_TAG
|
||||
@@ -47,6 +48,8 @@ deploy:
|
||||
local_dir: release-upload
|
||||
on:
|
||||
tags: true
|
||||
# TODO: The gcs provider fails to install on arm64.
|
||||
condition: $TRAVIS_CPU_ARCH = amd64
|
||||
|
||||
cache:
|
||||
timeout: 600
|
||||
|
||||
21
ci/build-test.sh
Executable file
21
ci/build-test.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# build-test.bash -- Make sure the build worked.
|
||||
# This is to make sure we don't have Node version errors or any other
|
||||
# compilation-related errors.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
function main() {
|
||||
cd "$(dirname "${0}")/.." || exit 1
|
||||
|
||||
local output
|
||||
output=$(node ./build/out/node/entry.js --list-extensions 2>&1)
|
||||
if echo "$output" | grep 'was compiled against a different Node.js version'; then
|
||||
echo "$output"
|
||||
exit 1
|
||||
else
|
||||
echo "Build ran successfully"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -15,7 +15,7 @@ RUN yum update -y && yum install -y \
|
||||
RUN mkdir /usr/share/node && cd /usr/share/node \
|
||||
&& curl "https://nodejs.org/dist/v12.14.0/node-v12.14.0-linux-$(uname -m | sed 's/86_//; s/aarch/arm/').tar.xz" | tar xJ --strip-components=1 --
|
||||
ENV PATH "$PATH:/usr/share/node/bin"
|
||||
RUN npm install -g yarn
|
||||
RUN npm install -g yarn@1.22.4
|
||||
|
||||
RUN curl -L "https://github.com/mvdan/sh/releases/download/v3.0.1/shfmt_v3.0.1_linux_$(uname -m | sed 's/x86_/amd/; s/aarch64/arm/')" > /usr/local/bin/shfmt \
|
||||
&& chmod +x /usr/local/bin/shfmt
|
||||
|
||||
@@ -5,9 +5,22 @@ set -euo pipefail
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# This, strangely enough, fixes the arm build being terminated for not having
|
||||
# output on Travis. It's as if output is buffered and only displayed once a
|
||||
# certain amount is collected. Five seconds didn't work but one second seems
|
||||
# to generate enough output to make it work.
|
||||
local pid
|
||||
while true; do
|
||||
echo 'Still running...'
|
||||
sleep 1
|
||||
done &
|
||||
pid=$!
|
||||
|
||||
docker build ci/image
|
||||
imageTag="$(docker build -q ci/image)"
|
||||
docker run -t --rm -e CI -e GITHUB_TOKEN -e TRAVIS_TAG -v "$(yarn cache dir):/usr/local/share/.cache/yarn/v6" -v "$PWD:/repo" -w /repo "$imageTag" "$*"
|
||||
|
||||
kill $pid
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -17,7 +17,7 @@ function package() {
|
||||
fi
|
||||
|
||||
local arch
|
||||
arch="$(uname -m)"
|
||||
arch=$(uname -m | sed 's/aarch/arm/')
|
||||
|
||||
echo -n "Creating release..."
|
||||
|
||||
|
||||
@@ -10,6 +10,44 @@ index e73dd4d9e8..e3192b3a0d 100644
|
||||
resources/server
|
||||
build/node_modules
|
||||
coverage/
|
||||
diff --git a/.yarnrc b/.yarnrc
|
||||
index 7808166004..1e16cde724 100644
|
||||
--- a/.yarnrc
|
||||
+++ b/.yarnrc
|
||||
@@ -1,3 +1,3 @@
|
||||
-disturl "https://atom.io/download/electron"
|
||||
-target "7.1.11"
|
||||
-runtime "electron"
|
||||
+disturl "http://nodejs.org/dist"
|
||||
+target "12.4.0"
|
||||
+runtime "node"
|
||||
diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
|
||||
index 7a2320d828..5768890636 100644
|
||||
--- a/build/npm/postinstall.js
|
||||
+++ b/build/npm/postinstall.js
|
||||
@@ -33,9 +33,9 @@ function yarnInstall(location, opts) {
|
||||
|
||||
yarnInstall('extensions'); // node modules shared by all extensions
|
||||
|
||||
-yarnInstall('remote'); // node modules used by vscode server
|
||||
+// yarnInstall('remote'); // node modules used by vscode server
|
||||
|
||||
-yarnInstall('remote/web'); // node modules used by vscode web
|
||||
+// yarnInstall('remote/web'); // node modules used by vscode web
|
||||
|
||||
const allExtensionFolders = fs.readdirSync('extensions');
|
||||
const extensions = allExtensionFolders.filter(e => {
|
||||
@@ -68,7 +68,7 @@ runtime "${runtime}"`;
|
||||
}
|
||||
|
||||
yarnInstall(`build`); // node modules required for build
|
||||
-yarnInstall('test/automation'); // node modules required for smoketest
|
||||
-yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
-yarnInstall('test/integration/browser'); // node modules required for integration
|
||||
+// yarnInstall('test/automation'); // node modules required for smoketest
|
||||
+// yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
+// yarnInstall('test/integration/browser'); // node modules required for integration
|
||||
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
diff --git a/coder.js b/coder.js
|
||||
new file mode 100644
|
||||
index 0000000000..6aee0e46bc
|
||||
@@ -119,7 +157,7 @@ index 2d8b725ff2..a8d93a17ca 100644
|
||||
unique-stream@^2.0.2:
|
||||
version "2.2.1"
|
||||
diff --git a/package.json b/package.json
|
||||
index 6e9b9dc0a0..49b14e536a 100644
|
||||
index 29d3cb6677..d3788cb1ab 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -33,6 +33,9 @@
|
||||
@@ -210,7 +248,7 @@ index 2c64061da7..c0ef8faedd 100644
|
||||
// Do nothing. If we can't read the file we have no
|
||||
// language pack config.
|
||||
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
|
||||
index 45f6f17ce0..79fde0b92c 100644
|
||||
index 45f6f17ce0..4d1a590a7c 100644
|
||||
--- a/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ b/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -246,12 +246,18 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
@@ -234,7 +272,26 @@ index 45f6f17ce0..79fde0b92c 100644
|
||||
}
|
||||
|
||||
// Append payload if any
|
||||
@@ -302,35 +308,6 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
@@ -290,6 +296,18 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
|
||||
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
|
||||
|
||||
+ // Strip the protocol from the authority if it exists.
|
||||
+ const normalizeAuthority = (authority: string): string => authority.replace(/^https?:\/\//, "");
|
||||
+ if (config.remoteAuthority) {
|
||||
+ (config as any).remoteAuthority = normalizeAuthority(config.remoteAuthority);
|
||||
+ }
|
||||
+ if (config.workspaceUri) {
|
||||
+ config.workspaceUri.authority = normalizeAuthority(config.workspaceUri.authority);
|
||||
+ }
|
||||
+ if (config.folderUri) {
|
||||
+ config.folderUri.authority = normalizeAuthority(config.folderUri.authority);
|
||||
+ }
|
||||
+
|
||||
// Revive static extension locations
|
||||
if (Array.isArray(config.staticExtensions)) {
|
||||
config.staticExtensions.forEach(extension => {
|
||||
@@ -302,35 +320,6 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
let workspace: IWorkspace;
|
||||
let payload = Object.create(null);
|
||||
|
||||
@@ -455,10 +512,10 @@ index eab8591492..26668701f7 100644
|
||||
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
|
||||
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
|
||||
new file mode 100644
|
||||
index 0000000000..4042e32f74
|
||||
index 0000000000..96fbd4b0bb
|
||||
--- /dev/null
|
||||
+++ b/src/vs/server/browser/client.ts
|
||||
@@ -0,0 +1,263 @@
|
||||
@@ -0,0 +1,270 @@
|
||||
+import { Emitter } from 'vs/base/common/event';
|
||||
+import { URI } from 'vs/base/common/uri';
|
||||
+import { localize } from 'vs/nls';
|
||||
@@ -477,6 +534,7 @@ index 0000000000..4042e32f74
|
||||
+import { LocalizationsService } from 'vs/workbench/services/localizations/electron-browser/localizationsService';
|
||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
+import { Options } from 'vs/server/ipc.d';
|
||||
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
+
|
||||
+class TelemetryService extends TelemetryChannelClient {
|
||||
+ public constructor(
|
||||
@@ -687,6 +745,12 @@ index 0000000000..4042e32f74
|
||||
+ };
|
||||
+
|
||||
+ updateLoop();
|
||||
+
|
||||
+ // This will be used to set the background color while VS Code loads.
|
||||
+ const theme = (services.get(IStorageService) as IStorageService).get("colorThemeData", StorageScope.GLOBAL);
|
||||
+ if (theme) {
|
||||
+ localStorage.setItem("colorThemeData", theme);
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+export interface Query {
|
||||
|
||||
@@ -16,9 +16,6 @@ main() {
|
||||
cd lib/vscode
|
||||
# Install VS Code dependencies.
|
||||
yarn
|
||||
|
||||
# NODE_MODULE_VERSION mismatch errors without this.
|
||||
npm rebuild
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Submodule lib/vscode updated: 78a4c91400...0ba0ca5295
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-server",
|
||||
"license": "MIT",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"scripts": {
|
||||
"clean": "ci/clean.sh",
|
||||
"vscode": "ci/vscode.sh",
|
||||
|
||||
@@ -100,4 +100,11 @@
|
||||
<script>
|
||||
require(["vs/code/browser/workbench/workbench"], function() {})
|
||||
</script>
|
||||
<script>
|
||||
try {
|
||||
document.body.style.background = JSON.parse(localStorage.getItem("colorThemeData")).colorMap["editor.background"]
|
||||
} catch (error) {
|
||||
// Oh well.
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -98,8 +98,8 @@ const options: Options<Required<Args>> = {
|
||||
version: { type: "boolean", short: "v", description: "Display version information." },
|
||||
_: { type: "string[]" },
|
||||
|
||||
"disable-ssh": { type: "boolean" },
|
||||
"ssh-host-key": { type: "string", path: true },
|
||||
"disable-ssh": { type: "boolean", description: "Disable the SSH server." },
|
||||
"ssh-host-key": { type: "string", path: true, description: "SSH server host key." },
|
||||
|
||||
"user-data-dir": { type: "string", path: true, description: "Path to the user data directory." },
|
||||
"extensions-dir": { type: "string", path: true, description: "Path to the extensions directory." },
|
||||
|
||||
@@ -14,24 +14,34 @@ import { SshProvider } from "./ssh/server"
|
||||
import { generateCertificate, generatePassword, generateSshHostKey, hash, open } from "./util"
|
||||
import { ipcMain, wrap } from "./wrapper"
|
||||
|
||||
const main = async (args: Args): Promise<void> => {
|
||||
const auth = args.auth || AuthType.Password
|
||||
const originalPassword = auth === AuthType.Password && (process.env.PASSWORD || (await generatePassword()))
|
||||
process.on("uncaughtException", (error) => {
|
||||
logger.error(`Uncaught exception: ${error.message}`)
|
||||
if (typeof error.stack !== "undefined") {
|
||||
logger.error(error.stack)
|
||||
}
|
||||
})
|
||||
|
||||
let commit: string | undefined
|
||||
let pkg: { version?: string; commit?: string } = {}
|
||||
try {
|
||||
commit = require("../../package.json").commit
|
||||
pkg = require("../../package.json")
|
||||
} catch (error) {
|
||||
logger.warn(error.message)
|
||||
}
|
||||
|
||||
const version = pkg.version || "development"
|
||||
const commit = pkg.commit || "development"
|
||||
|
||||
const main = async (args: Args): Promise<void> => {
|
||||
const auth = args.auth || AuthType.Password
|
||||
const originalPassword = auth === AuthType.Password && (process.env.PASSWORD || (await generatePassword()))
|
||||
|
||||
// Spawn the main HTTP server.
|
||||
const options = {
|
||||
auth,
|
||||
cert: args.cert ? args.cert.value : undefined,
|
||||
certKey: args["cert-key"],
|
||||
sshHostKey: args["ssh-host-key"],
|
||||
commit: commit || "development",
|
||||
commit,
|
||||
host: args.host || (args.auth === AuthType.Password && typeof args.cert !== "undefined" ? "0.0.0.0" : "localhost"),
|
||||
password: originalPassword ? hash(originalPassword) : undefined,
|
||||
port: typeof args.port !== "undefined" ? args.port : process.env.PORT ? parseInt(process.env.PORT, 10) : 8080,
|
||||
@@ -68,20 +78,9 @@ const main = async (args: Args): Promise<void> => {
|
||||
|
||||
ipcMain().onDispose(() => httpServer.dispose())
|
||||
|
||||
logger.info(`code-server ${require("../../package.json").version}`)
|
||||
|
||||
let sshPort = ""
|
||||
if (!args["disable-ssh"] && options.sshHostKey) {
|
||||
const sshProvider = httpServer.registerHttpProvider("/ssh", SshProvider, options.sshHostKey as string)
|
||||
try {
|
||||
sshPort = await sshProvider.listen()
|
||||
} catch (error) {
|
||||
logger.warn(`SSH server: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
logger.info(`code-server ${version} ${commit}`)
|
||||
const serverAddress = await httpServer.listen()
|
||||
logger.info(`Server listening on ${serverAddress}`)
|
||||
logger.info(`HTTP server listening on ${serverAddress}`)
|
||||
|
||||
if (auth === AuthType.Password && !process.env.PASSWORD) {
|
||||
logger.info(` - Password is ${originalPassword}`)
|
||||
@@ -105,19 +104,29 @@ const main = async (args: Args): Promise<void> => {
|
||||
logger.info(" - Not serving HTTPS")
|
||||
}
|
||||
|
||||
logger.info(` - Automatic updates are ${update.enabled ? "enabled" : "disabled"}`)
|
||||
logger.info(`Automatic updates are ${update.enabled ? "enabled" : "disabled"}`)
|
||||
|
||||
if (sshPort) {
|
||||
logger.info(` - SSH Server - Listening :${sshPort}`)
|
||||
let sshPort: number | undefined
|
||||
if (!args["disable-ssh"] && options.sshHostKey) {
|
||||
const sshProvider = httpServer.registerHttpProvider("/ssh", SshProvider, options.sshHostKey as string)
|
||||
try {
|
||||
sshPort = await sshProvider.listen()
|
||||
} catch (error) {
|
||||
logger.warn(`SSH server: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof sshPort !== "undefined") {
|
||||
logger.info(`SSH server listening on localhost:${sshPort}`)
|
||||
} else {
|
||||
logger.info(" - SSH Server - Disabled")
|
||||
logger.info("SSH server disabled")
|
||||
}
|
||||
|
||||
if (serverAddress && !options.socket && args.open) {
|
||||
// The web socket doesn't seem to work if browsing with 0.0.0.0.
|
||||
const openAddress = serverAddress.replace(/:\/\/0.0.0.0/, "://localhost")
|
||||
await open(openAddress).catch(console.error)
|
||||
logger.info(` - Opened ${openAddress}`)
|
||||
logger.info(`Opened ${openAddress}`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +141,7 @@ const tryParse = (): Args => {
|
||||
|
||||
const args = tryParse()
|
||||
if (args.help) {
|
||||
console.log("code-server", require("../../package.json").version)
|
||||
console.log("code-server", version, commit)
|
||||
console.log("")
|
||||
console.log(`Usage: code-server [options] [path]`)
|
||||
console.log("")
|
||||
@@ -141,14 +150,14 @@ if (args.help) {
|
||||
console.log("", description)
|
||||
})
|
||||
} else if (args.version) {
|
||||
const version = require("../../package.json").version
|
||||
if (args.json) {
|
||||
console.log({
|
||||
codeServer: version,
|
||||
commit,
|
||||
vscode: require("../../lib/vscode/package.json").version,
|
||||
})
|
||||
} else {
|
||||
console.log(version)
|
||||
console.log(version, commit)
|
||||
}
|
||||
process.exit(0)
|
||||
} else if (args["list-extensions"] || args["install-extension"] || args["uninstall-extension"]) {
|
||||
|
||||
@@ -24,11 +24,11 @@ export class SshProvider extends HttpProvider {
|
||||
})
|
||||
}
|
||||
|
||||
public async listen(): Promise<string> {
|
||||
public async listen(): Promise<number> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.sshServer.once("error", reject)
|
||||
this.sshServer.listen(() => {
|
||||
resolve(this.sshServer.address().port.toString())
|
||||
resolve(this.sshServer.address().port)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user