Commit Graph

65 Commits

Author SHA1 Message Date
Anmol Sethi bb5836ec61
Rename codercom/code-server to cdr/code-server 2019-05-02 11:25:50 -04:00
Asher cdb900aca8
Make preserveEnv return a new object
Modifying the object didn't feel quite right, plus this makes the code a
bit more compact.
2019-04-29 11:49:59 -05:00
Fedor Kalugin 1622fd4152 Preserve environment when forking shared process (#545) 2019-04-29 10:47:45 -05:00
Asher a3ac4567e3
Only output password if it was generated 2019-04-25 14:08:46 -05:00
John McCambridge 6b887dcc9c Fix no-auth to still use HTTPS, set default for no-auth to false (#573) 2019-04-23 16:38:49 -05:00
John McCambridge 41c7d98b7b Offer https/http url based on schema (#572)
* Let people know when telemetry is disabled, change url to https if secure connection

* Remove --no-auth as a http candidate

* Rename variable, change let to const
2019-04-23 16:38:34 -05:00
Kyle Carberry d073622629 Add --socket flag (#564)
* Add --socket flag

* Add msg for already bound socket
2019-04-22 12:47:27 -05:00
Asher 55bfeab208
Deprecate password flag in favor of an environment variable 2019-04-18 11:10:55 -05:00
Kyle Carberry 4d576ab4d4
Trigger configuration update when loaded 2019-04-17 21:01:23 -04:00
Kyle Carberry c3a38e3fea
Add telemetry and option to disable (#519)
* Add telemetry and option to disable

* Update readme and getting-started guide

* Update lockfile

* Update getting started guide
2019-04-17 17:18:35 -05:00
Asher cc8c7e2cee Make assets unique (#518)
* Make all assets unique

All CSS and JavaScript files have unique names now. I also moved the
login to the /login path in order to ensure the HTML for each page is
also unique.

* Explicitly include assets to cache
2019-04-17 17:18:20 -05:00
Asher 630ccfcacc Add flag to install an extension from the command line (#504) 2019-04-17 16:30:50 -05:00
Patrick Smith c4c26058ef Use port from PORT env variable if available (#502) 2019-04-17 16:30:39 -05:00
Asher aabb2ecda7
Update node to 10.15.1 (#472)
* Update Node to 10.15.1

* Remove string replace that was used for oclif

* Update nbin

* Package node-pty and spdlog with nbin

* Label stderr/stdout from shared process

* Remove fork override

* Prevent "already disposed" errors when trying to kill disposed proxies

* Include spdlog dependencies

* Shim /node_modules

* Add node_modules to Docker ignore

It keeps using my already-built .node files which results in a
mismatching GLIBC version error.

* Update nbin
2019-04-15 19:48:12 -05:00
Asher 7047be859c
Fix some open file/folder issues
- "Open folder" now says "open folder" instead of "open file"
- "Open folder" won't allow you to open files
- "Open file" won't allow you to open directories

Fixes #249.
2019-04-11 14:55:06 -05:00
Kyle Carberry 4af84fcaf6 Add flags for customizing user data dir and extensions dir (#420)
* Add flags for customizing extensions directory

* Update @coder/nbin
2019-04-03 17:07:47 -05:00
John McCambridge 217515344e Add port in use message (#418)
* Add clear error message if port is in use

* Add bold function for text/numbers

* remove unused dependency:

* remove unused line break

* Change logger message

* Use NodeJS.ErrnoException type

* Add back check for error code
2019-04-03 15:50:52 -05:00
Asher 3a672d725a Convert fully to protobuf (was partially JSON) (#402)
* Convert fully to protobuf (was partially JSON)

* Handle all floating promises

* Remove stringified proto from trace logging

It wasn't proving to be very useful.
2019-04-02 17:44:28 -05:00
Kyle Carberry 4eb5331ddc
Fixes #121 2019-03-27 10:36:32 -04:00
Kyle Carberry 3bb5c0bbe5
Fixes #351 2019-03-27 09:56:05 -04:00
Kyle Carberry 1697cc32a3
Use commander instead of oclif 2019-03-26 16:21:03 -04:00
Asher dc2253e718 Refactor evaluations (#285)
* Replace evaluations with proxies and messages

* Return proxies synchronously

Otherwise events can be lost.

* Ensure events cannot be missed

* Refactor remaining fills

* Use more up-to-date version of util

For callbackify.

* Wait for dispose to come back before removing

This prevents issues with the "done" event not always being the last
event fired. For example a socket might close and then end, but only
if the caller called end.

* Remove old node-pty tests

* Fix emitting events twice on duplex streams

* Preserve environment when spawning processes

* Throw a better error if the proxy doesn't exist

* Remove rimraf dependency from ide

* Update net.Server.listening

* Use exit event instead of killed

Doesn't look like killed is even a thing.

* Add response timeout to server

* Fix trash

* Require node-pty & spdlog after they get unpackaged

This fixes an error when running in the binary.

* Fix errors in down emitter preventing reconnecting

* Fix disposing proxies when nothing listens to "error" event

* Refactor event tests to use jest.fn()

* Reject proxy call when disconnected

Otherwise it'll wait for the timeout which is a waste of time since we
already know the connection is dead.

* Use nbin for binary packaging

* Remove additional module requires

* Attempt to remove require for local bootstrap-fork

* Externalize fsevents
2019-03-26 13:01:25 -05:00
Kyle Carberry 2169045377
Fix debugging 2019-03-19 12:53:05 -04:00
Asher f7c1ebf667
Fix moving data directory across devices 2019-03-12 15:45:44 -05:00
Asher ba37a34fa2
Create data directory path before moving old directory there 2019-03-12 15:05:47 -05:00
Asher e597d49912
Fix issues with configuration directories
- Move the old data directory if possible.
- Fix extension path to not use a hard-coded path and instead use the
  data directory.
- Create every part of the path during startup.
- Create each path when a connection is made as well in case they are
  deleted while the server is running.
- Create every part of the path before saving settings or writing a file
  using the resource endpoint.
2019-03-12 11:44:56 -05:00
Asher 0a9f5d8eee
Pass env as actual env instead of as a flag 2019-03-11 17:50:35 -05:00
Asher 736feaba51
Add proper version to --version 2019-03-11 17:38:11 -05:00
Forest Hoffman 30d14eeab4 Adhere to XDG base directory spec for dataDir and logDir (#156) 2019-03-09 09:11:30 -08:00
Asher 3d654a8df7
Resolve paths
Fixes #19.
2019-03-07 11:25:26 -06:00
Takayosi Amagi 87d2e22a6b Open localhost URL with --open (#28)
* Open localhost URL with --open

* Catch errors on opn

Co-Authored-By: fand <fand@users.noreply.github.com>
2019-03-07 09:23:54 -08:00
Michael Desantis e20b79b5cc Generate secure passwords, fixes issue #26 (#51) 2019-03-06 16:25:44 -08:00
Asher 994531d8bb
Add task for packaging release (#6)
* Add task for packaging release

* Modify package task to package a single binary

This is so it can be used as part of the build/release script.

* Package release as part of Travis deploy

* Set platform env var

* Add arch env var

* Make version available to the code

* Use tar for Linux and zip for Mac & Windows
2019-03-06 18:15:52 -06:00
Icebob 3fbdb2e46c Implement #4 - fix password via CLI (#5) 2019-03-06 00:08:43 -08:00
Asher 63f7c57b4e
Randomly generate password 2019-03-04 11:46:34 -06:00
Kyle Carberry e2ec010a1d
Add allow-http flag 2019-03-04 07:45:35 +00:00
Kyle Carberry 185c811354
Update default port to 8443 2019-03-01 16:55:31 -06:00
Kyle Carberry 06855adaa5
Create working directory if it doesn't exist 2019-03-01 10:33:16 -06:00
Kyle Carberry e8174095ca
Add windows support (#41)
* Add windows support

* Improve multi-platform support

* Install with network-concurrency 1

* Use file-glob to upload windows binary

* Don't install packages in parallel if on windows

* Rename vscode-remote to code-server

* Add output at intervals so CI doesn't kill build

* Update all tasks to provide timed output

* Don't perform tasks sync otherwise we can't log
2019-02-28 14:04:19 -06:00
Kyle Carberry be3f0c437f
Fixes browser app, adds no-auth (#38)
* Add no-auth flag

* Install packages for app dir
2019-02-26 16:03:42 -06:00
Kyle Carberry 0c2c957312 Fix readdir for root path (#35)
* Fix readdir for root path

* Fix merge of webpack conf

* Fix travis.yml to deploy on master

* Remove windows platform from travis.yml

* Enable caching

* mkdirpSync

* Fix build script
2019-02-25 16:29:34 -06:00
Asher eaea947318
Fix spdlog and node-pty in binary 2019-02-25 15:18:44 -06:00
Asher d9fc29fb0b
Pass data directory when forking with bootstrap 2019-02-22 16:31:21 -06:00
Asher 8b8bef015e
Add evaluation helpers (#33)
* Add evaluation helpers

* Make some helpers only available server-side

They don't make any sense on the client side.

* Fork the right thing
2019-02-22 15:56:29 -06:00
Kyle Carberry 73d6b77614
Externalize spdlog .node module 2019-02-21 19:32:08 -06:00
Kyle Carberry 85d2225e0c Featureful (#31)
* Fix loading within the CLI

* Remove app

* Remove promise handle

* Add initial travis file

* Add libxkbfile dependency

* Add libxkbfile-dev

* Add build script

* Fix malformed bash statement

* Remove yarn from script

* Improve build script

* Extract upx before usage

* Only run upx if on linux

* Ensure resource directory exists

* Pack runnable binary

* Export binary with platform

* Improve build process

* Install upx before running install script

* Update typescript version before running nexe

* Add os.release() function for multi-platform support

* Update travis.yml to improve deployment

* Add on CI

* Update to v1.31.0

* Add libsecret

* Update build target

* Skip cleanup

* Fix built-in extensions

* Add basics for apps

* Create custom DNS server

* Fix forking within CLI. Fixes TS language features

* Fix filename resolve

* Fix default extensions path

* Add custom dialog

* Store workspace path

* Remove outfiles

* Cleanup

* Always authed outside of CLI

* Use location.host for client

* Remove useless app interface

* Remove debug file for building wordlist

* Use chromes tcp host

* Update patch

* Build browser app before packaging

* Replace all css containing file:// URLs, fix webviews

* Fix save

* Fix mkdir
2019-02-21 11:55:42 -06:00
Asher 4a80bcb42c
Make everything use active evals (#30)
* Add trace log level

* Use active eval to implement spdlog

* Split server/client active eval interfaces

Since all properties are *not* valid on both sides

* +200% fire resistance

* Implement exec using active evaluations

* Fully implement child process streams

* Watch impl, move child_process back to explicitly adding events

Automatically forwarding all events might be the right move, but wanna
think/discuss it a bit more because it didn't come out very cleanly.

* Would you like some args with that callback?

* Implement the rest of child_process using active evals

* Rampant memory leaks

Emit "kill" to active evaluations when client disconnects in order to
kill processes. Most likely won't be the final solution.

* Resolve some minor issues with output panel

* Implement node-pty with active evals

* Provide clearTimeout to vm sandbox

* Implement socket with active evals

* Extract some callback logic

Also remove some eval interfaces, need to re-think those.

* Implement net.Server and remainder of net.Socket using active evals

* Implement dispose for active evaluations

* Use trace for express requests

* Handle sending buffers through evaluation events

* Make event logging a bit more clear

* Fix some errors due to us not actually instantiating until connect/listen

* is this a commit message?

* We can just create the evaluator in the ctor

Not sure what I was thinking.

* memory leak for you, memory leak for everyone

* it's a ternary now

* Don't dispose automatically on close or error

The code may or may not be disposable at that point.

* Handle parsing buffers on the client side as well

* Remove unused protobuf

* Remove TypedValue

* Remove unused forkProvider and test

* Improve dispose pattern for active evals

* Socket calls close after error; no need to bind both

* Improve comment

* Comment is no longer wishy washy due to explicit boolean

* Simplify check for sendHandle and options

* Replace _require with __non_webpack_require__

Webpack will then replace this with `require` which we then provide to
the vm sandbox.

* Provide path.parse

* Prevent original-fs from loading

* Start with a pid of -1

vscode immediately checks the PID to see if the debug process launch
correctly, but of course we don't get the pid synchronously.

* Pass arguments to bootstrap-fork

* Fully implement streams

Was causing errors because internally the stream would set this.writing
to true and it would never become false, so subsequent messages would
never send.

* Fix serializing errors and streams emitting errors multiple times

* Was emitting close to data

* Fix missing path for spawned processes

* Move evaluation onDispose call

Now it's accurate and runs when the active evaluation has actually
disposed.

* Fix promisifying fs.exists

* Fix some active eval callback issues

* Patch existsSync in debug adapter
2019-02-19 10:17:03 -06:00
Asher e4ff8e1c63
Set shared process log level 2019-02-07 13:50:43 -06:00
Asher 86d70ec790
Add constants file 2019-02-07 13:11:01 -06:00
Asher 499798fc17
Wrap shared process in retry 2019-02-06 18:11:31 -06:00