Compare commits

...

779 Commits

Author SHA1 Message Date
Anmol Sethi
e955da14fa Merge pull request #1628 from cdr/docs
Revamp docs
2020-05-17 19:46:57 -04:00
Anmol Sethi
52eeccaba1 v3.3.0 2020-05-17 18:35:36 -04:00
Anmol Sethi
3a1e3bc596 Final revisions for the docs before release
🚀
2020-05-17 17:55:28 -04:00
Anmol Sethi
e0dbd8f74a Rename self contained release to static release 2020-05-17 16:59:09 -04:00
Anmol Sethi
6a25b3bfa0 Document structure better
Closes #1648
2020-05-17 16:53:08 -04:00
Anmol Sethi
aee2599904 Push docker manifest in CI for multi arch image 2020-05-16 16:59:26 -04:00
Anmol Sethi
d56381666a Use .tar.gz for macOS releases
No good reason to use .zip, was just confusion on my part.
2020-05-16 10:01:26 -04:00
Anmol Sethi
611cde7202 Fix spelling of Multi-tenancy in FAQ 2020-05-14 22:33:13 -04:00
Anmol Sethi
181bad9563 Improve docker install formatting 2020-05-14 22:33:13 -04:00
Anmol Sethi
73b2ff0945 $PORT should always override port in --bind-addr 2020-05-14 22:33:12 -04:00
Anmol Sethi
89c5a4dfea Set --frozen-lockfile with yarn when necessary 2020-05-14 22:33:12 -04:00
Anmol Sethi
d4b3d21dce Require minimum node 12 2020-05-14 22:33:12 -04:00
Anmol Sethi
40778b15ca Add code-server version into VS Code about
Closes #1506
2020-05-14 22:33:12 -04:00
Anmol Sethi
d7234029e6 Use /usr/local instead of /opt in self contained release example 2020-05-14 20:27:36 -04:00
Anmol Sethi
10b06cae10 Minor typo fixes 2020-05-14 20:08:08 -04:00
Anmol Sethi
0bd2602774 3.3.0 2020-05-14 18:43:01 -04:00
Anmol Sethi
c69346a9a7 Add FAQ entry on the config file 2020-05-14 18:35:35 -04:00
Anmol Sethi
5651201643 Copy old macOS data directory if applicable 2020-05-14 06:12:33 -04:00
Anmol Sethi
f475767c2b Rename darwin releases to macos 2020-05-14 05:59:20 -04:00
Anmol Sethi
a0a77e379e Add doc/guide.md 2020-05-14 05:24:23 -04:00
Anmol Sethi
f4a78587b0 Make npm-postinstall.sh more robust 2020-05-13 22:44:43 -04:00
Anmol Sethi
b3ae4d67d3 Hide bundled node_modules to prevent them from being ignored 2020-05-13 04:17:34 -04:00
Anmol Sethi
d30f3dbdf7 Update to rc.10 2020-05-13 02:37:25 -04:00
Anmol Sethi
1739b21600 Bundle VS Code node_modules to avoid yarn dependency
Many random bizarre issues otherwise.

Also includes misc improvements to docs and scripts.
2020-05-13 02:35:11 -04:00
Anmol Sethi
a346c6d565 Document npm module install dependencies 2020-05-12 23:11:31 -04:00
Anmol Sethi
502c262c82 Mention update of versions in README install examples 2020-05-12 21:26:37 -04:00
Anmol Sethi
4aae5eaeca CI fixes
- Splits up test into fmt, lint and test
- Fixes bug in build-packages.sh
- Minor README.md fixes
2020-05-12 21:26:36 -04:00
Anmol Sethi
41d625abb6 Revamp README.md with new installation options 2020-05-12 21:26:36 -04:00
Anmol Sethi
8626bed4ef Merge pull request #1619 from cdr/config
Add support for a YAML config file
2020-05-12 21:25:44 -04:00
Anmol Sethi
dc632ac176 Remove .yarnrc from lib/vscode 2020-05-13 01:11:53 +00:00
Anmol Sethi
c0d6eb4664 Improve password handling
- Error out if auth is enabled but no password is passed in
- Indicate password location on login page
2020-05-12 19:59:55 -04:00
Anmol Sethi
524b0205e9 Workaround for GH Actions ruining file permissions 2020-05-12 19:59:55 -04:00
Anmol Sethi
1e432b25ea Comment on hash(password) 2020-05-12 19:59:54 -04:00
Anmol Sethi
d6ea9d78f6 Configuration file bug fixes based on @code-asher's review 2020-05-12 19:59:54 -04:00
Anmol Sethi
28edf4af2e Add systemd user service to .deb and .rpm 2020-05-12 19:59:54 -04:00
Anmol Sethi
d288131a33 Fix lint errors 2020-05-12 19:59:54 -04:00
Anmol Sethi
e02d94ad2f Allow password authentication in the config file 2020-05-12 19:59:54 -04:00
Anmol Sethi
4f67f4e096 Disable automatic updates 2020-05-12 19:59:54 -04:00
Anmol Sethi
00d164b67f Add default config file and improve config/data directory detection 2020-05-12 19:59:54 -04:00
Anmol Sethi
c5179c2a06 Add support for a YAML config file 2020-05-12 19:59:53 -04:00
Asher
95ac0ddfb7 Fix paths for Windows
- Fix vscode-remote-resource, #1397.
- Fix double slash on webview, was causing images not to load.
- Fix client-side tar paths.
2020-05-12 13:49:37 -05:00
Anmol Sethi
2e31e8f0c9 Merge pull request #1623 from cdr/automate-release
Automate draft release
2020-05-11 21:00:10 -04:00
Anmol Sethi
169f8c67fe Automate draft release 2020-05-11 20:59:56 -04:00
Anmol Sethi
b706e85efb Merge pull request #1611 from cdr/ci
Automate release process
2020-05-08 16:46:23 -04:00
Anmol Sethi
7c7f62d3f3 Fixes for CI from @code-asher's review 2020-05-08 16:45:59 -04:00
Anmol Sethi
231e31656a Automate release process 2020-05-08 03:26:19 -04:00
Anmol Sethi
4590c3a3db Merge pull request #1607 from cdr/ci
Switch to GH Actions
2020-05-08 02:17:16 -04:00
Anmol Sethi
e9fe4c0466 Document release process 2020-05-08 01:43:31 -04:00
Anmol Sethi
6282cd7e7b Simplify packaging and improve scripts
Much better test now as well.
2020-05-08 01:04:24 -04:00
Anmol Sethi
bc453b5f0d Switch to a single job to build the npm package
The architecture specific jobs pull it in and then build releases.

Much faster!
2020-05-08 00:09:24 -04:00
Anmol Sethi
0ec1c69c06 Switch fully to GH Actions 2020-05-07 23:13:28 -04:00
Anmol Sethi
193a45113c Add back ARM with GH Actions 2020-05-07 00:17:06 -04:00
Anmol Sethi
3e7582880e Make CI faster 2020-05-06 23:15:30 -04:00
Anmol Sethi
c63f1ea62a Merge pull request #1601 from cdr/fixes
Add npm package and document/cleanup CI and build process
2020-05-06 20:53:26 -04:00
Anmol Sethi
1a375a44e0 Disable ARM64 releases as ARM on Travis is very unreliable 2020-05-06 20:32:11 -04:00
Anmol Sethi
be032cf735 Add NPM package, debs, rpms and refactor CI/build process
Closes many issues that I'll prune after adding more docs
for users.
2020-05-06 20:25:52 -04:00
Asher
4875f6aa87 Update VS Code to fix infinite refresh
Fixes #1581.
2020-05-05 12:33:09 -05:00
Asher
0a2f06b296 Update diff command in readme 2020-05-05 12:33:08 -05:00
Asher
6a2662eeee Remove node-pty
This was for the ssh server we removed.
2020-05-05 12:33:08 -05:00
Anmol Sethi
a64f80d2d4 Merge pull request #1602 from cdr/unset-pass
Unset $PASSWORD after grabbing it
2020-05-04 22:48:17 -04:00
Anmol Sethi
1898dea314 Unset $PASSWORD after grabbing it
Closes #1583
2020-05-04 22:41:21 -04:00
Asher
81411b2af9 Fix highlighted scmviewlet items in Firefox
Fixes #1549.
2020-05-01 12:54:48 -05:00
Anmol Sethi
c4b620d69e Merge pull request #1592 from saxc/fix-macOS
fix macOS spelling
2020-05-01 12:15:36 -04:00
saxc
c04befac68 fix macOS 2020-05-01 17:55:38 +02:00
Asher
fd36a99a4c Update vscode patch notes and bump version 2020-04-29 15:22:11 -05:00
Asher
4b09746c37 Merge pull request #1574 from cdr/transformer
Remove transformer file
2020-04-29 12:45:07 -05:00
Asher
870cf4f3fe Fix yarn.lock
Things got really out of whack when trying to update dependencies
earlier.
2020-04-29 12:39:42 -05:00
Asher
1ff35f177d Remove transformer file
Also remove some unused imports that were causing build errors (they
were left over from the fix that allowed installing any extension kind).
2020-04-29 12:13:44 -05:00
Asher
f3edb1cc5f Update node to latest lts (12.16.3) and update deps 2020-04-29 11:43:13 -05:00
Asher
86dc38e69f Allow extensions of any kind
This enables vscode-icons among others.
2020-04-28 17:57:56 -05:00
Asher
a2b69c8f3f Fix inconsistencies in log flags and env var
- Fix priority to match the commented behavior.
- Ignore bogus LOG_LEVEL values.
2020-04-28 17:57:55 -05:00
Asher
4cfd7c50ad Remove unused class
I managed to lose this deletion in a merge.
2020-04-28 17:57:54 -05:00
Anmol Sethi
a96606e589 Fix mention of host/port in docs 2020-04-28 18:29:25 -04:00
Anmol Sethi
30aefe19b5 Update issue template to mention check against regular VS Code 2020-04-28 14:50:08 -04:00
Anmol Sethi
37184f456c Merge pull request #1562 from cdr/bindaddr
Deprecate --host and --port in favour of --bind-addr
2020-04-28 14:33:38 -04:00
Anmol Sethi
05456024c4 Merge pull request #1561 from cdr/ratelimit
Add basic rate limiting to login endpoint
2020-04-28 14:33:18 -04:00
Anmol Sethi
5accf3fe5f Add basic rate limiting to login endpoint
Closes #1320
2020-04-28 14:21:08 -04:00
Anmol Sethi
2dd27b4cb8 gitignore release-upload 2020-04-28 14:19:25 -04:00
Anmol Sethi
af28885ea6 Deprecate --host and --port in favour of --bind-addr 2020-04-28 14:19:24 -04:00
Anmol Sethi
f21ba53609 Merge pull request #1563 from cdr/remove-ssh
Remove SSH server
2020-04-28 14:15:54 -04:00
Anmol Sethi
181e0ea6c8 Remove ssh2 dep 2020-04-28 14:04:56 -04:00
Asher
6074ca275b Fill out some missing browser environment values
Pass the user data dir to the browser environment service then derive
all the paths we can based off that path like the global storage path
which the vim extension uses to store history (otherwise it gets stored
in the working directory from when code-server was spawned).

Arguably the better solution is to use the userdata scheme but that
won't work because the vim extension ignores the VS Code API.

Fixes #1551.
2020-04-27 17:15:37 -05:00
Anmol Sethi
d0d5461a67 Remove SSH server
Closes #1502
2020-04-27 09:27:45 -04:00
Anmol Sethi
8608ae2f08 Merge pull request #1546 from cdr/readlink-mac
Fix code-server.sh script on macOS
2020-04-22 18:01:25 -04:00
Anmol Sethi
401f08db63 Fix code-server.sh script on macOS 2020-04-22 17:49:02 -04:00
Asher
caa299b60d Update VS Code to 1.44.2 2020-04-21 14:25:27 -05:00
Asher
dcde596002 Document debugging process
Closes #1465.
2020-04-20 18:55:14 -05:00
Asher
ee14db20f1 Allow data: in CSP for font-src
Closes #1530.
2020-04-20 18:10:07 -05:00
Asher
27ba64c7e4 Improve request error handling
See #1532 for more context.

- Errored JSON requests will get back the error in JSON instead of using
  the status text. This seems better to me because it seems more correct
  to utilize the response body over hijacking the status text. The
  caller is expecting JSON anyway. Worst of all I never actually set the
  status text like I thought I did so it wasn't working to begin with.
- Allow the update error to propagate for JSON update requests. It was
  caught to show the error inline instead of an error page when using
  the update page but for JSON requests it meant there was no error and
  no error code so it looked like it succeeded.
- Make errors for failed requests to GitHub less incomprehensible.
  Previously they would just be the code which is no context at all.
2020-04-17 15:16:10 -05:00
Anmol Sethi
c7753f2cf9 Update docker one liner to forward UID/GID
Closes #1425
2020-04-16 14:57:41 -04:00
Asher
974d4cb8fc Allow specifying a workspace on the command line
Fixes #1535.
2020-04-16 11:56:46 -05:00
Charles Moog
29b6115c77 Adds dev container and docs (#1499) 2020-04-14 17:22:52 -05:00
Asher
28e91ba70c Fix domain issues when setting the cookie
Fixes #1507.
2020-04-13 16:14:40 -05:00
Asher
5aded14b87 Merge pull request #1453 from cdr/proxy
HTTP proxy
2020-04-08 12:44:29 -05:00
Asher
a288351ad4 Respond when proxy errors
Otherwise the request will just hang.
2020-04-08 11:54:18 -05:00
Asher
3b39482420 Document workspace and folder behavior
Also fixed a type issue.
2020-04-07 17:49:50 -05:00
Asher
a5c35af81b Fix encoding issues with folder and workspace params
The raw value is now passed back to VS Code so it can do the parsing
with its own URI class rather than trying to parse using Node's url
module first since that has no guarantee of working the same way. It
also lets us keep the vscode-remote bit internal to VS Code.

Removed the logic that keeps trying paths until it finds a valid one
because it seems confusing to open a path and silently get some other
path instead of an error for the one you tried to open. Now it'll just
use exactly what you specified or fail trying.

Fixes #1488. The problem here was that url.parse was encoding the spaces
then the validation failed looking for a literal %20.
2020-04-07 15:18:19 -05:00
Charles Moog
b78bdaf46e Merge pull request #1496 from cdr/report-issue-url
Send report issues to code-server repo
2020-04-06 17:29:53 -05:00
cmoog
aefef5b0e8 Send report issues to code-server repo 2020-04-06 22:23:14 +00:00
Abin Simon
ca998240a0 Fix typo in FAQ (#1489) 2020-04-03 13:09:32 -05:00
Asher
d2a31477c7 Merge pull request #1486 from cdr/update-backup
Back up old directory when updating
2020-04-02 17:28:27 -05:00
Asher
9c6581273e Show proper error when an update fails 2020-04-02 17:20:25 -05:00
Asher
d1445a8135 Back up code-server directory when updating 2020-04-02 16:21:48 -05:00
Asher
5fc00acc39 Fix incorrect reporting that an update failed 2020-04-02 14:48:15 -05:00
Asher
363cdd02df Improve proxy documentation 2020-04-02 13:40:30 -05:00
Asher
a5d1d3b90e Move proxy logic into main HTTP server
This makes the code much more internally consistent (providers just
return payloads, include the proxy provider).
2020-04-02 13:40:29 -05:00
Asher
aaa6c279a1 Use Set for proxy domains 2020-04-02 13:40:28 -05:00
Asher
498becd11f Use route.fullPath when adding trailing slash
There's no need to specially construct the path.
2020-04-02 13:40:27 -05:00
Asher
411c61fb02 Create helper for determining if route is the root 2020-04-02 13:40:26 -05:00
Asher
74a0bacdcf Rename hxxp to isHttp 2020-04-02 13:40:25 -05:00
Asher
e7e7b0ffb7 Fix redirects through subpath proxy 2020-04-02 13:40:25 -05:00
Asher
fd339a7433 Include query parameters when proxying 2020-04-02 13:40:24 -05:00
Asher
561b6343c8 Ensure a trailing slash on subpath proxy 2020-04-02 13:40:23 -05:00
Asher
e68d72c4d6 Add documentation for proxying 2020-04-02 13:40:22 -05:00
Asher
737a8f5965 Catch proxy errors
Otherwise they'll crash code-server.
2020-04-02 13:40:21 -05:00
Asher
c0dd29c591 Fix domains with ports & localhost subdomains 2020-04-02 13:40:20 -05:00
Asher
8aa5675ba2 Implement the actual proxy 2020-04-02 13:40:19 -05:00
Asher
2086648c87 Only handle exact domain matches
This simplifies the logic a bit.
2020-04-02 13:40:18 -05:00
Asher
3a98d856a5 Handle authentication with proxy
The cookie will be set for the proxy domain so it'll work for all of its
subdomains.
2020-04-02 13:40:17 -05:00
Asher
90fd1f7dd1 Add proxy provider
It'll be able to handle /proxy requests as well as subdomains.
2020-04-02 13:40:16 -05:00
Asher
77ad73d579 Set domain on cookie
This allows it to be used in subdomains.
2020-04-02 13:40:15 -05:00
Asher
13534fa0c0 Add proxy-domain flag
This will be used for proxying ports.
2020-04-02 13:40:14 -05:00
Asher
37299abcc9 Minor startup code improvements
- Add type to HTTP options.
- Fix certificate message always saying it was generated.
- Dedent output not directly related to the HTTP server.
- Remove unnecessary comma.
2020-04-02 13:40:13 -05:00
Asher
e480f6527e Update VS Code to 1.43.2 2020-04-01 15:27:28 -05:00
Asher
26584f2060 Strip protocol from remote authority
In Google cloud shell the host header is 127.0.0.1:8080 instead of the
actual URL. This is what we write out to the HTML so VS Code can pick it
up. However cloud shell rewrites this string when found in the HTML
before serving it so it becomes https://8080-[...].appspot.com,
resulting in an extra unexpected https:// in the
URI (vscode-remote://https://8080[...]). The resulting malformed URI
causes the extension host to exit.

- Fixes #1471
- Fixes #1468
- Fixes #1440 (most likely).
2020-04-01 13:41:05 -05:00
Asher
a4c0fd1fdc Run ssh server listen after http
That way if they happen to conflict code-server doesn't crash.
2020-03-30 17:43:11 -05:00
Asher
6c104c016e Prevent exiting when an exception is uncaught 2020-03-30 17:43:10 -05:00
Asher
599670136d Output commit along with the version 2020-03-30 17:43:09 -05:00
Asher
ce637d318d Add descriptions to SSH flags 2020-03-30 17:43:08 -05:00
Anmol Sethi
d8654b5a19 Merge pull request #1460 from mjgallag/peg-yarn-version
Peg yarn version to ensure deterministic builds
2020-03-30 01:52:14 -04:00
Michael Gallagher
12c3ccd6c7 Peg yarn version to ensure deterministic builds
"Yarn is fully deterministic as long as all your teammates are using the same Yarn version." (https://classic.yarnpkg.com/blog/2017/05/31/determinism/)
2020-03-28 14:29:04 -07:00
Asher
7954656610 Set background color using VS Code theme 2020-03-27 16:58:50 -05:00
Asher
87ebf03eb7 Skip vscode dependencies for test phase
They aren't used so we can skip them.
2020-03-27 13:40:42 -05:00
Asher
df1c34e291 Overwrite GitHub releases again
I was under the impression this was causing existing releases to become
drafts again but that happens without this flag.
2020-03-27 12:03:01 -05:00
Asher
4a65b58772 Fix arm builds 2020-03-27 12:02:56 -05:00
Asher
11fdb8854b Skip unused dependencies 2020-03-26 15:12:17 -05:00
Asher
0a92bb1607 Fix node version mismatch 2020-03-26 13:54:41 -05:00
Asher
5bac2cbdb8 Add build test 2020-03-26 13:54:40 -05:00
Asher
511c3e95b2 Remove npm rebuild 2020-03-25 17:07:26 -05:00
Asher
0a5687bacf Fix crash when unable to request an update 2020-03-25 15:00:35 -05:00
Asher
27320465b7 Merge pull request #1443 from maksimr/fix-duplication
Remove duplication in dependencies
2020-03-25 14:13:34 -05:00
Asher
6df454e006 Merge pull request #1445 from maksimr/fix-doc
Fix documentation for build process
2020-03-25 14:13:15 -05:00
Asher
216652fb31 Merge pull request #1446 from maksimr/fix-apple-touch-icon
Returns back apple touch icon
2020-03-25 14:12:44 -05:00
Asher
0f066d30b4 Add data-cfasync="false" to script tags
This prevents Cloudflare's Rocket Loader from acting on them.

Fixes #1451.
2020-03-25 14:04:36 -05:00
Asher
d1687c1533 Catch error when SSH server fails to start 2020-03-24 17:38:46 -05:00
Asher
f5f29c0120 Set GitHub token when installing VS Code deps
Should help with the ripgrep ratelimit issues.
2020-03-24 16:05:07 -05:00
Maksim Ryzhikov
8a6faa39c9 Remove duplication in dependencies 2020-03-24 09:43:14 +03:00
Maksim Ryzhikov
5887c1d339 Returns back apple touch icon 2020-03-23 14:44:31 +03:00
Maksim Ryzhikov
664ef17af8 Fix documentation for build process 2020-03-23 12:26:54 +03:00
Anmol Sethi
004004c047 Merge pull request #1432 from onilton/patch-1
Add link to contributing
2020-03-19 20:47:10 -04:00
Onilton Maciel
09db0ffad5 Add link to contributing 2020-03-19 18:53:31 -03:00
Asher
a349ea8ff9 Merge pull request #1421 from cdr/dependabot/npm_and_yarn/acorn-5.7.4
Bump acorn from 5.7.3 to 5.7.4
2020-03-19 13:17:37 -05:00
Asher
cfebf2c67f Removed unused CSS 2020-03-17 10:36:19 -05:00
dependabot[bot]
ddd44999c6 Bump acorn from 5.7.3 to 5.7.4
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-16 22:34:51 +00:00
Asher
89d78a5921 Encode query params from open dialog
Fixes #1424.
2020-03-16 15:19:06 -05:00
Asher
99dd2db97c Remove open in desktop button 2020-03-16 15:14:55 -05:00
Asher
b52fbb4cb9 Catch error when openssl isn't installed 2020-03-16 15:14:54 -05:00
Will O'Beirne
3463d56114 SSH server & endpoint 2020-03-16 15:14:53 -05:00
Asher
5f63d2b822 Fix custom socket path 2020-03-16 15:14:52 -05:00
Asher
db4a4f0f50 Don't ignore scripts for code-server prod yarn 2020-03-16 15:14:51 -05:00
Asher
d192726e80 Simplify dashboard 2020-03-16 15:14:50 -05:00
Asher
d832f61d5b Make client-side extensions work at any base 2020-03-16 12:04:09 -05:00
Asher
88f4b986c5 Remove our env vars from the shell
This enables developing code-server in code-server.
2020-03-16 11:01:46 -05:00
Asher
aeb6261189 Update VS Code to 1.43.0 2020-03-13 17:42:10 -05:00
Asher
6cb228037b Add base path to update endpoint from VS Code
This will make it work regardless of what the current URL happens to be.

Also move the telemetry setting into the options since we might as well
make use of it seeing as how we have to parse it for the base path
anyway.
2020-03-13 16:44:56 -05:00
Asher
a00fa85d77 Qualify extensions in help output as VS Code extensions
Also add a description for uninstall-extension and force.
2020-03-13 13:23:30 -05:00
Asher
57de78e12a Add show-versions flag and add help for list-extensions
Closes #1417.
2020-03-13 13:17:59 -05:00
Asher
2342443368 Set telemetry setting based on disable-telemetry flag
By design the disable-telemetry flag does not affect extension
telemetry, only the setting does, so disabling the setting when the flag
is set should cause extensions to also stop sending telemetry.

Fixes #1116.
2020-03-13 12:36:57 -05:00
Asher
26647c54c9 Restore old folder query parameter behavior
Fixes #1351.
2020-03-11 16:06:32 -05:00
Asher
253cf1c438 Remove unnecessary return types 2020-03-11 16:06:32 -05:00
Anmol Sethi
f6a5eaa965 Merge pull request #1406 from allanbowe/patch-1
chore: update README link (as no longer redirects)
2020-03-09 22:04:23 -04:00
Allan Bowe
f83a57a010 chore: update README link (as no longer redirects) 2020-03-09 20:40:41 +01:00
Anmol Sethi
92cec80b0e Merge pull request #1400 from zuchka/patch-1
verb agreement typo in FAQ
2020-03-07 22:10:21 -05:00
Anmol Sethi
1f601f27a2 Merge pull request #1399 from SuperSandro2000/docker
Optimize release Docker Image
2020-03-07 21:04:30 -05:00
Matt Abrams
71f1291623 verb agreement typo in FAQ
dear owners,

this is a simple copy-editing pull request. The issue regards verb-agreement. Thank you for your time,
best,

Dr. Matthew Jeffrey Abrams
2020-03-06 20:29:09 -05:00
Sandro Jäckel
9b07078b47 Combine two RUNs 2020-03-07 00:06:42 +01:00
Sandro Jäckel
8433a3d081 Combine all apt-get commands to really delete the cache from all layers 2020-03-07 00:00:58 +01:00
Asher
c8269fb54d Add exec to startup script
Removes an extra process. See #1388.
2020-03-06 10:31:16 -06:00
Asher
0b9a478289 Add connection type to websocket query parameters
This allows external services to distinguish between them.
2020-03-05 15:49:37 -06:00
Asher
c7e6e58387 Output newlines in CI immediately
Perhaps this is causing the output buffering issue with the arm builds.
2020-03-05 11:39:08 -06:00
Asher
8c515029fd Don't overwrite releases
This makes them drafts again which is not what I wanted.
2020-03-05 11:18:05 -06:00
Asher
1f6ff2f763 Show --install-extension in help menu
Also add --force so extensions can be updated without prompts.

Closes #1392.
2020-03-05 10:42:49 -06:00
Asher
04542c99fd Resolve passed-in directory
Makes relative paths work correctly.
2020-03-05 10:38:13 -06:00
Asher
8c47ba255a Preserve current working directory
Fixes #1388.
2020-03-05 10:26:14 -06:00
Asher
4e6f6bc2cc Fix .zip uploading to gcs as .tar.gz 2020-03-04 16:52:28 -06:00
Asher
7c65a54fcf Overwrite releases 2020-03-04 16:41:05 -06:00
Asher
1f43a673df Always build extensions on CI 2020-03-04 16:07:26 -06:00
Asher
744327ffd4 Update release dockerfile to use a symlink 2020-03-04 16:02:25 -06:00
Asher
a442d3e3f9 Make symlinking the entry script work 2020-03-04 15:22:32 -06:00
Asher
3e8a6f93a4 Build arm64 without travis_wait 2020-03-04 14:18:05 -06:00
Asher
308a84e6ec Fix centos image for arm64 2020-03-04 13:12:03 -06:00
Asher
cc139acfd1 Cache built-in extensions 2020-03-03 17:04:42 -06:00
Asher
32f8f481b6 Use Centos 7 for building
This will bring the libc requirements back down.
2020-03-03 16:19:51 -06:00
Asher
ec55ed39ee Fix json key decoding on Mac
It seems the short flag in MacOS is -D, not -d. The long flag is the
same. There are no other options with -d so I'm not sure why.
2020-03-03 16:01:22 -06:00
Asher
ee4b939efa Fix zip step for Darwin 2020-03-03 15:07:58 -06:00
Asher
538e8d8085 Store gcs key in Travis settings
Instead of encrypted in the repository.
2020-03-03 15:06:36 -06:00
Asher
2c4ca14d53 Merge pull request #1338 from cdr/restructure 2020-03-03 13:25:08 -06:00
Asher
8d934be6dc Elaborate what won't work over an insecure domain
Closes #997.
2020-03-03 13:10:32 -06:00
Kyle Carberry
c54450941c Update favicon 2020-03-03 02:25:53 +00:00
Asher
e0e019fbd5 Fix mime type for compressed client-side extensions
In Firefox using the gzip mime type will (probably correctly) cause it
not to decompress while in Chromium it still will (incorrectly).
2020-03-02 18:24:35 -06:00
Asher
77af2a5b0e Fix worker require paths when behind proxy 2020-03-02 18:04:27 -06:00
Asher
ecac0dd751 Handle unexpected string errors
Looks like sometimes VS Code throws strings. For example if ifconfig is
missing.
2020-03-02 17:22:23 -06:00
Asher
79b4c64a03 Add example gif 2020-03-02 15:13:39 -06:00
Asher
ccd01c49b9 Integrate update notifications into VS Code 2020-03-02 15:01:24 -06:00
Asher
069c5230cd Move VS Code to the root 2020-03-02 12:55:34 -06:00
Asher
c146457de4 Add recents section 2020-03-02 11:52:39 -06:00
Asher
88cab27165 Compress when sending client-side extension tars 2020-02-28 14:25:28 -06:00
Asher
a8914b025f Output code-server version on startup 2020-02-28 13:30:21 -06:00
Asher
0f87798ed6 Don't write bad password back out to input
Closes #1379.
2020-02-28 10:49:43 -06:00
Asher
963ebaca5b Register a service worker
To make installing as a PWA possible. Fixes #1181.
2020-02-27 16:37:00 -06:00
Kyle Carberry
eef2ed0e78 Update PWA icons 2020-02-27 20:43:31 +00:00
Asher
0e3720169f Add spacing between items
Also fix padding not being respected when blocks exceed container
height.
2020-02-27 12:58:40 -06:00
Asher
21cfeb9da0 Add the ability to kill running VS Code instance 2020-02-27 12:04:23 -06:00
Asher
fd65cadaea Upload into releases directory 2020-02-27 11:21:40 -06:00
Asher
70ad2354bb Remove gif link for now 2020-02-27 10:57:39 -06:00
Asher
01710cf6ff Update download instructions
We aren't providing binaries any longer.
2020-02-26 15:42:31 -06:00
Asher
b5c425b3a6 Major version -> 3.0.0 2020-02-26 15:09:56 -06:00
Asher
b00f6bf078 Improve error display when VS Code fails to load
Was looking a bit janky with the style changes.
2020-02-26 14:57:07 -06:00
Asher
a2639ac617 Add yarn vscode step to build instructions 2020-02-26 14:48:08 -06:00
Asher
07fcf1be7a Merge branch 'master' into restructure 2020-02-26 14:42:33 -06:00
Asher
75ca5b2b0b Add gcs upload to CI 2020-02-26 14:25:14 -06:00
Asher
082f25faf1 Add a note about external authentication
Closes #1369.
2020-02-26 14:25:13 -06:00
Asher
595ce6f5e3 Update styling
Just sort of winging it.
2020-02-26 14:25:12 -06:00
Anmol Sethi
b1760c8d29 Fix clean.sh 2020-02-25 21:30:58 -05:00
Asher
c870398c86 Switch to loose files
For #1306.
2020-02-25 18:23:35 -06:00
Asher
f76c809f7d Fix workspace storage creation
Fixes #1308.
2020-02-25 12:47:22 -06:00
Asher
4c6e4bedeb Fix port being randomized
Also make it a number.
2020-02-24 16:49:10 -06:00
Asher
04e449c546 Require cert-key with cert
Fixes #1312.
2020-02-24 15:01:59 -06:00
Anmol Sethi
c147711ade Remind user that generated password is in logs
Closes #446
2020-02-21 15:22:13 -05:00
Anmol Sethi
bd7583a254 Obey process.env.PORT 2020-02-21 14:49:58 -05:00
Asher
33b3523bf4 Prefer command-line directory to last visited directory
If you want to use the last visited directory you should omit the
directory from the command line.

Fixes #1132.
2020-02-21 12:45:57 -06:00
Asher
cf0f11105b Handle upgrade from binary to loose files
As best we can, anyway.
2020-02-21 12:32:58 -06:00
Anmol Sethi
9b7a203fe5 Make login page pretty 2020-02-20 20:08:25 -05:00
Asher
e44ac0a30e Use last positional argument as working directory
Instead of the first.
2020-02-20 18:48:17 -06:00
Asher
319cd3f7ab Make updating work for both binary and loose releases 2020-02-20 18:48:16 -06:00
Anmol Sethi
815dc06118 Use npm rebuild instead of yarn --no-scripts in vscode.sh 2020-02-20 19:11:01 -05:00
Anmol Sethi
3a2644a2bc Fix vscode.sh 2020-02-20 18:36:38 -05:00
Anmol Sethi
65690fca65 Fix CSP for Safari 2020-02-20 18:24:32 -05:00
Anmol Sethi
25288b1afd Cleanup FAQ and mention GPG/SSH forwarding 2020-02-20 17:45:04 -05:00
Asher
288e794c99 Update locale file location
Should make language packs work again.
2020-02-20 12:52:23 -06:00
Asher
c567a06ff5 Fix HTTPS redirects and TLS sockets
It still won't work behind a base path, but if you're using a reverse
proxy you can just redirect to HTTPS yourself. And should probably
handle TLS termination there too.

For sockets I just needed to add back the proxy call.
2020-02-19 17:59:12 -06:00
Asher
e5b68a8f4c Switch to new extensions API 2020-02-19 14:36:48 -06:00
Asher
51a5c77cb8 Add binary extraction
I temporarily removed this during the refactor so it needed to be added
back. This time I bundled it with the nbin loader code since it's all
related (will also make it easier to remove).
2020-02-19 14:15:01 -06:00
Anmol Sethi
b9e7a3daa7 Add back .editorconfig 2020-02-19 14:22:14 -05:00
Asher
80b2d9481f Don't display stack trace for cli parse failures
Just display the error message and exit. The stack trace isn't necessary
(since it's likely user error) and is potentially confusing.
2020-02-19 11:15:39 -06:00
Asher
0e2eaa9b34 Add valid values for --log 2020-02-19 11:11:29 -06:00
Asher
0263188431 Handle --long=value format in the cli parser 2020-02-19 10:54:23 -06:00
Anmol Sethi
fa30639784 Update issue template 2020-02-19 00:58:28 -05:00
Anmol Sethi
015b8dcf13 Merge branch 'ensure-release' into restructure 2020-02-19 00:28:21 -05:00
Anmol Sethi
9f3240346c Doc fixes 2020-02-19 00:27:02 -05:00
Anmol Sethi
b76364db31 Flesh out FAQ 2020-02-18 23:31:48 -05:00
Anmol Sethi
a065c12e83 CI Fixes 2020-02-18 23:31:40 -05:00
Anmol Sethi
76831f11fc Merge branch 'fix-ci' into restructure 2020-02-18 19:07:34 -05:00
Anmol Sethi
b6aa0cbcba Fix docs 2020-02-18 19:07:01 -05:00
Anmol Sethi
5681c87e33 Fix bugs in CI 2020-02-18 19:06:35 -05:00
Asher
46d6e17508 Prepare for release
- Add VS Code icon
- Trim dashboard to just display dedicated VS Code section
- Version was getting unset during build
- Add back nbin shim which I temporarily took out earlier
- Update tests for log level env var changes
2020-02-18 17:31:23 -06:00
Anmol Sethi
1aaa53622d Pass through travis tag in run.sh 2020-02-18 16:34:28 -05:00
Asher
bdb189a9bb Allow https images
Fixes extension icons not loading.
2020-02-18 14:57:12 -06:00
Asher
8793110941 Implement endpoint for getting recent directories 2020-02-18 14:13:22 -06:00
Asher
16bcf59cb0 Merge pull request #1357 2020-02-18 13:33:06 -06:00
Asher
f6b092b12d Merge branch 'restructure' 2020-02-18 13:30:37 -06:00
Asher
d47591e253 Inject base path into manifest
Might fix #1181, although not for the reasons I initially
thought (because the URLs are resolved from the manifest path, not the
path of the current page). This should ensure that the URLs used by the
manifest are always correct regardless of the manifest's path.
2020-02-18 13:01:18 -06:00
Anmol Sethi
1a91588c42 Add docker image pushing 2020-02-18 13:28:13 -05:00
Asher
39a57700bc Enable access to vscode cli 2020-02-18 12:24:12 -06:00
Anmol Sethi
1a54f6b7ef Merge remote-tracking branch 'origin/restructure' into anmol-restructure 2020-02-18 12:52:29 -05:00
Anmol Sethi
eb3cf303ad Add back travis since github actions is trash 2020-02-18 11:32:57 -05:00
Anmol Sethi
0d31a51eeb Add github release creation 2020-02-15 16:20:41 -05:00
Anmol Sethi
61d1af0413 Add macOS release step 2020-02-14 21:16:23 -05:00
Anmol Sethi
4aa15401c3 Format and lint 2020-02-14 20:00:19 -05:00
Anmol Sethi
80b1b1b672 Shake CI and docs up 2020-02-14 19:46:17 -05:00
Asher
0ec83f8736 Check updates daily instead of every time
Also add a way to force a check.
2020-02-14 16:46:22 -06:00
Asher
db54f78e8e Implement automatic updates 2020-02-14 15:58:39 -06:00
Asher
b8fa7da972 Simplify frontend
Just a login form and a list of applications. No modals or anything like
that.
2020-02-13 20:10:14 -06:00
Asher
bf1be16d11 Fix base path
Now it should work whether you have a trailing slash or not.
2020-02-13 12:41:58 -06:00
Asher
cc79edb312 Fix duplicate files opening with folder parameter
Reworked from d574012871 to fit in the
new structure.
2020-02-13 12:04:22 -06:00
Asher
ac4f2b8215 Update VS Code to 1.42.0 2020-02-13 11:55:15 -06:00
Asher
c8fc54bfb1 Update VS Code version for CI 2020-02-12 18:03:53 -06:00
Asher
d574012871 Fix duplicate files opening with folder parameter
When using a query parameter without a scheme, the scheme defaults to
`file`. This results in the files in the explorer being technically
different from the file picker files because they are file:// instead of
vscode-remote://, causing the same file to open twice and causing
numerous issues.

Normally the file explorer wouldn't even load at all in this case but we
provide a file service for file:// URLs as a failsafe for certain files
that wouldn't load correctly in the past. These files load fine now
using the vscode-remote scheme, so I'm also removing that service.

Related: #1351.
Fixes #1294.
2020-02-12 16:57:44 -06:00
Asher
250a54220c Update VS Code to 1.42.0 2020-02-12 14:31:34 -06:00
Asher
5baf16622f Fix VS Code product configuration not loading 2020-02-07 16:47:51 -06:00
Asher
256419004d Implement cli parser 2020-02-07 14:43:08 -06:00
Anmol Sethi
6a693e7181 Merge pull request #1346 from SuperSandro2000/patch-1
Dockerfile: Combine two runs
2020-02-06 16:10:50 -06:00
Sandro
b38cfa473e Dockerfile: Combine two runs 2020-02-06 23:05:40 +01:00
Asher
26f8216ec8 Un-nest a switch 2020-02-06 14:00:38 -06:00
Asher
63f3c04c57 Move user data directory logic out of patch 2020-02-06 13:12:00 -06:00
Asher
8a0f1d846e Move start path logic out of patch and fix it 2020-02-06 12:29:38 -06:00
Asher
efaeb3b110 Add hidden username field for accessibility 2020-02-06 10:26:53 -06:00
Asher
6cebfa469d Generalize initial app logic 2020-02-05 18:47:00 -06:00
Asher
205775ac97 Only serve HTML on specific index.html requests
Otherwise there is risk of an infinite loop through the iframe where the
fallback keeps loading the root HTML which itself has an iframe...
2020-02-05 17:45:24 -06:00
Asher
4cc181cedc Make routing base path agnostic 2020-02-05 17:38:21 -06:00
Asher
a149c5fc60 Pass arguments to code-server during watch 2020-02-05 14:48:15 -06:00
Asher
6e809b6a31 Handle when VS Code fails to load
This is mostly for development where VS Code might not have finished
compiling yet.
2020-02-05 14:23:42 -06:00
Asher
7c6fe56043 Add logo to background 2020-02-05 13:30:29 -06:00
Asher
8cc11d1688 Improve routing 2020-02-05 13:07:07 -06:00
Asher
dbc5c065f8 Improve HTTP provider registration 2020-02-04 16:55:27 -06:00
Asher
4a54e914fc Remove 32 bit arm builds from CI 2020-02-04 16:01:00 -06:00
Asher
b30aefcfb1 Add linting steps and improve testing steps 2020-02-04 15:42:55 -06:00
Asher
b29346ecdf Implement new structure 2020-02-04 14:31:44 -06:00
Anmol Sethi
ef8da3864f Merge pull request #1336 from cdr/revert-1334-patch-1
Revert "Decomission Travis"
2020-02-04 11:35:37 -06:00
Anmol Sethi
108eb297d8 Revert "Decomission Travis" 2020-02-04 11:35:19 -06:00
Anmol Sethi
19f3acd9f0 Merge pull request #1334 from sr229/patch-1
Decomission Travis
2020-02-04 11:35:12 -06:00
Dean Sheather
3ee6b0ff0b Automatically push releases to GCS (#1318) 2020-02-04 11:32:45 -06:00
Anmol Sethi
e270f7da1b Merge pull request #1335 from cdr/revert-1225-master
Revert "Updates manifest.json"
2020-02-04 11:30:14 -06:00
Anmol Sethi
e6117decd0 Revert "Set display property in manifest to fullscreen"
This reverts commit c7127cb248.
2020-02-04 11:30:00 -06:00
TheHllm
c7127cb248 Set display property in manifest to fullscreen 2020-02-04 11:23:21 -06:00
Ben Potter
50234e5f04 Reflects new location of vscodeVersion (#1327) 2020-02-04 11:10:32 -06:00
Ayane Satomi
5f562dc113 Decomission Travis
We won't need Travis from now on since it's only purpose is to do Mac builds, which no one uses anymore.
2020-02-04 20:43:54 +08:00
Anmol Sethi
bb8bad49dc Remvoe question issue template
Closes #1331
2020-02-03 11:35:18 -06:00
Anmol Sethi
a674d882bf Remove buggy -v flag from README.md docker run
Closes #1270

Will describe in FAQ how to keep state.
2020-01-27 12:17:59 -06:00
Asher
f51e045cd5 Use the nbin centos container to build again
This will put the glibc requirement back down to what it used to be.
2020-01-17 16:27:36 -06:00
Asher
8122b7f69e Remove unused upload service
No longer needed since VS Code has their own now.
2020-01-17 12:23:36 -06:00
Asher
25f18beda4 Fix version test 2020-01-16 18:09:19 -06:00
Asher
7e7923706f Fix version generated from Git tag 2020-01-16 17:59:11 -06:00
Asher
ae35673489 Use custom Yarn cache directory
Makes it easier to upload and restore.
2020-01-16 15:39:44 -06:00
Asher
23f142fdc6 Cache Yarn cache 2020-01-16 15:23:25 -06:00
Asher
101139fabf Fix Drone CI releases
Also skip the 32 bit arm releases since they don't currently build
anyway.
2020-01-16 14:53:59 -06:00
Asher
e2d354c8f2 Move manifest icon to the root as well 2020-01-16 12:11:56 -06:00
Asher
7c178805ea Add comment about the manifest's served location
Also for #1278.
2020-01-16 11:44:17 -06:00
Asher
45f70e741f Move manifest to the root
Fixes #1278.
2020-01-16 11:36:17 -06:00
Asher
1474a82c7d Add insecure access notification 2020-01-16 11:15:22 -06:00
Asher
d97feca3ba Add code-server version to the about dialog 2020-01-15 18:02:19 -06:00
Asher
b2669e78bf Implement ExtHostStoragePaths for the browser
This appears to make vscodevim work again.
2020-01-15 17:13:06 -06:00
Asher
66ee6e8201 Ignore 32 bit arm failures for now
Seems we are running out of memory.
2020-01-15 13:48:27 -06:00
Asher
62f050fda7 Add a simple test 2020-01-15 13:22:45 -06:00
Asher
57425377e5 Use CI dockerfile for pushing Docker image 2020-01-15 13:22:45 -06:00
Asher
174cb2f8a9 Remove unused Docker step from CI script 2020-01-15 13:22:42 -06:00
Asher
42bddce21f Add defaults for environment variables
So we don't have to keep setting them for each CI and every single step
since there doesn't seem to be a way to share them between steps in
Drone.
2020-01-15 13:21:58 -06:00
Asher
f2a15795a1 Use draft releases for Drone
This gives us a chance to review it and add notes.
2020-01-15 13:21:58 -06:00
Asher
6dd5e515c5 Travis release on tags only and remove Docker push
The manual tagging is necessary to sync up the releases of the two
different CIs.
2020-01-15 13:21:55 -06:00
Asher
92da02ef3e Add Drone CI caching 2020-01-15 13:20:58 -06:00
Ayane Satomi
3ce7129492 Drone CI migration (#1261) 2020-01-15 13:14:05 -06:00
Asher
336ee28888 Update Node to 12.14.0 2020-01-08 16:30:44 -06:00
Asher
3f2240ab65 Update logger 2020-01-08 16:30:34 -06:00
Asher
1087037728 Don't push latest and v2 Docker tags automatically
We should only push those when the version is confirmed to work.
2020-01-08 15:05:12 -06:00
Asher
1959d82912 Increase cache timeout
The Mac build seems to be terminated due to a timeout during the caching
stage.
2020-01-08 13:20:50 -06:00
Asher
8024144381 Update VS Code to 1.41.1 2020-01-07 18:27:41 -06:00
Asher
6a1dcab7a6 Update nbin
Should finally be able to build with Node v12 now.
2020-01-07 18:27:28 -06:00
Asher
e6d1f2a7c8 Update VS Code to 1.41.0 2019-12-16 16:52:29 -06:00
Asher
44c4722edf Fix data directory path in Dockerfile 2019-12-10 12:06:52 -06:00
Asher
e5fc63f2c8 Fix accessing manifest behind basic auth
Apparently the manifest spec doesn't include sending credentials in an
attempt to be secure by default.

Fixes #1212.
2019-12-09 11:25:59 -06:00
Asher
015a99e87d Always install VS Code dependencies
This fixes the case where the script is killed before all the
dependencies were fully installed.
2019-12-09 10:55:24 -06:00
Simen Eriksen
884491d72b Update Dockerfile to fix EACCES issue on mount (#1191)
https://github.com/cdr/code-server/issues/1188 
Fixes issue with permissions mounting in directories in the container. Folders are generated by root causing issues when the container user "coder" wants to create sub-folders. This fix solves it, at least on Crostini (ChromeOS)
2019-12-05 13:38:03 -06:00
Asher
e14362f322 Pass along Node options 2019-11-14 17:20:23 -06:00
Asher
917aa48072 Update enterprise link
Fixes #1172.
2019-11-14 11:16:08 -06:00
Asher
938c6ef829 Update fail2ban configuration
Fixes #1177.
2019-11-14 11:14:27 -06:00
Sandro
0add01d383 Delete apt lists from final image (#1174) 2019-11-14 11:12:21 -06:00
Asher
2018024810 Hash password
Fixes issues with unexpected characters breaking things when setting the
cookie (like semicolons).

This change as-is does not affect the security of code-server
itself (we've just replaced the static password with a static hash) but
if we were to add a salt in the future it would let us invalidate keys
by rehashing with a new salt which could be handy.
2019-11-07 15:57:57 -06:00
Asher
a1d6bcb8e5 Handle cookies more robustly
If you visit /login/ instead of /login the cookie will be set at /login
instead of / which means the cookie can't be read at the root. It will
redirect to the login page which *can* read the cookie at /login and
redirect back resulting in an infinite loop.

The previous solution relied on setting the cookie at / (any invalid
value works) which then overrode the login page cookie since
parseCookies only kept a single value. So the login page would see the
same cookie the root was seeing and not redirect back. However, that
behavior depends on the cookies being in the right order which I'm not
sure is guaranteed.

This new method tests all available cookies and always sets the cookie
so the root path will be able to read it in case the login page is
seeing a cookie the root can't.

It also goes a step further and explicitly sets the path on the cookie
which fixes the case where there is a permanent misconfiguration
redirecting /login to /login/. Otherwise the cookie would continually be
set on /login only and you'd have another loop. It also means you only
need to delete one cookie to log out.

Lastly add some properties to make the cookies a bit more secure.
2019-11-07 13:36:18 -06:00
ecrode
727ac6483b Clear password when redirecting to login
Should prevent endless redirects when the cookie is set on a different path or domain (like with a dot prefix).
2019-11-07 11:38:10 -06:00
Asher
2c15c09fc0 Add missing telemetry option 2019-11-06 15:47:34 -06:00
Asher
2ad2582cc0 Minor readme updates and fixes 2019-11-05 13:49:18 -06:00
Asher
cee0ac213c Fix error activating extensions on insecure domains
Doesn't affect Firefox but it does affect other browsers.

Fixes #1136.
2019-11-04 17:10:00 -06:00
Asher
780a673017 Add meta tag to allow full screen app on iOS
Fixes #933.
2019-11-04 16:01:01 -06:00
Asher
af71203955 Fix relaunching during an update 2019-11-01 10:51:23 -05:00
Asher
fc3acfabb2 Fix update check 2019-10-30 17:35:50 -05:00
Asher
3d5db8313a Add secure domain to requirements 2019-10-30 10:33:07 -05:00
Asher
73cf8f34e3 Fix outgoing scheme transformation
Accidentally used local instead of remote.

Fixes #1127.
2019-10-30 10:32:57 -05:00
dependabot[bot]
766efd6079 Bump mixin-deep from 1.3.1 to 1.3.2 (#1126)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 15:20:12 -05:00
Asher
87485948ad Kill inner process if parent process dies
Fixes #1076.
2019-10-29 14:43:27 -05:00
Asher
7e4a73ce2d Fix schema matching against vscode-remote
Fixes #1104.
2019-10-29 11:42:28 -05:00
Asher
2f0878d9b7 Revert remote scheme change
It doesn't show in the explorer anymore so there's no point. Also remove
the local scheme transform which is no longer required with the latest
client-side extension implementation.
2019-10-29 11:26:50 -05:00
Marc-André Daigneault
f65c9b23fc Add docker-compose file (#680) 2019-10-29 11:08:01 -05:00
Asher
cd859d117f Start pushing to latest Docker tag 2019-10-29 11:04:38 -05:00
Asher
e22964915a Support opening workspaces from command line
Partly addresses #1121.
2019-10-28 16:25:51 -05:00
Asher
197d0b6ca9 Strip internal env vars when spawning the shell
This should fix all those reports of code-server dropping straight to
Node and things like #1121.
2019-10-28 16:08:32 -05:00
Asher
422503ef98 Proxy child exit code when exiting parent process
This fixes code-server exiting with zero on errors.
2019-10-28 14:57:01 -05:00
Asher
ea36345d2c Allow fetching any resource
Fixes #1118.
2019-10-28 14:29:51 -05:00
Asher
a89d83cbba Fix other incorrect usages of split 2019-10-28 14:03:13 -05:00
Asher
83ff31b620 Fix passwords that contain =
Fixes #1119.

Apparently `split` does not work the way I'd expect.
2019-10-28 13:47:31 -05:00
Asher
3a9b032c72 Add heartbeat file (#1115)
Fixes #1050.
2019-10-28 09:59:34 -05:00
Asher
f73e9225b4 Remove directory restrictions for /webview/vscode-resource
This makes viewing images work. Fixes #1111.
2019-10-25 15:52:39 -05:00
Asher
168ccb0dfc Prevent cache changes when patch updates 2019-10-25 13:12:04 -05:00
Asher
58f7f5b769 Properly fix blank --cert flag
See #1109.
2019-10-25 12:04:43 -05:00
Asher
b8e6369fbe Fix empty --cert not generating self-signed certificate
Fixes #1101.
2019-10-25 11:01:42 -05:00
Asher
d81d5f499f Remove Cloud Run button
Unfortunately it doesn't allow websockets so it's not working.
2019-10-24 16:45:22 -05:00
Asher
4be178d234 Move Google Cloud button to match Digital Ocean 2019-10-24 16:09:02 -05:00
Ayane Satomi
9c40466b4b Add Google Cloud quick-launch button (#1069) 2019-10-24 16:07:44 -05:00
Asher
95693fb58e Handle /webview/vscode-resource/file urls
See #1103.
2019-10-24 14:35:25 -05:00
Asher
e7945bea94 Enable password authentication by default
Fixes #1062.
2019-10-24 12:35:26 -05:00
Asher
91f49e1efd Set SHELL to /bin/bash in Docker
Fixes #1081, fixes #918.
2019-10-23 13:34:00 -05:00
Asher
eea9c1618c Move client-side extension code out of patch 2019-10-23 13:12:11 -05:00
Asher
f1b38e4e48 Fix out-of-order readme section 2019-10-23 11:54:47 -05:00
Asher
ff99a1d768 Add security section to readme
See #1062.
2019-10-23 11:49:17 -05:00
Asher
7f07b8f66c Push Docker using Linux build
Instead of doing a separate redundant build. The main problem was that
the files weren't being cached. There is probably a better way of
solving this but this seems to be the simplest for now.
2019-10-22 18:43:21 -05:00
Asher
faae03da6b Add prerequisites for building 2019-10-22 17:49:43 -05:00
Asher
a6e4f96737 Fix webview html being excluded
Also skip the workbench html since we have our own.
2019-10-22 16:09:27 -05:00
Asher
cc7585bbc2 Port onigasm fix for PHP 2019-10-22 11:39:00 -05:00
Asher
14a0cd3ffd Remove build files in source
They aren't used in subsequent files and just slow down CI since it has
to extract from the cache and then package the changes.
2019-10-22 11:26:46 -05:00
Asher
3ff83eda45 Ensure VS Code dependencies and built-in extensions exist
Fixes #1087.
2019-10-22 10:49:00 -05:00
Asher
f133b00851 Fix darwin detection 2019-10-21 16:51:01 -05:00
Asher
ece840834d Move login page to browser directory
Fixes it not being included in the optimized build as well as making it
more consistent.
2019-10-21 15:02:41 -05:00
Asher
76f6ff4145 Fix alpine check 2019-10-21 14:09:04 -05:00
Asher
2458cde498 Update source & build paths in Dockerfile 2019-10-21 12:25:18 -05:00
Asher
82e2b8a169 Move source to its own directory
This matches how the rest of the build is organized but also hopefully
solves an issue where the VS Code directory is empty because we try to
cache it directly and Travis might be creating it.
2019-10-21 11:16:47 -05:00
Asher
5aa2abaf9f Cache VS Code in CI 2019-10-21 11:06:09 -05:00
Asher
fdb2308c62 Update path to built binary in Dockerfile 2019-10-21 10:56:27 -05:00
Asher
4cd2f2cd52 Simplify build and development steps 2019-10-18 19:10:55 -05:00
Asher
88cef85f62 Add dependencies required for running build script
They were getting pulled from VS Code which doesn't work if you are
running a build in a clean repo.
2019-10-18 18:40:10 -05:00
Asher
bdd11f741b Update to 1.39.2
Also too the opportunity to rewrite the build script since there was a
change in the build steps (mainly how the product JSON is inserted) and
to get the build changes out of the patch. It also no longer relies on
external caching (we'll want to do this within CI instead).
2019-10-18 18:20:02 -05:00
Asher
56ce780522 Prevent process.exit() 2019-10-11 17:00:17 -05:00
Asher
567010e163 Cache extension tar requests 2019-10-11 14:28:02 -05:00
Asher
4ae2c81157 Remember last workspace or directory 2019-10-11 14:26:20 -05:00
Asher
ae43e2016f Handle up/down on server 2019-10-10 17:05:30 -05:00
Asher
3f6cbfa4dd Handle up/down/close on client 2019-10-10 16:12:38 -05:00
Asher
1c50b5285e Resolve bundling issues with node-browser 2019-10-10 15:36:56 -05:00
Asher
ea9c511db8 Check major version when getting latest version 2019-10-08 16:23:39 -05:00
Adam Vernon
e1e3f32643 Add missing PWA icon (#1060)
- Copy old icon back into repository
- Update path to icon from manifest file
- Add link metadata tag for iOS PWA icon to workbench.html
- Add link metadata tag for iOS PWA icon to login page
2019-10-07 12:55:02 -05:00
Asher
4290cffe3b Update packages for in-browser extensions 2019-10-07 11:59:09 -05:00
Asher
548d095611 Add support for running extensions in the browser 2019-10-04 18:14:19 -05:00
Ayane Satomi
846dcbb947 [doc/quickstart] use version from GH-379 (#1012)
This is the same PR but with some fixes for v2.

Co-Authored-by: nwtnsqrd <30381446+nwtnsqrd@users.noreply.github.com>
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2019-09-30 11:19:46 -05:00
yeya24
d7d3368cc2 update yaml tag to v2 (#1034)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-09-30 10:30:33 -05:00
Kyle Carberry
134040fea3 Update extensions section of readme 2019-09-27 09:39:29 -05:00
Asher
65caa26d40 Pass log level to extension host 2019-09-23 16:57:48 -05:00
Asher
7812f6b75a Fix uncaught errors when extracting zips
Fixes #966.
2019-09-23 16:57:48 -05:00
Asher
637e58f255 Prevent opening invalid paths 2019-09-23 16:57:47 -05:00
Asher
6135630fc0 Fix not being able to change language while code-server is running
See #948. Only applies if code-server already tried to load a
language.
2019-09-23 16:57:46 -05:00
Ayane Satomi
22058c5f86 [README] add Requirements section (#1000)
* [README] add Requirements section

This is based user feedback and testing. This may expand if need be

Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>

* [README] raised the bar a bit more

Apparently we were targeting GLIBC 2.17

Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2019-09-18 13:21:38 -05:00
Asher
616bdb35f3 Fix using port zero 2019-09-18 11:39:16 -05:00
Asher
42f7b5d12b Still using the wrong tag for Docker 2019-09-17 15:25:17 -05:00
Asher
53818b0e36 Use conditional instead of inline if 2019-09-17 15:12:58 -05:00
Asher
6f08b13540 Fix 404 when logging into Docker 2019-09-17 14:59:01 -05:00
Asher
d36526b1c8 Move DOCKER_BUILD check into deploy script 2019-09-17 14:45:03 -05:00
Asher
1252eb6a8a Don't use a sequence for Docker deploy
Travis deploy scripts can't be sequences yet.
2019-09-17 14:39:21 -05:00
Asher
4733c31a2f Fix incorrect Docker tag 2019-09-17 14:21:23 -05:00
Asher
17c5173d8b Use --build-arg for GitHub token 2019-09-17 14:00:51 -05:00
Asher
d0a08f6dd7 Pass GITHUB_TOKEN through to Docker build
Also, back to drafts.
2019-09-17 13:42:14 -05:00
Asher
7b5d6d186b Fix some CI issues
- Don't error if trying to tag and the tag already exists.
- Add the build arguments to the Docker build.
- Set an environment variable for the Docker build rather than using
- the username because the username always exists (on master anyway).
2019-09-17 13:17:38 -05:00
Asher
3851927396 Push latest v2 Docker image as well 2019-09-17 12:31:40 -05:00
Asher
7eececead6 Use v2 tag for Docker example 2019-09-17 12:27:32 -05:00
Luca Casonato
b8c3d96fcd Auto docker building and deploy in travis CI (#521)
* made spacing for travis yaml consistent in file

* cleaned up .travis.yml and moved some code into a script

* checking if i can get travis to build this

* travis

* fixed an if statement

* fixed travis.yml file

* replaced my name with codercom
2019-09-17 11:55:05 -05:00
Asher
a2ee6c8e73 Don't build on tags 2019-09-17 11:26:59 -05:00
Asher
ef069d9b0e Update nbin
The latest version contains a fix for passing null options when reading
a file. Fixes #544.
2019-09-16 18:04:41 -05:00
Asher
6a864f9f47 Make websocket upgrade check case-insensitive
Fixes #925.
2019-09-16 15:05:45 -05:00
Asher
5c16399810 Fix accessing versioned resource using file service
Fixes #986.
2019-09-16 15:05:44 -05:00
Ayane Satomi
0141ded35d [doc/quickstart] add init docs (#981)
Add init docs so people have an idea what to do when starting up a service.

Resolves GH-947
2019-09-16 15:05:25 -05:00
Asher
bb46e80d44 Fix extensions that try to load from node_modules.asar
Should allow manual installation of bracket pair colorizer 2: #544.
2019-09-13 13:07:50 -05:00
Asher
1bd5eca73d Don't terminate extension host on a timeout
We will clean it up on our end if necessary. This allows reconnections
after any length of time.
2019-09-13 11:24:15 -05:00
Asher
48a97abe1d Fix Firefox scrolling
Fixes #976.
2019-09-13 10:42:59 -05:00
Asher
0ff8a11c7f Vsix upload should work 2019-09-13 10:22:07 -05:00
Asher
8b1cdaa4a1 Nbin is no longer a global dependency 2019-09-13 10:20:35 -05:00
Asher
0bbaa9763b Add back Digital Ocean button 2019-09-13 10:17:27 -05:00
Asher
dbe5f23e21 Fix Docker image not building
It seems to copy the entire directory to the second container for some
reason and runs out of space.
2019-09-12 17:24:59 -05:00
Asher
7353be413c Add missing VS Code version to git tag 2019-09-12 16:17:18 -05:00
Asher
398bc2ff41 Try travis_wait to fix long minify task in MacOS 2019-09-12 15:38:53 -05:00
Asher
ae1126d43f Target VS Code 1.38.1 2019-09-12 12:49:28 -05:00
Asher
46d16811b9 Add missing VS Code version to release tag & name 2019-09-12 12:18:20 -05:00
Asher
f8635a124f Add tar endpoint
This will be used to load extensions into the browser using requirefs.
2019-09-12 12:17:16 -05:00
Asher
c3c50e9a6a Merge pull request #857 from cdr/web
[v2] Rewrite code-server to use new web stuff
2019-09-12 11:59:19 -05:00
Ayane Satomi
cb0f9c58d2 re-add GH-969
I somehow deleted it during the conflict resolution

Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2019-09-13 00:51:29 +08:00
Ayane Satomi
8643bdc9d7 fix further conflicts in README.md
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2019-09-13 00:48:09 +08:00
Ayane Satomi
5b51999df7 resolve tree conflicts with master
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2019-09-13 00:46:29 +08:00
Ayane Satomi
64cc2895f3 [doc/self-hosted] make XFO same origin in docs (#970)
As reported in GH-962, this breaks VSCode's extension details view. Might need further triage if its also a v2 internal issue.
2019-09-12 10:27:22 -05:00
Ayane Satomi
51a82655a9 [README] Add volume flag for persisting configs (#969)
Fixes GH-965
2019-09-12 10:12:39 -05:00
Asher
0e1fed3c24 Make CI script work independently from your cwd 2019-09-10 11:29:48 -05:00
Asher
e9fce801a0 Make extension host reconnect 2019-09-09 18:44:17 -05:00
Asher
1164801376 Keep a maximum number of connections instead of a timeout
There's no way to actually know if those clients have gone away, so it
seems it might be better to base it on whether the user has connected
again with new clients to determine if the old clients are now invalid.
2019-09-09 16:41:04 -05:00
Asher
12e608468b Add caching 2019-09-06 17:46:32 -05:00
Dean Sheather
ed3e9d31f4 Merge pull request #916 from cdr/doc-rewrite
Rewrite and update documentation
2019-09-07 02:56:38 +10:00
Asher
44000459da Add environment variable for telemetry endpoint 2019-09-05 15:26:35 -05:00
Asher
9d8906d250 Add version format flag 2019-09-04 17:01:06 -05:00
Asher
a26844ea45 Add package.json for publishing API types 2019-09-04 11:47:50 -05:00
Asher
da7d8b04a8 Update VS Code 2019-09-03 17:24:14 -05:00
Asher
12bc26b6b4 Implement status bar API 2019-09-03 16:38:53 -05:00
Asher
976a326f47 Update nbin 2019-08-30 17:45:11 -05:00
Asher
b901043bfc Target a recent commit for VS Code
This is so we can try out the web worker extension host.
2019-08-29 19:11:11 -05:00
Asher
624a4c08b9 Minify Docker build 2019-08-28 17:04:58 -05:00
Asher
c9ce9ebb2e Fix spawns against Node
For example some code tries to run -e against the binary but that fails
since we inject our entry file every time the binary is invoked.

Fixes #932.
2019-08-28 16:40:29 -05:00
Asher
a3ee7c96a0 Don't open cwd by default
Fixes #889. Previous it would use the cwd. In some cases that's the
path of where the binary is located which is a weird place to open.
2019-08-27 14:26:54 -05:00
Asher
d33b2d2af9 Fix web view sometimes not loading correctly
Fixes #929.
2019-08-27 14:03:27 -05:00
Asher
830ccfe245 Fix toggling and hiding the menu bar 2019-08-23 14:54:39 -05:00
Asher
78b6b3afdf Add check for missing reconnection token
This means something is misconfigured.
2019-08-23 13:44:14 -05:00
Asher
c4fd725875 Fix built-in Typescript when bundled
Fixes #641.
2019-08-22 16:30:22 -05:00
Asher
4800ec6392 Fix playground when behind a proxy with a sub-path
It gets the web URL for the file yet uses the file service to load it,
so having a sub-path causes it not to be found on disk (the sub-path
obviously only means anything for the web server and isn't on disk).
2019-08-22 12:15:23 -05:00
Asher
3e2d12a224 Fix scrolling on Firefox 2019-08-22 11:33:58 -05:00
Asher
ddd5a9ae79 Update data and extension paths to match version one
To ensure users don't lose their extensions when updating.
2019-08-21 17:02:31 -05:00
Asher
950dad9489 Simplify getting the absolute path during build 2019-08-21 14:13:26 -05:00
Asher
c19223b7fe Fix error when building without first running yarn 2019-08-21 12:45:10 -05:00
Asher
80050d0d9d Detect target automatically
This removes the potential for a bad build because the native Node
modules currently can only be built on the target system, so specifying
a target for something other than the system your are building on will
not work.
2019-08-21 12:45:09 -05:00
Asher
c2be0ec71b Fix Firefox when using extensions that insert styles 2019-08-21 10:29:37 -05:00
Asher
ccc4f87ada Don't package for release if we don't need to 2019-08-20 19:46:39 -05:00
Asher
534600c1ff Don't error when scanning nonexistent extension dir 2019-08-20 19:16:44 -05:00
Dean Sheather
0f1bbc3161 Merge pull request #917 from paolomainardi/master
#914 - New helm chart for v1
2019-08-21 05:08:30 +10:00
Paolo Mainardi
615948c73f refs #914: Fix identation for args and vars 2019-08-20 15:00:59 +02:00
Asher
b9fc40409a Forward minify environment variable to Docker build 2019-08-19 17:17:38 -05:00
Asher
e53d6bce68 Forward GitHub token to docker build if it exists 2019-08-19 17:02:02 -05:00
Asher
ce3b7dfb1e Use readlink -f if realpath isn't available 2019-08-19 16:59:36 -05:00
Paolo Mainardi
19541c27ff refs #914: Helm chart 2019-08-19 22:18:17 +02:00
Dean Sheather
c94761f312 Documentation changes 2019-08-19 21:12:04 +10:00
Asher
b4e1a62cb4 Fix tasks
Fixes #898.
2019-08-16 15:06:59 -05:00
Dean Sheather
7caef7f49c Rewrite and update documentation 2019-08-17 05:46:37 +10:00
Asher
6737384d27 Handle existing query when opening folder 2019-08-15 17:28:02 -05:00
Asher
f61a0ae78a Set unexpected error handler on startup
Fixes #911.
2019-08-15 16:02:14 -05:00
Asher
d1662d7658 Ensure service workers are supported before use
Fixes #909.
2019-08-15 15:41:04 -05:00
Asher
72fe124e30 Fix loading resources in webviews
Fixes #901.
2019-08-15 15:40:02 -05:00
Asher
a48c2fb119 Handle webview service worker resource requests 2019-08-15 14:30:41 -05:00
Asher
07ec4ca63e Fix PHP syntax highlighting 2019-08-14 16:20:17 -05:00
Asher
83f86a45b6 Load language bundles on the client 2019-08-14 10:25:31 -05:00
Asher
45ad7f020a Update logger 2019-08-13 12:03:08 -05:00
Asher
2470081789 Exit when pipe closes
This allows piping to things like `head` without SIGPIPE errors.
2019-08-12 15:39:04 -05:00
Asher
c11d5fe9e6 Fix error when passing empty extra extension dir flag 2019-08-12 14:27:11 -05:00
Asher
90e8714e71 Preserve query variables when redirecting 2019-08-12 11:55:33 -05:00
Asher
5539519691 Remove extra slash when opening folder 2019-08-12 11:36:47 -05:00
Asher
b566b66590 Fix service worker scope when there is a base path 2019-08-12 11:24:05 -05:00
Asher
7389d9e2cb Use current URL for webview 2019-08-12 10:23:08 -05:00
Asher
1d61cbe536 Make release directory 2019-08-09 19:27:30 -05:00
Asher
2807ce495e Add tar-stream dependency
It's no longer included by the remote dependencies.
2019-08-09 19:23:44 -05:00
Asher
ba7285192c Update VS Code to 1.37.0 2019-08-09 19:23:41 -05:00
Asher
8c39e085f4 Use generic releases link for v2 message 2019-08-08 13:40:01 -05:00
Asher
b257c60636 Fix websocket defaulting to port 80 when authority has no port 2019-08-08 11:59:07 -05:00
Asher
6b579d65ef Fix webview address when using a proxy 2019-08-08 11:39:06 -05:00
Asher
d4ed2efa71 Change default port to 8080 2019-08-08 11:21:45 -05:00
Asher
3667b16cba Add link to v2 preview 2019-08-07 18:18:01 -05:00
Asher
2b3e8e1a89 Don't exclude .git for Docker
The build requires it to get the commit hash.
2019-08-07 16:39:31 -05:00
Asher
f5a6f14ade Implement update service 2019-08-07 16:18:17 -05:00
Asher
01a9ab332e Set commit based on code-server instead of VS Code
This ensures it'll be different for each build, otherwise it would also
be the same as long as the VS Code version is the same.
2019-08-07 15:13:39 -05:00
Dean Sheather
9d688e0894 Merge pull request #883 from cdr/digitalocean-button
Add DigitalOcean button to README
2019-08-06 12:41:43 +10:00
Dean Sheather
7d35144952 Add GitHub fonts to DigitalOcean button 2019-08-06 12:39:39 +10:00
Asher
7e794bd134 Fix favicon not being included in final build 2019-08-05 13:34:32 -05:00
Asher
dc333d4321 Fix extensions not being bundled into prebuilt 2019-08-05 13:05:09 -05:00
Asher
590f699687 Allow specifying the target
You still must build on the target system though because of the native
Node modules.
2019-08-05 11:03:47 -05:00
Asher
dde683d911 Fix login submission when using a base path 2019-08-05 10:38:55 -05:00
Asher
950bfce420 Add commit, date, and checksums to product.json 2019-08-02 20:29:48 -05:00
Asher
5b64cb3400 Fix login page 2019-08-02 19:54:56 -05:00
Asher
712274d912 Groundwork for language support
- Implement the localization service.
- Use the proper build process which generates the require JSON files.
- Implement getting the locale and language configuration.
2019-08-02 19:29:00 -05:00
Dean Sheather
bdd9d65146 Add DigitalOcean button to README 2019-08-02 14:08:33 +10:00
Asher
60ed0653bc Reformat readme intro 2019-07-31 17:22:19 -05:00
Asher
bce0cac48f Document recent VS Code patch changes 2019-07-31 17:22:18 -05:00
Asher
bd0f1d024b Support vscode-resource requests in webview 2019-07-31 17:22:18 -05:00
Asher
5944b842de Make it clearer what the tar code does 2019-07-31 17:22:17 -05:00
Asher
12af311ce7 Use our logger instead of raw console.log 2019-07-31 17:22:16 -05:00
Asher
62719ab544 Clean up client API
- Don't use "any" for the API type.
- Remove everything from the Coder API that can eventually be done
  through the VS Code API.
- Move the event emission to our own client to minimize patching.
2019-07-31 17:22:15 -05:00
Asher
0315b004a7 Add comment for the nbin shim 2019-07-31 17:22:14 -05:00
Asher
87be3ac235 Add comment explaining use of merge 2019-07-31 17:22:11 -05:00
Asher
011530e11b Proxy TLS sockets 2019-07-30 18:16:08 -05:00
Dean Sheather
4bfa686433 Merge pull request #876 from jhalek90/patch-1
update README.md
2019-07-29 09:00:39 +10:00
jhalek90
c67844d356 update README.md
Removed linked to coder.com/enterprise,(404)
replaced with link to coder.com
2019-07-28 10:35:52 -05:00
Asher
8ded89e8d4 Firefox fixes 2019-07-26 17:33:26 -05:00
Asher
4c4a179bce TLS socket still doesn't work 2019-07-26 17:26:45 -05:00
Asher
a4f21fb0d4 Install git during build 2019-07-24 11:23:00 -05:00
Asher
329acbb251 Combine main and webview servers 2019-07-23 19:22:10 -05:00
Asher
fd55139c82 Make flags additive and clean up docs
This means that you have to turn on features now instead of disabling
them like auth and https.

In addition:
- Allow multiple options for auth (only password for now).
- Combine the install docs since they had many commonalities and
- generally simplified them (hopefully not too much).
- Move all example configs into docs/examples.
2019-07-23 18:59:39 -05:00
Asher
7b7f5b542e Add base path argument
It's only used for the login redirect.
2019-07-23 15:17:25 -05:00
Asher
92daabc75c Open folder at base URL 2019-07-23 14:55:48 -05:00
Asher
068e07bd5d Clean up the patch 2019-07-23 13:27:30 -05:00
Asher
436ef7bd5c Fix VS Code version in readme and describe our changes 2019-07-22 18:01:46 -05:00
Asher
09cd1e8540 Make sub-paths work 2019-07-22 18:01:03 -05:00
Asher
cd54aec2f9 Fix login redirect when not using https 2019-07-22 11:09:26 -05:00
Kyle Carberry
078af59fd8 Replace demo image with GIF (#863) 2019-07-22 10:21:15 -05:00
Asher
36b8731cfe Add some missing development steps 2019-07-19 18:45:13 -05:00
Asher
9fdfacb314 Quality check 2019-07-19 17:43:54 -05:00
Asher
e8cb6ffaa0 Implement file uploads 2019-07-19 15:45:12 -05:00
Asher
2be452d83e Fix rg extraction in Docker build 2019-07-18 18:09:24 -05:00
Asher
b0e6c1cc4e Fix favicon 2019-07-18 18:09:23 -05:00
Asher
45d348b03d Expose API on the client 2019-07-18 18:09:22 -05:00
Asher
4b0cceb91a Extract ripgrep when inside binary 2019-07-18 18:09:21 -05:00
Asher
db41f106bc Fix open flag when using 0.0.0.0 2019-07-18 18:09:20 -05:00
Asher
b6fdb7d0e7 Telemetry 2019-07-18 18:09:20 -05:00
Asher
1a3fc86894 Reconnection works 2019-07-18 18:09:19 -05:00
Asher
83819cb3f9 Fix vscode-ripgrep rebuild error 2019-07-18 18:09:18 -05:00
Asher
feabfc86fa Fix different node binary warning 2019-07-18 18:09:17 -05:00
Asher
9b0b337dc0 Implement open flag 2019-07-18 18:09:16 -05:00
Asher
9446cc8245 Update Dockerfile 2019-07-18 18:09:15 -05:00
Asher
68c62087dc Fix opening snippets 2019-07-18 18:09:14 -05:00
Asher
8dcc1e3567 Accept argument to change initial working directory 2019-07-18 18:09:13 -05:00
Asher
e22791ec88 Fix interactive playground 2019-07-18 18:09:12 -05:00
Asher
286f9a8978 Implement multiple extension directories 2019-07-18 18:09:12 -05:00
Asher
97167e75ff Add authentication 2019-07-18 18:09:11 -05:00
Asher
2b2aa9a211 Add https server 2019-07-18 18:09:09 -05:00
Asher
81862d4fa1 Add back (most of) our old arguments
Also remove VS Code ones that don't work.
2019-07-18 18:08:38 -05:00
Asher
2fdf09e6e7 Include version when building 2019-07-18 18:08:37 -05:00
Asher
09e3cfd881 Create extension directory on startup 2019-07-18 18:08:37 -05:00
Asher
54ffd1d351 Make extension sidebar work 2019-07-18 18:08:36 -05:00
Asher
86e8ba12e7 Add gallery channel 2019-07-18 18:08:35 -05:00
Asher
f482087475 Implement webview server 2019-07-18 18:08:34 -05:00
Asher
fe1d609d1a Make it possible to request absolute paths 2019-07-18 18:08:33 -05:00
Asher
a20fa4a97a Implement extensions channel 2019-07-18 18:08:32 -05:00
Asher
f51751ad21 Replace jq with some JavaScript 2019-07-18 18:08:31 -05:00
Asher
197d8dba93 Need to run yarn compile once
To build the extensions for development.
2019-07-18 18:08:30 -05:00
Asher
3ca90a5f89 Use nbin in forked processes 2019-07-18 18:08:30 -05:00
Asher
6156eb9ff4 Don't wait to start main server 2019-07-18 18:08:29 -05:00
Asher
f8f4bfd76f Customize JSON files with code-server name 2019-07-18 18:08:28 -05:00
Asher
5677ff2edf Add build scripts 2019-07-18 18:08:27 -05:00
Asher
61c281ec6b Add arguments for ports 2019-07-18 18:08:26 -05:00
Asher
770e0db7b8 Add cli arguments 2019-07-18 18:08:25 -05:00
Asher
6a35ab1dc0 Add (unimplemented) webview server 2019-07-18 18:08:24 -05:00
Asher
3a78c0964f Run log cleaner 2019-07-18 18:08:24 -05:00
Asher
4685f6793d Pass product configuration 2019-07-18 18:08:23 -05:00
Asher
2e77c9d449 Scan extensions 2019-07-18 18:08:22 -05:00
Asher
a6703ecb98 Prevent sending disconnect if disposed 2019-07-18 18:08:21 -05:00
Asher
57a8186e88 Add development steps 2019-07-18 18:08:20 -05:00
Asher
d808bfaec6 Set workspace and folder URIs
This makes the file tree work.
2019-07-18 18:08:19 -05:00
Asher
7072bf1e83 Use new URI transformer everywhere 2019-07-18 18:08:18 -05:00
Asher
4e0a6d2941 Partial extension host, some restructuring
I didn't like how the inner objects accessed parent objects, so I
restructured all that.
2019-07-18 18:08:17 -05:00
Asher
0d618bb1ef Use spdlog for log service 2019-07-18 18:08:17 -05:00
Asher
a0121f2f0c Implement file provider
Reading, watching, saving, etc all seem to work now.
2019-07-18 18:08:16 -05:00
Asher
98f001395c Add content types 2019-07-18 18:08:15 -05:00
Asher
68fe085aa3 Add channels 2019-07-18 18:08:14 -05:00
Asher
4861405683 Initial connection handling 2019-07-18 18:08:13 -05:00
Asher
310bfe509e Delete all the things 2019-07-18 18:08:11 -05:00
Dean Sheather
f25a614333 Merge pull request #835 from cdr/log-failed-logins
Add failed authentication attempt logger
2019-07-11 02:42:55 +00:00
Dean Sheather
0ae8c1820a Merge branch 'log-failed-logins' of github.com:cdr/code-server into log-failed-logins 2019-07-11 12:31:52 +10:00
Dean Sheather
e776f18192 update docs to mention --trust-proxy 2019-07-11 12:30:42 +10:00
Dean Sheather
72d71664b3 Merge pull request #823 from FrankPetrilli/patch-1
Add `use-credentials` to fetch manifest with cookies
2019-07-10 09:46:17 +00:00
Dean Sheather
1046fc192e Merge branch 'master' into log-failed-logins 2019-07-09 01:01:20 +00:00
Dean Sheather
c48a275d33 add timestamp to auth log, add fail2ban conf+docs 2019-07-09 10:57:09 +10:00
Dean Sheather
79e08c74ed Merge pull request #834 from cdr/fix-sw-path
Fix service worker path
2019-07-08 22:36:27 +00:00
Dean Sheather
3f2ad7b719 Fix self-hosted documentation screenshot URL (#836) 2019-07-08 08:55:37 -06:00
Dean Sheather
5e8c3f8ff3 Merge pull request #698 from 8sd/patch-1
Fix formatting issue
2019-07-08 10:06:09 +00:00
Dean Sheather
ddab1a0626 Merge pull request #730 from T45K/fix-typos
Fix typos in wget url
2019-07-08 09:51:26 +00:00
Sebastian Duda
d950e3c9de Fix missing comma in cli-help 2019-07-08 09:20:29 +02:00
tsk-nkgw
46298c7675 fix typos in wget url 2019-07-07 18:30:27 +09:00
Dean Sheather
14d917179c update code-server usage in documentation 2019-07-07 17:03:47 +10:00
Dean Sheather
a65773338c add failed authentication attempt logger
When `isAuthed()` is called and the password cookie is not what we
expected, the failed login attempt is logged with the provided password,
remote address and user agent.

To allow for logging failed attempts with a reverse proxy, the
`--trust-proxy` argument has been added to trust the `X-Forwarded-For`
header. This implementation of an `X-Forwarded-For` parser uses the last
value in the list, therefore only trusting the nearest proxy.
2019-07-07 16:50:43 +10:00
Dean Sheather
9b5a43e4bd use local workbox to simplify csp
Co-Authored-By: Ian Reinhart Geiser <geiseri@geekcentral.pub>
2019-07-07 15:13:16 +10:00
Dean Sheather
46207cfe10 register service worker at relative scope
Co-Authored-By: Ian Reinhart Geiser <geiseri@geekcentral.pub>
2019-07-07 15:12:45 +10:00
Dean Sheather
242bb6ffa2 Merge pull request #821 from morningspace/master
Update READE to add know issue for golang debug
2019-07-07 03:39:01 +00:00
morningspace
e6713db677 Update READE to add know issue for golang debug 2019-07-02 06:37:34 +08:00
Frank Petrilli
11784e55b2 Change quote style to match existing work 2019-07-01 14:10:32 -07:00
Frank Petrilli
a72e8a698d Add use-credentials to fetch manifest with cookies
I run code-server behind an authenticating Kubernetes Ingress which sets a cookie after a successful login is performed. Since this cookie is not set when fetching the manifest, the fetch fails and gets redirected to the authentication page, breaking code-server completely.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
2019-07-01 14:05:35 -07:00
Asher
28c93612e6 Move address output to the listen callback
Since listening is asynchronous, this guarantees the address will be
filled out.
2019-06-17 13:44:24 -05:00
Dean Sheather
a9d17882e7 use port from server.address() when printing URL (#780)
This allows the use of port 0, which is interpretted automatically to
mean "random port".

Additional logging consistency fixes.
2019-06-17 12:20:20 -05:00
Asher
cf63bbd003 Fix "no authentication" message with custom password
Fixes #757.
2019-06-11 12:08:02 -05:00
Anmol Sethi
02f62882b8 Propagate full env to browser (#756)
* Propogate full env to browser

* Add support for setting $ITEM_URL

* Add serviceURL getter
2019-06-11 11:54:49 -05:00
Asher
362715bbeb Fix dialog items getting cut off
Fixes #336.
2019-06-07 14:30:45 -05:00
Dean Sheather
ec70ea6994 Change documentation to use port 8443 (#740) 2019-06-07 14:22:33 -05:00
Asher
04adf14146 Move OSX package task into build script
This is to match how the other binaries are built. Also made some
changes to make the Docker containers clean up for when you are running
this locally.
2019-06-06 13:43:37 -05:00
Liudas Sodonis aka lfx aka lso
406ec0ba71 Updated google_cloud to have proper link to ssl.md (#745) 2019-06-05 15:28:10 -05:00
Sebastian Duda
e2eaa0aa4e Align intend of description
Co-Authored-By: Sergio Moura <sergio@moura.ca>
2019-05-28 07:10:20 +00:00
Asher
a2ad3d4ff4 Show hidden files by default
Since there is no other way to enable hidden files, it seems better to
enable it by default otherwise there are some folders/files you simply
can never open from the dialog.
2019-05-20 16:08:54 -05:00
Asher
4a29cd1664 Fix human readable byte size when zero 2019-05-20 15:53:06 -05:00
Anmol Sethi
0462a93f11 Expose actions registry (#701) 2019-05-20 14:35:58 -05:00
Asher
db39eacfa1 Set NODE_ENV and VERSION when building (#700)
* Set NODE_ENV and VERSION when building

Should fix the version flag not reporting correctly as well as enable
the service worker and prevent the 404 hmr requests again.

* Log env vars

To help make sure it's built correctly when looking at the Travis logs.
2019-05-20 11:02:36 -05:00
Sebastian Duda
91bcbe496b Fix formatting issue 2019-05-20 08:29:27 +00:00
Asher
c020cd2f2c Don't try to create builtin extensions directory
Since this will be a path in the binary that we don't want to create on
the user's system. I also removed the option to override it; it doesn't
seem like a great idea since you'd always want those builtin extensions.
This way we also don't have to check if the option was passed and only
create it if that was the case.
2019-05-19 19:49:05 -05:00
Asher
81bbfa7fbe Suppress "disconnected" notification on extension host
This isn't a real error event; we artificially emit it just in case
something waiting to start is listening to the error event in order to
clean up and/or restart.
2019-05-19 19:21:25 -05:00
Asher
aa1474b675 Extra extensions directories (#694)
* Allow setting paths for builtin exts and extra dirs

The extra directories aren't used yet, just available from the
environment service and to the shared process.

* Utilize extra builtin extensions path

* Utilize extra extensions directory

* Fix cached mtimes for extra extension dirs

* Simplify extension cache equality check
2019-05-19 17:58:47 -05:00
bastigw
8256252967 Updated Data Directory Flag (#664)
Old Version contained a deprecated flag
2019-05-19 17:26:09 -05:00
Ram
07342bbee7 Remove broken links (#671) 2019-05-19 17:24:57 -05:00
Anmol Sethi
72152f74ab Fix docker oneliner in README.md 2019-05-02 13:32:05 -04:00
Anmol Sethi
420ca76f54 Merge pull request #635 from cdr/rename
Fix macOS release
2019-05-02 12:23:42 -04:00
Anmol Sethi
31503fc853 Fix macOS release 2019-05-02 12:23:17 -04:00
Anmol Sethi
cf399ef6ac Merge pull request #634 from cdr/rename
Rename codercom/code-server to cdr/code-server
2019-05-02 12:07:48 -04:00
Anmol Sethi
bb5836ec61 Rename codercom/code-server to cdr/code-server 2019-05-02 11:25:50 -04:00
Anmol Sethi
f36235e03f Merge pull request #633 from cdr/show-terminal-api
expose terminal service in IDE API
2019-05-02 11:08:23 -04:00
Anmol Sethi
6ef1628acb Expose Terminal Service in API
Will need in sail.
2019-05-02 10:27:28 -04:00
Anmol Sethi
ab8f8a0a22 Merge pull request #520 from nhooyr/volume
Remove chmod on project dir
2019-04-29 19:06:07 -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
Kyle Carberry
6c972e855f codercom -> cdr 2019-04-27 16:57:10 -04:00
Kyle Carberry
e332882a88 Package only on darwin 2019-04-26 10:51:38 -05:00
Kyle Carberry
d0142e2536 Include version with target env 2019-04-26 10:29:12 -04:00
Kyle Carberry
e8c8fba91d Add docker service 2019-04-26 10:00:15 -04:00
Kyle Carberry
01a63a7241 Merge branch 'master' of github.com:codercom/code-server 2019-04-26 09:57:16 -04:00
Kyle Carberry
a2e0638c6a Add support for musl and centos 2019-04-26 09:56:14 -04:00
John McCambridge
4e62f938a9 Remove reveal in finder/explorer option from the context menu (#586) 2019-04-25 15:23:03 -05:00
Asher
4c5bb83fc1 Fix open dialog crash when there is a broken link
Fixes #579.
2019-04-25 15:17:22 -05:00
Asher
a3ac4567e3 Only output password if it was generated 2019-04-25 14:08:46 -05:00
Asher
58cf109a83 Fix full screen detection for Chromium 2019-04-25 13:29:11 -05:00
Asher
fab45dedcd Fix toggling full screen 2019-04-25 13:22:30 -05:00
Asher
446573809c Improve size column in dialogs
- Remove size from directories (often always 4K and not very useful).
- Format file sizes to be more human-readable.
2019-04-25 12:07:35 -05:00
Nick Wade
5ad9398b01 Fix typo DigitalOcean (#595) 2019-04-25 07:57:12 -07:00
Kyle Carberry
bcdbd90197 Fix #587 (#588) 2019-04-24 18:34:57 -05:00
Asher
0de7247868 Fix protocol fs test 2019-04-24 18:15:56 -05:00
Asher
c9f91e77cd Fix coping and moving files around using the file tree (#568)
* Implement write/read buffers in electron fill

This makes cutting and copy files from the file tree work.

* Implement fs.createReadStream

This is used by the file tree to copy files.

* Allow passing proxies back from client to server

This makes things like piping streams possible.

* Synchronously bind to proxy events

This eliminates any chance whatsoever of missing events due to binding
too late.

* Make it possible to bind some events on demand

* Add some protocol documentation
2019-04-24 10:38:21 -05:00
John McCambridge
30b8565e2d Fix markdown preview focus (#546)
* Fix hash

* Remove whitespace
2019-04-23 19:14:52 -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
b055a26dc3 Remove log statement from copy 2019-04-23 11:33:42 -04:00
Kyle Carberry
2bc6e1a457 Fix clipboard pasting 2019-04-22 20:20:48 -04:00
Kyle Carberry
e61ea796c6 Bundle grammars (#563) 2019-04-22 12:51:05 -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
Kyle Carberry
5f40ebb845 Update wording for sshcode 2019-04-19 21:22:00 -04:00
Kyle Carberry
c56e2797cc Add sshcode to the readme 2019-04-19 21:20:31 -04:00
Kyle Carberry
166efcb17e Hide titlebar controls and fix menubar toggle (#550) 2019-04-19 19:54:50 -05:00
Kyle Carberry
206e107a9a Merge branch 'master' of github.com:codercom/code-server 2019-04-19 20:03:54 -04:00
Kyle Carberry
12c8b5d337 Closes #466 2019-04-19 20:03:52 -04:00
Asher
4aa20fd864 Fix require.toUrl on the Node side
- Fixes #542
2019-04-19 13:32:10 -05:00
Illia Poplawski
0cd4e46055 Fix self hosted flags (#523)
* Remove -h flag for help information

* Add tab after removing -h option

* Remove spaces after --user-data-dir option to line up with other menu items
2019-04-18 13:02:29 -05:00
Asher
f51823b51f Fix open dialog
- Fixes #508
2019-04-18 12:08:44 -05:00
Asher
55bfeab208 Deprecate password flag in favor of an environment variable 2019-04-18 11:10:55 -05:00
Asher
309d15cefd Use file/folder open commands for all operating systems
Mac was using its own thing.

- Fixes #535
- Fixes #501
2019-04-18 10:50:23 -05:00
Kyle Carberry
95006a435a Merge branch 'master' of github.com:codercom/code-server 2019-04-17 21:01:25 -04:00
Kyle Carberry
4d576ab4d4 Trigger configuration update when loaded 2019-04-17 21:01:23 -04:00
Asher
d5b03ef60e Remove version from Docker command 2019-04-17 17:38:22 -05:00
Anmol Sethi
cdc5b55a9d Remove chmod on project dir
See #471
2019-04-17 18:36:33 -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
Kyle Carberry
e0f1787ce6 Update logger 2019-04-17 17:47:02 -04:00
John McCambridge
50e6108012 Add confirmation for closing window (#463)
* Add confirmation for closing window

* Make function an event listener for consistency

* Change let to const

* Refactor for compatability
2019-04-17 16:42:36 -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
Kyle Carberry
8a4da542ae Add GCP logging extender (#503)
* Add GCP logging extender

* Minor version bump for new API

* Update packages/logger/src/logger.ts

Co-Authored-By: kylecarbs <kyle@kwc.io>
2019-04-17 13:41:10 -05:00
Luca Casonato
e907dbe7e6 fixe password signin with service-worker (#511) 2019-04-17 10:27:24 -05:00
Luca Casonato
22b485acd9 Added serviceworker and web-manifest (#154)
* Added serviceworker and manifest.json

* added deps in package.json

* fixed image link

* actually fixed images i think

* added assets to individual module folders

* added caching

* Serviceworker now properly loads

* Changed single to double quotes

* Update lock

* moved the service worker back into prod only

* removed sw from general

* changed background color of splash screen

* added logo to server

* centralized logo into single assets folder
2019-04-16 15:44:57 -05:00
Asher
b8f222acf2 Ensure all environment paths are created
This normally happens in electron-main/main.ts but we don't run anything
from there.

Fixes #499.
2019-04-16 10:58:13 -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
Kibo Hikari
dfabc070b9 fix(dockerfile): explicitly create a volume and set permission for project dir (#471)
Signed-off-by: Kibo Hikari <enra@sayonika.moe>
2019-04-13 23:34:25 -05:00
Kyle Carberry
da420cdda9 Merge branch 'master' of github.com:codercom/code-server 2019-04-14 00:32:06 -04:00
Kyle Carberry
c6a46e4753 Fix reading text from clipboard via electron fill 2019-04-14 00:32:03 -04:00
Asher
742dd6f597 Upgrade VS Code to 1.33.1 2019-04-12 16:10:45 -05:00
Yen-Chi Chen
6c3ff1d6f0 Fix typo: doc/self-hosted/index.md (#477) 2019-04-12 10:35:54 -05:00
John McCambridge
db57aa229f Allow use of the enter key for password input for code-server (#479)
* Allow use of the enter key for password input for code-server

* Remove function, make html form

* Remove function and create html form

* Handle form submit action

* Remove button listener

* Check if form exists
2019-04-12 10:35:30 -05:00
David Pinezich
f7342ede69 Update digitalocean.md (#486)
Seems that   sudo ./code-server-linux -p 80 is outdated. The "linux" is not anymore given.
2019-04-11 16:18:13 -05:00
Anmol Sethi
b781ccde9c Add common utilities to Dockerfile (#488) 2019-04-11 15:30:21 -05:00
Asher
8f62b2bff2 Decrease max retry time to three seconds 2019-04-11 14:58:29 -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
2785e2219a Remove hosted from the readme 2019-04-11 02:11:51 +00:00
majik
4b217fba00 Feature/relative url (#307)
* resrouce relative url

* add url pathname for require.toUrl (fix webview url)

* rest resrouce relative url

* fix resource url

* ignore .vscode
2019-04-10 20:07:53 -05:00
Kyle Carberry
3fae68bbab Add storage save to ide-api 2019-04-09 12:24:53 -04:00
Asher
a2f20aa25c Update window service fill 2019-04-08 18:04:41 -05:00
Asher
94b8b9a5cf Fix window.open infinite loop 2019-04-08 17:44:10 -05:00
Asher
bbd8b27fc7 Explicitly mention if netstat isn't installed; downgrade to warning 2019-04-08 11:15:25 -05:00
Asher
6361635b55 Move backup service init to the shared process
Since this is where it attempts to read it, this should solve the JSON
errors for good.
2019-04-08 11:03:33 -05:00
Kyle Carberry
d2da4cfc43 Fix errors appearing 2019-04-07 17:04:49 -04:00
Asher
a1136b3a02 Update VS Code to 1.33.0 (#445)
* Update VS Code to 1.33.0

* Fix slow file tree

* Fix WindowsService fill

* Provide `off` on event listeners

* Fix webview

* Fix double title bar and missing preferences on Mac

* Bump VS Code version in Travis config

* Fix black dialog text (again)

* Fix shared process not starting
2019-04-05 18:49:29 -05:00
Anmol Sethi
4dd74b31b9 Merge pull request #435 from codercom/docker-fixes
Reduce layers in Dockerfile
2019-04-05 10:18:50 -05:00
Anmol Sethi
bc0f6eb65d Reduce layers in Dockerfile 2019-04-04 20:00:42 -05:00
Anmol Sethi
6737d3da18 Merge pull request #433 from codercom/docker-fixes
Significantly improve the Dockerfile
2019-04-04 18:42:14 -05:00
Anmol Sethi
eb0f773146 Update README.md 2019-04-04 18:41:45 -05:00
Anmol Sethi
ebac84899e Significantly improve the Dockerfile
- Adds dumb-init so closes #403, closes #361, closes #383
- User mode docker so closes #192, closes #65
- Uses latest docker ubuntu instead of 18.10 which is the rolling tag so closes #404

Thanks to @RichardMcSorley and @sr229
2019-04-04 18:41:45 -05:00
Richard McSorley
0b7a090a73 Use an init system 2019-04-04 18:41:45 -05:00
Hikari Kibo
a95019f38d fix: slap adduser into another RUN
im abusing the word slap today please help me
2019-04-04 18:41:45 -05:00
Hikari
15948c1af6 feat: user-mode docker
Signed-off-by: Hikari <enra@sayonika.moe>
2019-04-04 18:41:45 -05:00
Asher
e73eb74208 Fix sending dates through the protocol
Fixes #253.
2019-04-04 18:24:53 -05:00
Kyle Carberry
278c59b920 Remove non-working menu items 2019-04-04 18:04:34 -04:00
Kyle Carberry
5a1eb858a9 Merge branch 'master' of github.com:codercom/code-server 2019-04-04 17:13:58 -04:00
Kyle Carberry
3c1dfb1170 Update @coder/nbin. Fixes UI state saves 2019-04-04 17:13:54 -04:00
Asher
09a02eb9e9 Build for production in Docker 2019-04-04 13:33:49 -05:00
Kyle Carberry
2bd7281fa0 Update @coder/nbin 2019-04-04 09:59:50 -04:00
Asher
e12fcd3a0d Fix error when shared process exits with null 2019-04-03 17:32:20 -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
Asher
c607015a26 Initialize backup service (#419)
- Fixes #399
- Fixes #332
2019-04-03 16:08:15 -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
Kyle Carberry
dcf409aecb Improve CI caching (#416)
* Adjust linux distro to ubuntu 14.04

* Cache lib directory for speedy builds

* Fix path linking for default extensions

* Update reset

* Reset to head

* Improve caching

* Still run yarn in CI

* Update yarn before install

* Increase cache timeout

* Install vscode from vstar

* Undo data-dir changes to CLI, add back clean, remove unused CI func

* Remove additional flags added

* Remove unused dependency

* Reset vscode install dir so patching always works
2019-04-03 14:24:00 -05:00
Kyle Carberry
2683b7c734 Update notes title 2019-04-03 11:23:32 -04: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
f484781693 Minor update in notes 2019-04-02 11:41:44 -04:00
Anmol Sethi
97f5b07003 Fix icons on safari when using cookie authentication (#398)
Cookie's are not sent with url's in -webkit-mask so we
embed the svg's directly in the css.
2019-04-01 15:20:39 -05:00
MOZGIII
7481395353 Changed "lib" to "/lib" at .gitignore (#395) 2019-04-01 14:15:43 -05:00
Asher
033ef151ca Improve retry
Registering returns an instance that lets you retry and recover without
needing to keep passing the name everywhere.

Also refactored the shared process a little to make better use of the
retry and downgraded stderr messages to warnings because they aren't
critical.
2019-04-01 13:31:34 -05:00
Jeff Delaney
3fec7f432c doc: fixed name of binary to match latest release (#386) 2019-03-31 13:15:33 -05:00
Asher
4887078423 Fix typescript tslint plugin
tslint-language-service is the deprecated version which we don't
actually even have listed in the package.json. typescript-tslint-plugin
is the new version.
2019-03-29 18:44:04 -05:00
Asher
91deaece47 Reduce frequency of port scanning 2019-03-29 16:14:28 -05:00
Asher
03ad2a17b2 Handle disconnects (#363)
* Make proxies decide how to handle disconnects

* Connect to a new terminal instance on disconnect

* Use our retry for the watcher

* Specify method when proxy doesn't exist

* Don't error when closing/killing disconnected proxy

* Specify proxy ID when a method doesn't exist

* Use our retry for the searcher

Also dispose some things for the watcher because it doesn't seem that
was done properly.

The searcher also now starts immediately so there won't be lag when you
perform your first search.

* Use our retry for the extension host

* Emit error in parent proxy class

Reduces duplicate code. Not all items are "supposed" to have an error
event according to the original implementation we are filling, but there
is no reason why we can't emit our own events (and are already doing so
for the "disconnected" event anyway).

* Reconnect spdlog

* Add error message when shared process disconnects

* Pass method resolve to parse

* Don't pass method to getProxy

It doesn't tell you anything that trace logging wouldn't and has
no relation to what the function actually does.

* Fix infinite recursion when disposing protocol client in tests
2019-03-28 17:59:49 -05:00
John McCambridge
a4cca6b759 Add information about release notifications/gif (#355)
* Add information about release notifications/gif

* Remove unecessary space

* Add smaller gif

* Add even smaller gif

* Trim time in new gif

* Cropped a tad more

* Fix weird aligning
2019-03-27 17:05:44 -05:00
NGTmeaty
6105bba0a4 Add higher quality Discord badge and add a link to the license badge. (#364)
* Add higher quality Discord badge and add link 

to license.

* Use @grant's much better version :)
2019-03-27 17:05:23 -05:00
Asher
259095eae2 Watcher and initial load performance improvements (#357)
* Set low CPU priority on watcher

Fixes #247.

* Batch stat and readdir calls

* Fix fs.exists

callbackify seems to always adds an error as the first argument. Opted
to just use the promise for this one.

* Batch lstat

* Add maximum time for flushing batches
2019-03-27 17:04:19 -05:00
Carlos Azaustre
38a0706b18 Add example with letsencrypt certificates
* updated the download link

* added example with letsencrypt certificates
2019-03-27 10:36:03 -05:00
Ryo Ochiai
c7ae12c2ed Add .node-version file (#272) 2019-03-27 10:35:00 -05:00
James Peters
3331f9b28d Update Dockerfile (#327) 2019-03-27 10:34:34 -05:00
Reda Aissaoui
def4104c53 Changed executable name (#353)
code-server-luni should be only code-server
2019-03-27 10:23:23 -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
83aa952de2 Update nbin version. Fixes extensions 2019-03-26 22:07:36 -04:00
Kyle Carberry
e0d33f2399 Update nbin to 1.0.3 2019-03-26 17:57:35 -04:00
Kyle Carberry
194cbca0f2 Update nbin 2019-03-26 17:53:36 -04:00
Kyle Carberry
1697cc32a3 Use commander instead of oclif 2019-03-26 16:21:03 -04:00
Kyle Carberry
f058f90340 Place all envs in one line 2019-03-26 14:52:33 -04:00
Kyle Carberry
ca4b0346cb Update versioning format 2019-03-26 14:38:38 -04:00
Kyle Carberry
8d692ded4a Remove tslib external 2019-03-26 14:25:12 -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
Asher
d16c6aeb30 Fix port scanner when netstat isn't available
- It logs the error now.
- For some reason when there is an error node-netstat runs the callback
  twice. That resulted in us scheduling an exponentially growing number
	of calls which ate up all the CPU (and probably memory eventually).
  For now, opted to dispose when there is an error.
2019-03-25 18:31:43 -05:00
Forest Hoffman
cdc40d36ff Ensure workspace configPath is a valid URI object (#317) 2019-03-22 16:58:37 -05:00
Hayden Young
80c19878e0 Add note about extensions needing to be OSS (#113)
* Add note about extensions needing to be OSS

* Update README.md

* Update README.md
2019-03-22 14:58:13 -05:00
Forest Hoffman
18f395b853 Fix install from VSIX for TAR and ZIP formats (#245)
* Fix install from VSIX for TAR and ZIP formats

* Parse TAR before ZIP, when installing from VSIX
2019-03-21 14:04:09 -05:00
Dominik Schenner
75435be949 Update index.md (#297)
Added Apache reverse proxy example configuration
2019-03-21 13:49:27 -05:00
Mike Hatch
ce73bc58e5 Capitalized first letters to be consistent (#304)
In addition to capitalizing, I also reworded a sentence for improved grammar.
2019-03-21 09:39:34 -05:00
Hikari Kibo
70219d1071 doc: add CrOS install guide (#225)
* doc: add CrOS install guide

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: change occurences of index to install guide

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: add penguin.linux.test as alternative endpoint

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: link Crostini and crouton info pages and describe install guide

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: remove citations for dev mode requirement

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: clarify more wording

Signed-off-by: Hikari <enra@sayonika.moe>

* doc: fix typo in Crostini section

Signed-off-by: Hikari <enra@sayonika.moe>
2019-03-20 09:24:07 -05:00
Kyle Carberry
e9e0bf7d84 Fixes #275 2019-03-20 09:58:56 -04:00
Kyle Carberry
3da1dccf73 Merge branch 'master' of github.com:codercom/code-server 2019-03-19 14:00:27 -04:00
Kyle Carberry
e02101c676 Update codeowners 2019-03-19 14:00:25 -04:00
Easy
ffc47054dd update nginx config (#288)
should add one line `proxy_set_header Accept-Encoding gzip; `  or you may get a  `Cannot GET /` error.
2019-03-19 12:59:50 -05:00
Kyle Carberry
2169045377 Fix debugging 2019-03-19 12:53:05 -04:00
Kyle Carberry
277c6cb690 Fix failure to resolve arrays error 2019-03-18 21:05:21 -04:00
Moien Tajik
91a98b8082 Fixed documentation download links based on latest version (#130)
* Fixed documentation based on latest release

* Fixed google-cloud documentation steps order

* Edited docs based on the latest release versions

* Make docs more dynamic based on Releases

* Changed ordered list to unordered list
2019-03-18 10:45:20 -05:00
Steve Sloka
6028a8b1a8 Add support for Kubernetes by deploying code-server. Also includes AWS (#146)
example which persists data to a Persistent Volume / Claim.

Signed-off-by: Steve Sloka <slokas@vmware.com>
2019-03-18 10:44:08 -05:00
Jim Tittsler
6749f25bbf Doc: fix typo (#277) 2019-03-17 22:35:29 -05:00
Sean Smith
f6b96e3778 Fix security links in cloud setup guides (#260) 2019-03-15 15:32:24 -04:00
Kyle Carberry
3b8cd0a3cd Fix docker cmd in readme 2019-03-15 01:24:44 -04:00
343 changed files with 16065 additions and 32652 deletions

View File

@@ -1,9 +1,3 @@
Dockerfile
# Docs
doc/
# GitHub stuff
.github
.gitignore
.travis.yml
LICENSE
README.md
**
!release-packages
!ci

6
.editorconfig Normal file
View File

@@ -0,0 +1,6 @@
root = true
[*]
indent_style = space
trim_trailing_whitespace = true
indent_size = 2

31
.eslintrc.yaml Normal file
View File

@@ -0,0 +1,31 @@
parser: "@typescript-eslint/parser"
env:
browser: true
es6: true # Map, etc.
mocha: true
node: true
parserOptions:
ecmaVersion: 2018
sourceType: module
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:import/recommended
- plugin:import/typescript
- plugin:prettier/recommended
- prettier # Removes eslint rules that conflict with prettier.
- prettier/@typescript-eslint # Remove conflicts again.
rules:
# For overloads.
no-dupe-class-members: off
"@typescript-eslint/no-use-before-define": off
"@typescript-eslint/no-non-null-assertion": off
settings:
# Does not work with CommonJS unfortunately.
import/ignore:
- env-paths
- xdg-basedir

3
.github/CODEOWNERS vendored
View File

@@ -1,2 +1 @@
* @coderasher @kylecarbs
Dockerfile @nhooyr
* @code-asher @nhooyr

View File

@@ -1,22 +0,0 @@
---
name: Bug Report
about: Report problems and unexpected behavior.
title: ''
labels: 'bug'
assignees: ''
---
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- All extension-specific issues should be created with the `Extension Bug` template. -->
- `code-server` version: <!-- The version of code-server -->
- OS Version: <!-- OS version, cloud provider, -->
## Description
<!-- Describes the problem here -->
## Steps to Reproduce
1. <!-- step 1: click ... -->
1. <!-- step 2: ... -->

View File

@@ -1,22 +0,0 @@
---
name: Extension Bug
about: Report problems and unexpected behavior with extensions.
title: ''
labels: 'extension-specific'
assignees: ''
---
<!-- Please search existing issues to avoid creating duplicates. -->
- `code-server` version: <!-- The version of code-server -->
- OS Version: <!-- OS version, cloud provider, -->
- Extension: <!-- Link to extension -->
## Description
<!-- Describes the problem here -->
## Steps to Reproduce
1. <!-- step 1: click ... -->
1. <!-- step 2: ... -->

View File

@@ -1,11 +0,0 @@
---
name: Feature Request
about: Suggest an idea for this project.
title: ''
labels: 'feature'
assignees: ''
---
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Describe the feature you'd like. -->

View File

@@ -1,17 +0,0 @@
---
name: Question
about: Ask a question.
title: ''
labels: 'question'
assignees: ''
---
<!-- Please search existing issues to avoid creating duplicates. -->
## Description
<!-- A description of the the question. -->
## Related Issues
<!-- Any issues related to your question. -->

11
.github/issue_template.md vendored Normal file
View File

@@ -0,0 +1,11 @@
<!--
Please file all questions and support requests at https://www.reddit.com/r/codeserver/
The issue tracker is only for bugs.
Please see https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-debug-issues-with-code-server
and include any logging information relevant to the issue.
Please search for existing issues before filing.
Please ensure you cannot reproduce on VS Code before filing.
-->

View File

@@ -1,6 +1,4 @@
<!-- Please answer these questions before submitting your PR. Thanks! -->
### Describe in detail the problem you had and how this PR fixes it
### Is there an open issue you can link to?
<!--
Please link to the issue this PR solves.
If there is no existing issue, please first create one unless the fix is minor.
-->

148
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,148 @@
name: ci
on: [push, pull_request]
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/fmt.sh
uses: ./ci/container
with:
args: ./ci/steps/fmt.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/lint.sh
uses: ./ci/container
with:
args: ./ci/steps/lint.sh
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/test.sh
uses: ./ci/container
with:
args: ./ci/steps/test.sh
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/release.sh
uses: ./ci/container
with:
args: ./ci/steps/release.sh
- name: Upload npm package artifact
uses: actions/upload-artifact@v2
with:
name: npm-package
path: ./release
linux-amd64:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release
- name: Run ./ci/steps/release-static.sh
uses: ./ci/container
with:
args: ./ci/steps/release-static.sh
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release-packages
path: ./release-packages
linux-arm64:
needs: release
runs-on: ubuntu-arm64-latest
steps:
- uses: actions/checkout@v1
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release
- name: Run ./ci/steps/release-static.sh
uses: ./ci/container
with:
args: ./ci/steps/release-static.sh
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release-packages
path: ./release-packages
macos-amd64:
needs: release
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Download npm package
uses: actions/download-artifact@v2
with:
name: npm-package
path: ./release
- run: brew unlink node@12
- run: brew install node
- run: ./ci/steps/release-static.sh
env:
# Otherwise we get rate limited when fetching the ripgrep binary.
# For whatever reason only MacOS needs it.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifacts
uses: actions/upload-artifact@v2
with:
name: release-packages
path: ./release-packages
docker-amd64:
runs-on: ubuntu-latest
needs: linux-amd64
steps:
- uses: actions/checkout@v1
- name: Download release package
uses: actions/download-artifact@v2
with:
name: release-packages
path: ./release-packages
- name: Run ./ci/steps/build-docker-image.sh
uses: ./ci/container
with:
args: ./ci/steps/build-docker-image.sh
- name: Upload release image
uses: actions/upload-artifact@v2
with:
name: release-images
path: ./release-images
docker-arm64:
runs-on: ubuntu-arm64-latest
needs: linux-arm64
steps:
- uses: actions/checkout@v1
- name: Download release package
uses: actions/download-artifact@v2
with:
name: release-packages
path: ./release-packages
- name: Run ./ci/steps/build-docker-image.sh
uses: ./ci/container
with:
args: ./ci/steps/build-docker-image.sh
- name: Upload release image
uses: actions/upload-artifact@v2
with:
name: release-images
path: ./release-images

31
.github/workflows/publish.yaml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: publish
on:
release:
types: [published]
jobs:
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/publish-npm.sh
uses: ./ci/container
with:
args: ./ci/steps/publish-npm.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/push-docker-manifest.sh
uses: ./ci/container
with:
args: ./ci/steps/push-docker-manifest.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

14
.gitignore vendored
View File

@@ -1,6 +1,10 @@
lib
.tsbuildinfo
.cache
dist*
out*
release/
release-static/
release-packages/
release-gcp/
release-images/
node_modules
dist
out
.DS_Store
release

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "lib/vscode"]
path = lib/vscode
url = https://github.com/microsoft/vscode

4
.prettierrc.yaml Normal file
View File

@@ -0,0 +1,4 @@
printWidth: 120
semi: false
trailingComma: all
arrowParens: always

2
.stylelintrc.yaml Normal file
View File

@@ -0,0 +1,2 @@
extends:
- stylelint-config-recommended

View File

@@ -1,38 +0,0 @@
language: node_js
node_js:
- 8.15.0
env:
- VERSION="1.32.0-$TRAVIS_BUILD_NUMBER"
matrix:
include:
- os: linux
dist: ubuntu
- os: osx
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libxkbfile-dev
libsecret-1-dev; fi
script:
- scripts/build.sh
before_deploy:
- echo "$VERSION" "$TRAVIS_COMMIT"
- git config --local user.name "$USER_NAME"
- git config --local user.email "$USER_EMAIL"
- git tag "$VERSION" "$TRAVIS_COMMIT"
- yarn task package "$VERSION"
deploy:
provider: releases
file_glob: true
draft: true
tag_name: "$VERSION"
target_commitish: "$TRAVIS_COMMIT"
name: "$VERSION"
skip_cleanup: true
api_key:
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
file:
- release/*.tar.gz
- release/*.zip
on:
repo: codercom/code-server
branch: master
cache: yarn

View File

@@ -1,33 +0,0 @@
FROM node:8.15.0
# Install VS Code's deps. These are the only two it seems we need.
RUN apt-get update && apt-get install -y \
libxkbfile-dev \
libsecret-1-dev
# Ensure latest yarn.
RUN npm install -g yarn@1.13
WORKDIR /src
COPY . .
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules
# directly which should be fast as it is slow because it populates its own cache every time.
RUN yarn && yarn task build:server:binary
# We deploy with ubuntu so that devs have a familiar environment.
FROM ubuntu:18.10
WORKDIR /root/project
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
EXPOSE 8443
RUN apt-get update && apt-get install -y \
openssl \
net-tools \
git \
locales
RUN locale-gen en_US.UTF-8
# We unfortunately cannot use update-locale because docker will not use the env variables
# configured in /etc/default/locale so we need to set it manually.
ENV LANG=en_US.UTF-8
ENTRYPOINT ["code-server"]

128
README.md
View File

@@ -1,79 +1,105 @@
# code-server
[!["Open Issues"](https://img.shields.io/github/issues-raw/codercom/code-server.svg)](https://github.com/codercom/code-server/issues)
[!["Latest Release"](https://img.shields.io/github/release/codercom/code-server.svg)](https://github.com/codercom/code-server/releases/latest)
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](#)
[![Discord](https://discordapp.com/api/guilds/463752820026376202/widget.png)](https://discord.gg/zxSwN8Z)
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and access it in the browser.
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser.
- **Code everywhere:** Code on your Chromebook, tablet, and laptop with a
consistent dev environment. Develop on a Linux machine and pick up from any
device with a web browser.
- **Server-powered:** Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
Preserve battery life when you're on the go since all intensive tasks runs on your server.
Make use of a spare computer you have lying around and turn it into a full development environment.
![Example gif](./doc/assets/code-server.gif)
## Getting started
For a full setup and walkthrough, please see [./doc/guide.md](./doc/guide.md).
### Debian, Ubuntu
Try it out:
```bash
docker run -t -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-server --allow-http --no-auth
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server_3.3.0_amd64.deb
sudo dpkg -i code-server_3.3.0_amd64.deb
systemctl --user enable --now code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
- If you have a Windows or Mac workstation, more easily develop for Linux.
- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
- Preserve battery life when you're on the go.
- All intensive computation runs on your server.
- You're no longer running excess instances of Chrome.
### Fedora, Red Hat, SUSE
![Screenshot](/doc/assets/ide.png)
```bash
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server-3.3.0-amd64.rpm
sudo yum install -y code-server-3.3.0-amd64.rpm
systemctl --user enable --now code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
## Getting Started
### npm
### Hosted
We recommend installing from `npm` if we don't have a precompiled release for your machine's
platform or architecture.
[Try `code-server` now](https://coder.com/signup) for free at coder.com.
**note:** Installing via `npm` builds native modules on install and so requires C dependencies.
See [./doc/npm.md](./doc/npm.md) for installing these dependencies.
You will need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
```bash
npm install -g code-server
code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
### macOS
```bash
brew install code-server
brew services start code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
### Docker
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
```bash
# This will start a code-server container and expose it at http://127.0.0.1:8080.
# It will also mount your current directory into the container as `/home/coder/project`
# and forward your UID/GID so that all file system operations occur as your user outside
# the container.
docker run -it -p 127.0.0.1:8080:8080 \
-v "$PWD:/home/coder/project" \
-u "$(id -u):$(id -g)" \
codercom/code-server:latest
```
### Binaries
### Static releases
1. [Download a binary](https://github.com/codercom/code-server/releases) (Linux and OS X supported. Windows coming soon)
2. Start the binary with the project directory as the first argument
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
They bundle the node binary and compiled native modules.
```
code-server <initial directory to open>
```
> You will be prompted to enter the password shown in the CLI
`code-server` should now be running at https://localhost:8443.
1. Download the latest release archive for your system from [github](https://github.com/cdr/code-server/releases).
2. Unpack the release.
3. You can run code-server by executing `./bin/code-server`.
> code-server uses a self-signed SSL certificate that may prompt your browser to ask you some additional questions before you proceed. Please [read here](doc/self-hosted/index.md) for more information.
Add the code-server `bin` directory to your `$PATH` to easily execute `code-server` without the full path every time.
For detailed instructions and troubleshooting, see the [self-hosted quick start guide](doc/self-hosted/index.md).
Here is an example script for installing and using a static `code-server` release on Linux:
Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [Digital Ocean](doc/admin/install/digitalocean.md).
```bash
curl -sSL https://github.com/cdr/code-server/releases/download/3.3.0/code-server-3.3.0-linux-amd64.tar.gz | sudo tar -C /usr/local -xz
sudo mv /usr/local/code-server-3.3.0-linux-amd64 /usr/local/code-server
PATH="$PATH:/usr/local/code-server/bin"
code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
How to [secure your setup](/doc/security/ssl.md).
## FAQ
## Development
### Known Issues
- Creating custom VS Code extensions and debugging them doesn't work.
### Future
- Windows support.
- Electron and Chrome OS applications to bridge the gap between local<->remote.
- Run VS Code unit tests against our builds to ensure features work as expected.
See [./doc/FAQ.md](./doc/FAQ.md).
## Contributing
Development guides are coming soon.
## License
[MIT](LICENSE)
See [./doc/CONTRIBUTING.md](./doc/CONTRIBUTING.md).
## Enterprise
Visit [our enterprise page](https://coder.com/enterprise) for more information about our enterprise offering.
## Commercialization
If you would like to commercialize code-server, please contact contact@coder.com.
Visit [our website](https://coder.com) for more information about our
enterprise offerings.

View File

@@ -1,296 +0,0 @@
import { register, run } from "@coder/runner";
import * as fs from "fs";
import * as fse from "fs-extra";
import * as os from "os";
import * as path from "path";
import * as zlib from "zlib";
const isWin = os.platform() === "win32";
const libPath = path.join(__dirname, "../lib");
const vscodePath = path.join(libPath, "vscode");
const pkgsPath = path.join(__dirname, "../packages");
const defaultExtensionsPath = path.join(libPath, "VSCode-linux-x64/resources/app/extensions");
const vscodeVersion = "1.32.0";
const buildServerBinary = register("build:server:binary", async (runner) => {
await ensureInstalled();
await copyForDefaultExtensions();
await Promise.all([
buildBootstrapFork(),
buildWeb(),
buildDefaultExtensions(),
buildServerBundle(),
buildAppBrowser(),
]);
await buildServerBinaryPackage();
});
const buildServerBinaryPackage = register("build:server:binary:package", async (runner) => {
const cliPath = path.join(pkgsPath, "server");
runner.cwd = cliPath;
if (!fs.existsSync(path.join(cliPath, "out"))) {
throw new Error("Cannot build binary without server bundle built");
}
await buildServerBinaryCopy();
await dependencyNexeBinary();
const resp = await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:nexe"]);
if (resp.exitCode !== 0) {
throw new Error(`Failed to package binary: ${resp.stderr}`);
}
});
const dependencyNexeBinary = register("dependency:nexe", async (runner) => {
if (os.platform() === "linux" && process.env.COMPRESS === "true") {
// Download the nexe binary so we can compress it before nexe runs. If we
// don't want compression we don't need to do anything since nexe will take
// care of getting the binary.
const nexeDir = path.join(os.homedir(), ".nexe");
const targetBinaryName = `${os.platform()}-${os.arch()}-${process.version.substr(1)}`;
const targetBinaryPath = path.join(nexeDir, targetBinaryName);
if (!fs.existsSync(targetBinaryPath)) {
fse.mkdirpSync(nexeDir);
runner.cwd = nexeDir;
await runner.execute("wget", [`https://github.com/nexe/nexe/releases/download/v3.0.0-beta.15/${targetBinaryName}`]);
await runner.execute("chmod", ["+x", targetBinaryPath]);
}
// Compress with upx if it doesn't already look compressed.
if (fs.statSync(targetBinaryPath).size >= 20000000) {
// It needs to be executable for upx to work, which it might not be if
// nexe downloaded it.
fs.chmodSync(targetBinaryPath, "755");
const upxFolder = path.join(os.tmpdir(), "upx");
const upxBinary = path.join(upxFolder, "upx");
if (!fs.existsSync(upxBinary)) {
fse.mkdirpSync(upxFolder);
runner.cwd = upxFolder;
const upxExtract = await runner.execute("bash", ["-c", "curl -L https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz | tar xJ --strip-components=1"]);
if (upxExtract.exitCode !== 0) {
throw new Error(`Failed to extract upx: ${upxExtract.stderr}`);
}
}
if (!fs.existsSync(upxBinary)) {
throw new Error("Not sure how, but the UPX binary does not exist");
}
await runner.execute(upxBinary, [targetBinaryPath]);
}
}
});
const buildServerBinaryCopy = register("build:server:binary:copy", async (runner) => {
const cliPath = path.join(pkgsPath, "server");
const cliBuildPath = path.join(cliPath, "build");
fse.removeSync(cliBuildPath);
fse.mkdirpSync(path.join(cliBuildPath, "extensions"));
const bootstrapForkPath = path.join(pkgsPath, "vscode", "out", "bootstrap-fork.js");
const webOutputPath = path.join(pkgsPath, "web", "out");
const browserAppOutputPath = path.join(pkgsPath, "app", "browser", "out");
const nodePtyModule = path.join(pkgsPath, "protocol", "node_modules", "node-pty-prebuilt", "build", "Release", "pty.node");
const spdlogModule = path.join(pkgsPath, "protocol", "node_modules", "spdlog", "build", "Release", "spdlog.node");
let ripgrepPath = path.join(pkgsPath, "..", "lib", "vscode", "node_modules", "vscode-ripgrep", "bin", "rg");
if (isWin) {
ripgrepPath += ".exe";
}
if (!fs.existsSync(nodePtyModule)) {
throw new Error("Could not find pty.node. Ensure all packages have been installed");
}
if (!fs.existsSync(spdlogModule)) {
throw new Error("Could not find spdlog.node. Ensure all packages have been installed");
}
if (!fs.existsSync(webOutputPath)) {
throw new Error("Web bundle must be built");
}
if (!fs.existsSync(defaultExtensionsPath)) {
throw new Error("Default extensions must be built");
}
if (!fs.existsSync(bootstrapForkPath)) {
throw new Error("Bootstrap fork must exist");
}
if (!fs.existsSync(ripgrepPath)) {
throw new Error("Ripgrep must exist");
}
fse.copySync(defaultExtensionsPath, path.join(cliBuildPath, "extensions"));
fs.writeFileSync(path.join(cliBuildPath, "bootstrap-fork.js.gz"), zlib.gzipSync(fs.readFileSync(bootstrapForkPath)));
const cpDir = (dir: string, subdir: "auth" | "unauth", rootPath: string): void => {
const stat = fs.statSync(dir);
if (stat.isDirectory()) {
const paths = fs.readdirSync(dir);
paths.forEach((p) => cpDir(path.join(dir, p), subdir, rootPath));
} else if (stat.isFile()) {
const newPath = path.join(cliBuildPath, "web", subdir, path.relative(rootPath, dir));
fse.mkdirpSync(path.dirname(newPath));
fs.writeFileSync(newPath + ".gz", zlib.gzipSync(fs.readFileSync(dir)));
} else {
// Nothing
}
};
cpDir(webOutputPath, "auth", webOutputPath);
cpDir(browserAppOutputPath, "unauth", browserAppOutputPath);
fse.mkdirpSync(path.join(cliBuildPath, "dependencies"));
fse.copySync(nodePtyModule, path.join(cliBuildPath, "dependencies", "pty.node"));
fse.copySync(spdlogModule, path.join(cliBuildPath, "dependencies", "spdlog.node"));
fse.copySync(ripgrepPath, path.join(cliBuildPath, "dependencies", "rg"));
});
const buildServerBundle = register("build:server:bundle", async (runner) => {
const cliPath = path.join(pkgsPath, "server");
runner.cwd = cliPath;
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
});
const buildBootstrapFork = register("build:bootstrap-fork", async (runner) => {
await ensureInstalled();
await ensurePatched();
const vscodePkgPath = path.join(pkgsPath, "vscode");
runner.cwd = vscodePkgPath;
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:bootstrap-fork"]);
});
const buildAppBrowser = register("build:app:browser", async (runner) => {
await ensureInstalled();
const appPath = path.join(pkgsPath, "app/browser");
runner.cwd = appPath;
fse.removeSync(path.join(appPath, "out"));
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
});
const buildWeb = register("build:web", async (runner) => {
await ensureInstalled();
await ensurePatched();
const webPath = path.join(pkgsPath, "web");
runner.cwd = webPath;
fse.removeSync(path.join(webPath, "out"));
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
});
const extDirPath = path.join("lib", "vscode-default-extensions");
const copyForDefaultExtensions = register("build:copy-vscode", async (runner) => {
if (!fs.existsSync(defaultExtensionsPath)) {
await ensureClean();
await ensureInstalled();
await new Promise((resolve, reject): void => {
fse.remove(extDirPath, (err) => {
if (err) {
return reject(err);
}
resolve();
});
});
await new Promise((resolve, reject): void => {
fse.copy(vscodePath, extDirPath, (err) => {
if (err) {
return reject(err);
}
resolve();
});
});
}
});
const buildDefaultExtensions = register("build:default-extensions", async (runner) => {
if (!fs.existsSync(defaultExtensionsPath)) {
await copyForDefaultExtensions();
runner.cwd = extDirPath;
const resp = await runner.execute(isWin ? "npx.cmd" : "npx", [isWin ? "gulp.cmd" : "gulp", "vscode-linux-x64", "--max-old-space-size=32384"]);
if (resp.exitCode !== 0) {
throw new Error(`Failed to build default extensions: ${resp.stderr}`);
}
}
});
const ensureInstalled = register("vscode:install", async (runner) => {
await ensureCloned();
runner.cwd = vscodePath;
const install = await runner.execute(isWin ? "yarn.cmd" : "yarn", []);
if (install.exitCode !== 0) {
throw new Error(`Failed to install vscode dependencies: ${install.stderr}`);
}
});
const ensureCloned = register("vscode:clone", async (runner) => {
if (fs.existsSync(vscodePath)) {
await ensureClean();
} else {
fse.mkdirpSync(libPath);
runner.cwd = libPath;
const clone = await runner.execute("git", ["clone", "https://github.com/microsoft/vscode", "--branch", vscodeVersion, "--single-branch", "--depth=1"]);
if (clone.exitCode !== 0) {
throw new Error(`Failed to clone: ${clone.exitCode}`);
}
}
runner.cwd = vscodePath;
const checkout = await runner.execute("git", ["checkout", vscodeVersion]);
if (checkout.exitCode !== 0) {
throw new Error(`Failed to checkout: ${checkout.stderr}`);
}
});
const ensureClean = register("vscode:clean", async (runner) => {
runner.cwd = vscodePath;
const status = await runner.execute("git", ["status", "--porcelain"]);
if (status.stdout.trim() !== "") {
const clean = await runner.execute("git", ["clean", "-f", "-d", "-X"]);
if (clean.exitCode !== 0) {
throw new Error(`Failed to clean git repository: ${clean.stderr}`);
}
const removeUnstaged = await runner.execute("git", ["checkout", "--", "."]);
if (removeUnstaged.exitCode !== 0) {
throw new Error(`Failed to remove unstaged files: ${removeUnstaged.stderr}`);
}
}
const fetch = await runner.execute("git", ["fetch", "--prune"]);
if (fetch.exitCode !== 0) {
throw new Error(`Failed to fetch latest changes: ${fetch.stderr}`);
}
});
const ensurePatched = register("vscode:patch", async (runner) => {
if (!fs.existsSync(vscodePath)) {
throw new Error("vscode must be cloned to patch");
}
await ensureClean();
runner.cwd = vscodePath;
const patchPath = path.join(__dirname, "../scripts/vscode.patch");
const apply = await runner.execute("git", ["apply", "--unidiff-zero", patchPath]);
if (apply.exitCode !== 0) {
throw new Error(`Failed to apply patches: ${apply.stderr}`);
}
});
register("package", async (runner, releaseTag) => {
if (!releaseTag) {
throw new Error("Please specify the release tag.");
}
const releasePath = path.resolve(__dirname, "../release");
const archiveName = `code-server-${releaseTag}-${os.platform()}-${os.arch()}`;
const archiveDir = path.join(releasePath, archiveName);
fse.removeSync(archiveDir);
fse.mkdirpSync(archiveDir);
const binaryPath = path.join(__dirname, `../packages/server/cli-${os.platform()}-${os.arch()}`);
const binaryDestination = path.join(archiveDir, "code-server");
fse.copySync(binaryPath, binaryDestination);
fs.chmodSync(binaryDestination, "755");
["README.md", "LICENSE"].forEach((fileName) => {
fse.copySync(path.resolve(__dirname, `../${fileName}`), path.join(archiveDir, fileName));
});
runner.cwd = releasePath;
await os.platform() === "linux"
? runner.execute("tar", ["-cvzf", `${archiveName}.tar.gz`, `${archiveName}`])
: runner.execute("zip", ["-r", `${archiveName}.zip`, `${archiveName}`]);
});
run();

136
ci/README.md Normal file
View File

@@ -0,0 +1,136 @@
# ci
This directory contains scripts used for code-server's continuous integration infrastructure.
Some of these scripts contain more detailed documentation and options
in header comments.
Any file or directory in this subdirectory should be documented here.
- [./ci/lib.sh](./lib.sh)
- Contains code duplicated across these scripts.
## Publishing a release
Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub) installed.
1. Update the version of code-server in `package.json` and README.md/guide.md install examples and push a commit.
2. GitHub actions will generate the `npm-package`, `release-packages` and `release-images` artifacts.
3. Run `yarn release:github-draft` to create a GitHub draft release from the template with
the updated version.
1. Summarize the major changes in the release notes and link to the relevant issues.
4. Wait for the artifacts in step 2 to build.
5. Run `yarn release:github-assets` to download the `release-packages` artifact and then
upload them to the draft release.
6. Run some basic sanity tests on one of the released packages.
7. Publish the release.
1. CI will automatically grab the artifacts and then:
1. Publish the NPM package from `npm-package`.
2. Publish the Docker Hub image from `release-images`.
8. Update the homebrew and AUR packages.
## dev
This directory contains scripts used for the development of code-server.
- [./ci/dev/container](./dev/container)
- See [./doc/CONTRIBUTING.md](../doc/CONTRIBUTING.md) for docs on the development container.
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
- Runs formatters.
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
- Runs linters.
- [./ci/dev/test.sh](./dev/test.sh) (`yarn test`)
- Runs tests.
- [./ci/dev/ci.sh](./dev/ci.sh) (`yarn ci`)
- Runs `yarn fmt`, `yarn lint` and `yarn test`.
- [./ci/dev/vscode.sh](./dev/vscode.sh) (`yarn vscode`)
- Ensures [./lib/vscode](../lib/vscode) is cloned, patched and dependencies are installed.
- [./ci/dev/patch-vscode.sh](./dev/patch-vscode.sh) (`yarn vscode:patch`)
- Applies [./ci/dev/vscode.patch](./dev/vscode.patch) to [./lib/vscode](../lib/vscode).
- [./ci/dev/diff-vscode.sh](./dev/diff-vscode.sh) (`yarn vscode:diff`)
- Diffs [./lib/vscode](../lib/vscode) into [./ci/dev/vscode.patch](./dev/vscode.patch).
- [./ci/dev/vscode.patch](./dev/vscode.patch)
- Our patch of VS Code, see [./doc/CONTRIBUTING.md](../doc/CONTRIBUTING.md#vs-code-patch).
- Generate it with `yarn vscode:diff` and apply with `yarn vscode:patch`.
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
- Starts a process to build and launch code-server and restart on any code changes.
- Example usage in [./doc/CONTRIBUTING.md](../doc/CONTRIBUTING.md).
## build
This directory contains the scripts used to build and release code-server.
You can disable minification by setting `MINIFY=`.
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`yarn build`)
- Builds code-server into `./out` and bundles the frontend into `./dist`.
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`yarn build:vscode`)
- Builds vscode into `./lib/vscode/out-vscode`.
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
- Bundles the output of the above two scripts into a single node module at `./release`.
- [./ci/build/build-static-release.sh](./build/build-static-release.sh) (`yarn release:static`)
- Requires a node module already built into `./release` with the above script.
- Will build a static release with node and native modules bundled into `./release-static`.
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
- Removes all build artifacts.
- Will also `git reset --hard lib/vscode`.
- Useful to do a clean build.
- [./ci/build/code-server.sh](./build/code-server.sh)
- Copied into static releases to run code-server with the bundled node binary.
- [./ci/build/test-static-release.sh](./build/test-static-release.sh) (`yarn test:static-release`)
- Ensures code-server in the `./release-static` directory works by installing an extension.
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
- Packages `./release-static` into a `.tar.gz` archive in `./release-packages`.
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
- Used to configure [nfpm](https://github.com/goreleaser/nfpm) to generate `.deb` and `.rpm`.
- [./ci/build/code-server-nfpm.sh](./build/code-server-nfpm.sh)
- Entrypoint script for code-server for `.deb` and .rpm`.
- [./ci/build/code-server.service](./build/code-server.service)
- systemd user service packaged into the `.deb` and `.rpm`.
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`yarn release:github-draft`)
- Uses [hub](https://github.com/github/hub) to create a draft release with a template description.
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`yarn release:github-assets`)
- Downloads the release-package artifacts for the current commit from CI.
- Uses [hub](https://github.com/github/hub) to upload the artifacts to the release
specified in `package.json`.
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
- Post install script for the npm package.
- Bundled by`yarn release`.
## release-container
This directory contains the release docker container.
- [./release-container/build.sh](./release-container/build.sh)
- Builds the release container with the tag `codercom/code-server-$ARCH:$VERSION`.
- Assumes debian releases are ready in `./release-packages`.
## container
This directory contains the container for CI.
## steps
This directory contains the scripts used in CI.
Helps avoid clobbering the CI configuration.
- [./steps/fmt.sh](./steps/fmt.sh)
- Runs `yarn fmt` after ensuring VS Code is patched.
- [./steps/lint.sh](./steps/lint.sh)
- Runs `yarn lint` after ensuring VS Code is patched.
- [./steps/test.sh](./steps/test.sh)
- Runs `yarn test` after ensuring VS Code is patched.
- [./steps/release.sh](./steps/release.sh)
- Runs the release process.
- Generates the npm package at `./release`.
- [./steps/release-static.sh](./steps/release-static.sh)
- Takes the output of the previous script and generates a static release and
release packages into `release-packages`.
- [./steps/publish-npm.sh](./steps/publish-npm.sh)
- Grabs the `npm-package` release artifact for the current commit and publishes it on npm.
- [./steps/build-docker-image.sh](./steps/build-docker-image.sh)
- Builds the docker image and then saves it into `./release-images/code-server-$ARCH-$VERSION.tar`.
- [./steps/push-docker-manifest.sh](./steps/push-docker-manifest.sh)
- Loads all images in `./release-images` and then builds and pushes a multi architecture
docker manifest for the amd64 and arm64 images to `codercom/code-server:$VERSION` and
`codercom/code-server:latest`.

29
ci/build/build-code-server.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
# Builds code-server into out and the frontend into dist.
# MINIFY controls whether parcel minifies dist.
MINIFY=${MINIFY-true}
main() {
cd "$(dirname "${0}")/../.."
npx tsc --outDir out --tsBuildInfoFile .cache/out.tsbuildinfo
# If out/node/entry.js does not already have the shebang,
# we make sure to add it and make it executable.
if ! grep -q -m1 "^#!/usr/bin/env node" out/node/entry.js; then
sed -i.bak "1s;^;#!/usr/bin/env node\n;" out/node/entry.js && rm out/node/entry.js.bak
chmod +x out/node/entry.js
fi
npx parcel build \
--public-url "/static/$(git rev-parse HEAD)/dist" \
--out-dir dist \
$([[ $MINIFY ]] || echo --no-minify) \
src/browser/pages/app.ts \
src/browser/register.ts \
src/browser/serviceWorker.ts
}
main "$@"

46
ci/build/build-packages.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -euo pipefail
# Packages code-server for the current OS and architecture into ./release-packages.
# This script assumes that a static release is built already into ./release-static.
main() {
cd "$(dirname "${0}")/../.."
source ./ci/lib.sh
local release_name="code-server-$VERSION-$OS-$ARCH"
mkdir -p release-packages
if [[ $OS == "linux" ]]; then
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-static/$release_name/" ./release-static
else
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-static/$release_name/" release-static
fi
echo "done (release-packages/$release_name)"
release_gcp
if [[ $OSTYPE == linux* ]]; then
release_nfpm
fi
}
release_gcp() {
mkdir -p "release-gcp/$VERSION"
cp "release-packages/$release_name.tar.gz" "./release-gcp/$VERSION/$OS-$ARCH.tar.gz"
mkdir -p "release-gcp/latest"
cp "./release-packages/$release_name.tar.gz" "./release-gcp/latest/$OS-$ARCH.tar.gz"
}
# Generates deb and rpm packages.
release_nfpm() {
local nfpm_config
nfpm_config=$(envsubst < ./ci/build/nfpm.yaml)
# The underscores are convention for .deb.
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${ARCH}.deb"
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server-$VERSION-$ARCH.rpm"
}
main "$@"

93
ci/build/build-release.sh Executable file
View File

@@ -0,0 +1,93 @@
#!/usr/bin/env bash
set -euo pipefail
# This script requires vscode to be built with matching MINIFY.
# MINIFY controls whether minified vscode is bundled.
MINIFY="${MINIFY-true}"
main() {
cd "$(dirname "${0}")/../.."
source ./ci/lib.sh
VSCODE_SRC_PATH="lib/vscode"
VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode"
mkdir -p "$RELEASE_PATH"
bundle_code_server
bundle_vscode
rsync README.md "$RELEASE_PATH"
rsync LICENSE.txt "$RELEASE_PATH"
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
}
bundle_code_server() {
rsync out dist "$RELEASE_PATH"
# For source maps and images.
mkdir -p "$RELEASE_PATH/src/browser"
rsync src/browser/media/ "$RELEASE_PATH/src/browser/media"
mkdir -p "$RELEASE_PATH/src/browser/pages"
rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages"
# Adds the commit to package.json
jq --slurp '.[0] * .[1]' package.json <(
cat << EOF
{
"commit": "$(git rev-parse HEAD)",
"scripts": {
"postinstall": "./postinstall.sh"
}
}
EOF
) > "$RELEASE_PATH/package.json"
rsync yarn.lock "$RELEASE_PATH"
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
}
bundle_vscode() {
mkdir -p "$VSCODE_OUT_PATH"
rsync "$VSCODE_SRC_PATH/package.json" "$VSCODE_OUT_PATH"
rsync "$VSCODE_SRC_PATH/yarn.lock" "$VSCODE_OUT_PATH"
rsync "$VSCODE_SRC_PATH/node_modules" "$VSCODE_OUT_PATH"
rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY+-min}/" "$VSCODE_OUT_PATH/out"
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
mkdir -p "$VSCODE_OUT_PATH/resources/linux"
rsync "$VSCODE_SRC_PATH/resources/linux/code.png" "$VSCODE_OUT_PATH/resources/linux/code.png"
# Adds the commit and date to product.json
jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <(
cat << EOF
{
"commit": "$(git rev-parse HEAD)",
"date": $(jq -n 'now | todate')
}
EOF
) > "$VSCODE_OUT_PATH/product.json"
pushd "$VSCODE_OUT_PATH"
yarn --production --frozen-lockfile --ignore-scripts
popd
# We clear any native module builds.
local native_modules
mapfile -t native_modules < <(find "$VSCODE_OUT_PATH/node_modules" -name "binding.gyp" -exec dirname {} \;)
local nm
for nm in "${native_modules[@]}"; do
rm -R "$nm/build"
done
# We have to rename node_modules to node_modules.bundled to avoid them being ignored by yarn.
local node_modules
mapfile -t node_modules < <(find "$VSCODE_OUT_PATH" -depth -name "node_modules")
local nm
for nm in "${node_modules[@]}"; do
rm -Rf "$nm.bundled"
mv "$nm" "$nm.bundled"
done
}
main "$@"

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "${0}")/../.."
source ./ci/lib.sh
rsync "$RELEASE_PATH/" "$RELEASE_PATH-static"
RELEASE_PATH+=-static
# We cannot find the path to node from $PATH because yarn shims a script to ensure
# we use the same version it's using so we instead run a script with yarn that
# will print the path to node.
local node_path
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
mkdir -p "$RELEASE_PATH/bin"
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
rsync "$node_path" "$RELEASE_PATH/lib/node"
cd "$RELEASE_PATH"
yarn --production --frozen-lockfile
}
main "$@"

21
ci/build/build-vscode.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
# Builds vscode into lib/vscode/out-vscode.
# MINIFY controls whether a minified version of vscode is built.
MINIFY=${MINIFY-true}
main() {
cd "$(dirname "${0}")/../.."
cd lib/vscode
yarn gulp compile-build
yarn gulp compile-extensions-build
yarn gulp optimize --gulpfile ./coder.js
if [[ $MINIFY ]]; then
yarn gulp minify --gulpfile ./coder.js
fi
}
main "$@"

24
ci/build/clean.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "${0}")/../.."
source ./ci/lib.sh
rm -Rf \
out \
release \
release-static \
release-packages \
release-gcp \
dist \
.tsbuildinfo \
.cache/out.tsbuildinfo
pushd lib/vscode
git clean -xffd
git reset --hard
popd
}
main "$@"

3
ci/build/code-server-nfpm.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec /usr/lib/code-server/bin/code-server "$@"

View File

@@ -0,0 +1,11 @@
[Unit]
Description=code-server
After=network.target
[Service]
Type=exec
ExecStart=/usr/bin/code-server
Restart=always
[Install]
WantedBy=default.target

20
ci/build/code-server.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env sh
# This script is intended to be bundled into the static releases.
# Runs code-server with the bundled Node binary.
# More complicated than readlink -f or realpath to support macOS.
# See https://github.com/cdr/code-server/issues/1537
bin_dir() {
# We read the symlink, which may be relative from $0.
dst="$(readlink "$0")"
# We cd into the $0 directory.
cd "$(dirname "$0")" || exit 1
# Now we can cd into the dst directory.
cd "$(dirname "$dst")" || exit 1
# Finally we use pwd -P to print the absolute path of the directory of $dst.
pwd -P || exit 1
}
BIN_DIR=$(bin_dir)
exec "$BIN_DIR/../lib/node" "$BIN_DIR/.." "$@"

17
ci/build/nfpm.yaml Normal file
View File

@@ -0,0 +1,17 @@
name: "code-server"
arch: "${ARCH}"
platform: "linux"
version: "v${VERSION}"
section: "devel"
priority: "optional"
maintainer: "Anmol Sethi <hi@nhooyr.io>"
description: |
Run VS Code in the browser.
vendor: "Coder"
homepage: "https://github.com/cdr/code-server"
license: "MIT"
bindir: "/usr/bin"
files:
./ci/build/code-server-nfpm.sh: /usr/bin/code-server
./ci/build/code-server.service: /usr/lib/systemd/user/code-server.service
./release-static/**/*: "/usr/lib/code-server/"

47
ci/build/npm-postinstall.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env sh
set -eu
main() {
# Grabs the major version of node from $npm_config_user_agent which looks like
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p')
if [ "$major_node_version" -lt 12 ]; then
echo "code-server currently requires at least node v12"
echo "We have detected that you are on node v$major_node_version"
echo "See https://github.com/cdr/code-server/issues/1633"
exit 1
fi
case "${npm_config_user_agent-}" in npm*)
# We are running under npm.
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
echo "Please pass --unsafe-perm to npm to install code-server"
echo "Otherwise the postinstall script does not have permissions to run"
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
exit 1
fi
;;
esac
cd lib/vscode
# We have to rename node_modules.bundled to node_modules.
# The bundled modules were renamed originally to avoid being ignored by yarn.
node_modules="$(find . -depth -name "node_modules.bundled")"
for nm in $node_modules; do
rm -Rf "${nm%.bundled}"
mv "$nm" "${nm%.bundled}"
done
# $npm_config_global makes npm rebuild return without rebuilding.
unset npm_config_global
# Rebuilds native modules.
if ! npm rebuild; then
echo "You may not have the required dependencies to build the native modules."
echo "Please see https://github.com/cdr/code-server/blob/master/doc/npm.md"
exit 1
fi
}
main "$@"

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
# Downloads the release artifacts from CI for the current
# commit and then uploads them to the release with the version
# in package.json.
# You will need $GITHUB_TOKEN set.
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
download_artifact release-packages ./release-packages
local assets=(./release-packages/*)
for i in "${!assets[@]}"; do
assets[$i]="--attach=${assets[$i]}"
done
EDITOR=true hub release edit --draft "${assets[@]}" "v$VERSION"
}
main "$@"

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
# Creates a draft release with the template for the version in package.json
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
hub release create \
--file - \
--draft "${assets[@]}" "v$VERSION" << EOF
v$VERSION
VS Code v$(vscode_version)
- Summarize changes here with references to issues
EOF
}
main "$@"

27
ci/build/test-static-release.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
# Makes sure the release works.
# This is to make sure we don't have Node version errors or any other
# compilation-related errors.
main() {
cd "$(dirname "${0}")/../.."
local EXTENSIONS_DIR
EXTENSIONS_DIR="$(mktemp -d)"
echo "Testing static release"
./release-static/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
local installed_extensions
installed_extensions="$(./release-static/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
if [[ $installed_extensions != "ms-python.python" ]]; then
echo "Unexpected output from listing extensions:"
echo "$installed_extensions"
exit 1
fi
echo "Static release works correctly"
}
main "$@"

43
ci/container/Dockerfile Normal file
View File

@@ -0,0 +1,43 @@
FROM debian
RUN apt-get update
# Needed for debian repositories added below.
RUN apt-get install -y curl gnupg
# Installs node.
RUN curl -sSL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Installs yarn.
RUN curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y yarn
# Installs VS Code build deps.
RUN apt-get install -y build-essential \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev
# Installs envsubst.
RUN apt-get install -y gettext-base
# Misc build dependencies.
RUN apt-get install -y jq git rsync
# Installs shellcheck.
RUN curl -sSL https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \
tar -xJ && \
mv shellcheck*/shellcheck /usr/local/bin && \
rm -R shellcheck*
# Install Go dependencies
RUN ARCH="$(dpkg --print-architecture)" && \
curl -sSL "https://dl.google.com/go/go1.14.3.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
ENV GO111MODULE=on
RUN go get mvdan.cc/sh/v3/cmd/shfmt
RUN go get github.com/goreleaser/nfpm/cmd/nfpm
RUN curl -fsSL https://get.docker.com | sh

12
ci/dev/ci.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
yarn fmt
yarn lint
yarn test
}
main "$@"

View File

@@ -0,0 +1,13 @@
FROM node:12
RUN apt-get update && apt-get install -y \
curl \
iproute2 \
vim \
iptables \
net-tools \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev
CMD ["/bin/bash"]

48
ci/dev/container/exec.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail
# Opens an interactive bash session inside of a docker container
# for improved isolation during development.
# If the container exists it is restarted if necessary, then reused.
main() {
cd "$(dirname "${0}")/../../.."
local container_name=code-server-dev
if docker inspect $container_name &> /dev/null; then
echo "-- Starting container"
docker start "$container_name" > /dev/null
enter
exit 0
fi
build
run
enter
}
enter() {
echo "--- Entering $container_name"
docker exec -it "$container_name" /bin/bash
}
run() {
echo "--- Spawning $container_name"
docker run \
-it \
--name $container_name \
"-v=$PWD:/code-server" \
"-w=/code-server" \
"-p=127.0.0.1:8080:8080" \
$(if [[ -t 0 ]]; then echo -it; fi) \
"$container_name"
}
build() {
echo "--- Building $container_name"
docker build -t $container_name ./ci/dev/container > /dev/null
}
main "$@"

12
ci/dev/diff-vscode.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
cd ./lib/vscode
git add -A
git diff HEAD > ../../ci/dev/vscode.patch
}
main "$@"

36
ci/dev/fmt.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
shfmt -i 2 -w -s -sr $(git ls-files "*.sh")
local prettierExts
prettierExts=(
"*.js"
"*.ts"
"*.tsx"
"*.html"
"*.json"
"*.css"
"*.md"
"*.toml"
"*.yaml"
"*.yml"
)
prettier --write --loglevel=warn $(git ls-files "${prettierExts[@]}")
doctoc --title '# FAQ' doc/FAQ.md > /dev/null
doctoc --title '# Setup Guide' doc/guide.md > /dev/null
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
echo "Files need generation or are formatted incorrectly:"
git -c color.ui=always status | grep --color=no '\[31m'
echo "Please run the following locally:"
echo " yarn fmt"
exit 1
fi
}
main "$@"

13
ci/dev/lint.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
stylelint $(git ls-files "*.css")
tsc --noEmit
shellcheck -e SC2046,SC2164,SC2154 $(git ls-files "*.sh")
}
main "$@"

11
ci/dev/patch-vscode.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
cd ./lib/vscode
git apply ../../ci/dev/vscode.patch
}
main "$@"

10
ci/dev/test.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
mocha -r ts-node/register ./test/*.test.ts
}
main "$@"

3535
ci/dev/vscode.patch Normal file

File diff suppressed because it is too large Load Diff

22
ci/dev/vscode.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
# 1. Ensures VS Code is cloned.
# 2. Patches it.
# 3. Installs it.
main() {
cd "$(dirname "$0")/../.."
git submodule update --init
# If the patch fails to apply, then it's likely already applied
yarn vscode:patch &> /dev/null || true
(
cd lib/vscode
# Install VS Code dependencies.
yarn ${CI+--frozen-lockfile}
)
}
main "$@"

163
ci/dev/watch.ts Normal file
View File

@@ -0,0 +1,163 @@
import * as cp from "child_process"
import Bundler from "parcel-bundler"
import * as path from "path"
async function main(): Promise<void> {
try {
const watcher = new Watcher()
await watcher.watch()
} catch (error) {
console.error(error.message)
process.exit(1)
}
}
class Watcher {
private readonly rootPath = path.resolve(__dirname, "../..")
private readonly vscodeSourcePath = path.join(this.rootPath, "lib/vscode")
private static log(message: string, skipNewline = false): void {
process.stdout.write(message)
if (!skipNewline) {
process.stdout.write("\n")
}
}
public async watch(): Promise<void> {
let server: cp.ChildProcess | undefined
const restartServer = (): void => {
if (server) {
server.kill()
}
const s = cp.fork(path.join(this.rootPath, "out/node/entry.js"), process.argv.slice(2))
console.log(`[server] spawned process ${s.pid}`)
s.on("exit", () => console.log(`[server] process ${s.pid} exited`))
server = s
}
const vscode = cp.spawn("yarn", ["watch"], { cwd: this.vscodeSourcePath })
const tsc = cp.spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath })
const bundler = this.createBundler()
const cleanup = (code?: number | null): void => {
Watcher.log("killing vs code watcher")
vscode.removeAllListeners()
vscode.kill()
Watcher.log("killing tsc")
tsc.removeAllListeners()
tsc.kill()
if (server) {
Watcher.log("killing server")
server.removeAllListeners()
server.kill()
}
Watcher.log("killing bundler")
process.exit(code || 0)
}
process.on("SIGINT", () => cleanup())
process.on("SIGTERM", () => cleanup())
vscode.on("exit", (code) => {
Watcher.log("vs code watcher terminated unexpectedly")
cleanup(code)
})
tsc.on("exit", (code) => {
Watcher.log("tsc terminated unexpectedly")
cleanup(code)
})
const bundle = bundler.bundle().catch(() => {
Watcher.log("parcel watcher terminated unexpectedly")
cleanup(1)
})
bundler.on("buildEnd", () => {
console.log("[parcel] bundled")
})
bundler.on("buildError", (error) => {
console.error("[parcel]", error)
})
vscode.stderr.on("data", (d) => process.stderr.write(d))
tsc.stderr.on("data", (d) => process.stderr.write(d))
// From https://github.com/chalk/ansi-regex
const pattern = [
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))",
].join("|")
const re = new RegExp(pattern, "g")
/**
* Split stdout on newlines and strip ANSI codes.
*/
const onLine = (proc: cp.ChildProcess, callback: (strippedLine: string, originalLine: string) => void): void => {
let buffer = ""
if (!proc.stdout) {
throw new Error("no stdout")
}
proc.stdout.setEncoding("utf8")
proc.stdout.on("data", (d) => {
const data = buffer + d
const split = data.split("\n")
const last = split.length - 1
for (let i = 0; i < last; ++i) {
callback(split[i].replace(re, ""), split[i])
}
// The last item will either be an empty string (the data ended with a
// newline) or a partial line (did not end with a newline) and we must
// wait to parse it until we get a full line.
buffer = split[last]
})
}
let startingVscode = false
let startedVscode = false
onLine(vscode, (line, original) => {
console.log("[vscode]", original)
// Wait for watch-client since "Finished compilation" will appear multiple
// times before the client starts building.
if (!startingVscode && line.includes("Starting watch-client")) {
startingVscode = true
} else if (startingVscode && line.includes("Finished compilation")) {
if (startedVscode) {
bundle.then(restartServer)
}
startedVscode = true
}
})
onLine(tsc, (line, original) => {
// tsc outputs blank lines; skip them.
if (line !== "") {
console.log("[tsc]", original)
}
if (line.includes("Watching for file changes")) {
bundle.then(restartServer)
}
})
}
private createBundler(out = "dist"): Bundler {
return new Bundler(
[
path.join(this.rootPath, "src/browser/pages/app.ts"),
path.join(this.rootPath, "src/browser/register.ts"),
path.join(this.rootPath, "src/browser/serviceWorker.ts"),
],
{
outDir: path.join(this.rootPath, out),
cacheDir: path.join(this.rootPath, ".cache"),
minify: !!process.env.MINIFY,
logLevel: 1,
publicUrl: "/static/development/dist",
},
)
}
}
main()

95
ci/lib.sh Executable file
View File

@@ -0,0 +1,95 @@
#!/usr/bin/env bash
pushd() {
builtin pushd "$@" > /dev/null
}
popd() {
builtin popd > /dev/null
}
pkg_json_version() {
jq -r .version package.json
}
vscode_version() {
jq -r .version lib/vscode/package.json
}
os() {
local os
os=$(uname | tr '[:upper:]' '[:lower:]')
if [[ $os == "linux" ]]; then
# Alpine's ldd doesn't have a version flag but if you use an invalid flag
# (like --version) it outputs the version to stderr and exits with 1.
local ldd_output
ldd_output=$(ldd --version 2>&1 || true)
if echo "$ldd_output" | grep -iq musl; then
os="alpine"
fi
elif [[ $os == "darwin" ]]; then
os="macos"
fi
echo "$os"
}
arch() {
case "$(uname -m)" in
aarch64)
echo arm64
;;
x86_64)
echo amd64
;;
*)
echo "unknown architecture $(uname -a)"
exit 1
;;
esac
}
curl() {
command curl -H "Authorization: token $GITHUB_TOKEN" "$@"
}
# Grabs the most recent ci.yaml github workflow run that was successful and triggered from the same commit being pushd.
# This will contain the artifacts we want.
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
get_artifacts_url() {
curl -sSL 'https://api.github.com/repos/cdr/code-server/actions/workflows/ci.yaml/runs?status=success&event=push' | jq -r ".workflow_runs[] | select(.head_sha == \"$(git rev-parse HEAD)\") | .artifacts_url" | head -n 1
}
# Grabs the artifact's download url.
# https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts
get_artifact_url() {
local artifact_name="$1"
curl -sSL "$(get_artifacts_url)" | jq -r ".artifacts[] | select(.name == \"$artifact_name\") | .archive_download_url" | head -n 1
}
# Uses the above two functions to download a artifact into a directory.
download_artifact() {
local artifact_name="$1"
local dst="$2"
local tmp_file
tmp_file="$(mktemp)"
curl -sSL "$(get_artifact_url "$artifact_name")" > "$tmp_file"
unzip -q -o "$tmp_file" -d "$dst"
rm "$tmp_file"
}
rsync() {
command rsync -a --del "$@"
}
VERSION="$(pkg_json_version)"
export VERSION
ARCH="$(arch)"
export ARCH
OS=$(os)
export OS
# RELEASE_PATH is the destination directory for the release from the root.
# Defaults to release
RELEASE_PATH="${RELEASE_PATH-release}"

View File

@@ -0,0 +1,43 @@
FROM debian:10
RUN apt-get update \
&& apt-get install -y \
curl \
dumb-init \
htop \
locales \
man \
nano \
git \
procps \
ssh \
sudo \
vim \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# https://wiki.debian.org/Locale#Manually
RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
&& locale-gen
ENV LANG=en_US.UTF-8
RUN chsh -s /bin/bash
ENV SHELL=/bin/bash
RUN adduser --gecos '' --disabled-password coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
RUN ARCH="$(dpkg --print-architecture)" && \
curl -sSL "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
COPY release-packages/code-server*.deb /tmp/
RUN dpkg -i /tmp/code-server*$(dpkg --print-architecture).deb && rm /tmp/code-server*.deb
EXPOSE 8080
USER coder
WORKDIR /home/coder
ENTRYPOINT ["dumb-init", "fixuid", "-q", "/usr/bin/code-server", "--bind-addr", "0.0.0.0:8080", "."]

11
ci/release-container/build.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
docker build -t "codercom/code-server-$ARCH:$VERSION" -f ./ci/release-container/Dockerfile .
}
main "$@"

14
ci/steps/build-docker-image.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
./ci/release-container/build.sh
mkdir -p release-images
docker save "codercom/code-server-$ARCH:$VERSION" > "release-images/code-server-$ARCH-$VERSION.tar"
}
main "$@"

17
ci/steps/fmt.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
yarn --frozen-lockfile
git submodule update --init
# We do not `yarn vscode` to make test.sh faster.
# If the patch fails to apply, then it's likely already applied
yarn vscode:patch &> /dev/null || true
yarn fmt
}
main "$@"

17
ci/steps/lint.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
yarn --frozen-lockfile
git submodule update --init
# We do not `yarn vscode` to make test.sh faster.
# If the patch fails to apply, then it's likely already applied
yarn vscode:patch &> /dev/null || true
yarn lint
}
main "$@"

18
ci/steps/publish-npm.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
if [[ ${CI-} ]]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
fi
download_artifact npm-package ./release
# https://github.com/actions/upload-artifact/issues/38
chmod +x $(grep -rl '^#!/.*' release)
yarn publish --non-interactive release
}
main "$@"

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
download_artifact release-images ./release-images
if [[ ${CI-} ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
for img in ./release-images/*; do
docker load -i "$img"
done
# We have to ensure the amd64 and arm64 images exist on the remote registry
# in order to build the manifest.
# We don't put the arch in the tag to avoid polluting the main repository.
# These other repositories are private so they don't pollute our organization namespace.
docker push "codercom/code-server-amd64:$VERSION"
docker push "codercom/code-server-arm64:$VERSION"
export DOCKER_CLI_EXPERIMENTAL=enabled
docker manifest create "codercom/code-server:$VERSION" \
"codercom/code-server-amd64:$VERSION" \
"codercom/code-server-arm64:$VERSION"
docker manifest push --purge "codercom/code-server:$VERSION"
docker manifest create "codercom/code-server:latest" \
"codercom/code-server-amd64:$VERSION" \
"codercom/code-server-arm64:$VERSION"
docker manifest push --purge "codercom/code-server:latest"
}
main "$@"

15
ci/steps/release-static.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
# https://github.com/actions/upload-artifact/issues/38
chmod +x $(grep -rl '^#!/.*' release)
yarn release:static
yarn test:static-release
yarn package
}
main "$@"

14
ci/steps/release.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
yarn --frozen-lockfile
yarn vscode
yarn build
yarn build:vscode
yarn release
}
main "$@"

17
ci/steps/test.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
yarn --frozen-lockfile
git submodule update --init
# We do not `yarn vscode` to make test.sh faster.
# If the patch fails to apply, then it's likely already applied
yarn vscode:patch &> /dev/null || true
yarn test
}
main "$@"

117
doc/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,117 @@
# Contributing
- [Detailed CI and build process docs](../ci)
## Requirements
Please refer to [VS Code's prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
Differences:
- We require a minimum of node v12 but later versions should work.
- We use [fnpm](https://github.com/goreleaser/nfpm) to build `.deb` and `.rpm` packages.
- The [CI container](../ci/container/Dockerfile) is a useful reference for all our dependencies.
## Development Workflow
```shell
yarn
yarn vscode
yarn watch
# Visit http://localhost:8080 once the build completed.
```
To develop inside of an isolated docker container:
```shell
./ci/dev/container/exec.sh
root@12345:/code-server# yarn
root@12345:/code-server# yarn vscode
root@12345:/code-server# yarn watch
```
Any changes made to the source will be live reloaded.
If changes are made to the patch and you've built previously you must manually
reset VS Code then run `yarn vscode:patch`.
## Build
```shell
yarn
yarn vscode
yarn build
yarn build:vscode
yarn release
cd release
yarn --production
# Runs the built JavaScript with Node.
node .
```
Now you can make it static and build packages with:
```
yarn release:static
yarn test:static-release
yarn package
# The static release is in ./release-static
# .deb, .rpm and the static archive are in ./release-packages
```
## Structure
The `code-server` script serves an HTTP API to login and start a remote VS Code process.
The CLI code is in [./src/node](./src/node) and the HTTP routes are implemented in
[./src/node/app](./src/node/app).
Most of the meaty parts are in our VS Code patch which is described next.
### VS Code Patch
Back in v1 of code-server, we had an extensive patch of VS Code that split the codebase
into a frontend and server. The frontend consisted of all UI code and the server ran
the extensions and exposed an API to the frontend for file access and everything else
that the UI needed.
This worked but eventually Microsoft added support to VS Code to run it in the web.
They have open sourced the frontend but have kept the server closed source.
So in interest of piggy backing off their work, v2 and beyond use the VS Code
web frontend and fill in the server. This is contained in our
[./ci/dev/vscode.patch](../ci/dev/vscode.patch) under the path `src/vs/server`.
Other notable changes in our patch include:
- Add our own build file which includes our code and VS Code's web code.
- Allow multiple extension directories (both user and built-in).
- Modify the loader, websocket, webview, service worker, and asset requests to
use the URL of the page as a base (and TLS if necessary for the websocket).
- Send client-side telemetry through the server.
- Allow modification of the display language.
- Make it possible for us to load code on the client.
- Make extensions work in the browser.
- Make it possible to install extensions of any kind.
- Fix getting permanently disconnected when you sleep or hibernate for a while.
- Add connection type to web socket query parameters.
Some known issues presently:
- Creating custom VS Code extensions and debugging them doesn't work.
- Extension profiling and tips are currently disabled.
As the web portion of VS Code matures, we'll be able to shrink and maybe even entirely
eliminate our patch. In the meantime, however, upgrading the VS Code version requires
ensuring that the patch still applies and has the intended effects.
To generate a new patch run `yarn vscode:diff`.
**note**: We have extension docs on the CI and build system at [./ci/README.md](../ci/README.md)
If functionality doesn't depend on code from VS Code then it should be moved
into code-server otherwise it should be in the patch.
In the future we'd like to run VS Code unit tests against our builds to ensure features
work as expected.

235
doc/FAQ.md Normal file
View File

@@ -0,0 +1,235 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# FAQ
- [Questions?](#questions)
- [What's the deal with extensions?](#whats-the-deal-with-extensions)
- [Where are extensions stored?](#where-are-extensions-stored)
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
- [Sub-domains](#sub-domains)
- [Sub-paths](#sub-paths)
- [Multi-tenancy](#multi-tenancy)
- [Docker in code-server docker container?](#docker-in-code-server-docker-container)
- [Collaboration](#collaboration)
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
- [Heartbeat file](#heartbeat-file)
- [How does the config file work?](#how-does-the-config-file-work)
- [Enterprise](#enterprise)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Questions?
Please file all questions and support requests at https://www.reddit.com/r/codeserver/.
The issue tracker is **only** for bugs.
## What's the deal with extensions?
Unfortunately, the Microsoft VS Code Marketplace license prohibits use with any non Microsoft
product.
See https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf
> Marketplace Offerings are intended for use only with Visual Studio Products and Services
> and you may only install and use Marketplace Offerings with Visual Studio Products and Services.
As a result, Coder has created its own marketplace for open source extensions. It works by scraping
GitHub for VS Code extensions and building them. It's not perfect but getting better by the day with
more and more extensions.
Issue [#1299](https://github.com/cdr/code-server/issues/1299) is a big one in making the experience here
better by allowing the community to submit extensions and repos to avoid waiting until the scraper finds
an extension.
If an extension is not available or does not work, you can grab its VSIX from its Github releases or
build it yourself. Then run the `Extensions: Install from VSIX` command in the Command Palette and
point to the .vsix file.
See below for installing an extension from the cli.
Feel free to file an issue to add a missing extension to the marketplace.
If you have your own custom marketplace, it is possible to point code-server to it by setting
`$SERVICE_URL` and `$ITEM_URL` to point to it.
## Where are extensions stored?
Defaults to `~/.local/share/code-server/extensions`.
If the `XDG_DATA_HOME` environment variable is set the data directory will be
`$XDG_DATA_HOME/code-server/extensions`. In general we try to follow the XDG directory spec.
You can install an extension on the CLI with:
```bash
# From the Coder extension marketplace
code-server --install-extension ms-python.python
# From a downloaded VSIX on the file system
code-server --install-extension downloaded-ms-python.python.vsix
```
## How is this different from VS Code Codespaces?
VS Code Codespaces is a closed source and paid service by Microsoft. It also allows you to access
VS Code via the browser.
However, code-server is free, open source and can be ran on any machine without any limitations.
While you can self host environments with VS Code Codespaces, you still need to an Azure billing
account and you access VS Code via the Codespaces web dashboard instead of directly connecting to
your instance.
## How should I expose code-server to the internet?
Please follow [./guide.md](./guide.md) for our recommendations on setting up and using code-server.
code-server only supports password authentication natively.
**note**: code-server will rate limit password authentication attempts at 2 a minute and 12 an hour.
If you want to use external authentication (i.e sign in with Google) you should handle this
with a reverse proxy using something like [oauth2_proxy](https://github.com/pusher/oauth2_proxy).
For HTTPS, you can use a self signed certificate by passing in just `--cert` or
pass in an existing certificate by providing the path to `--cert` and the path to
its key with `--cert-key`.
If `code-server` has been passed a certificate it will also respond to HTTPS
requests and will redirect all HTTP requests to HTTPS. Otherwise it will respond
only to HTTP requests.
You can use [Let's Encrypt](https://letsencrypt.org/) to get an SSL certificate
for free.
Again, Please follow [./guide.md](./guide.md) for our recommendations on setting up and using code-server.
## How do I securely access web services?
code-server is capable of proxying to any port using either a subdomain or a
subpath which means you can securely access these services using code-server's
built-in authentication.
### Sub-domains
You will need a DNS entry that points to your server for each port you want to
access. You can either set up a wildcard DNS entry for `*.<domain>` if your domain
name registrar supports it or you can create one for every port you want to
access (`3000.<domain>`, `8080.<domain>`, etc).
You should also set up TLS certificates for these subdomains, either using a
wildcard certificate for `*.<domain>` or individual certificates for each port.
Start code-server with the `--proxy-domain` flag set to your domain.
```
code-server --proxy-domain <domain>
```
Now you can browse to `<port>.<domain>`. Note that this uses the host header so
ensure your reverse proxy forwards that information if you are using one.
### Sub-paths
Just browse to `/proxy/<port>/`.
## Multi-tenancy
If you want to run multiple code-server's on shared infrastructure, we recommend using virtual
machines with a VM per user. This will easily allow users to run a docker daemon. If you want
to use kubernetes, you'll definitely want to use [kubevirt](https://kubevirt.io) to give each
user a virtual machine instead of just a container. Docker in docker while supported requires
privileged containers which are a security risk in a multi tenant infrastructure.
## Docker in code-server docker container?
If you'd like to access docker inside of code-server, we'd recommend running a docker:dind container
and mounting in a directory to share between dind and the code-server container at /var/run. After, install
the docker CLI in the code-server container and you should be able to access the daemon as the socket
will be shared at /var/run/docker.sock.
In order to make volume mounts work, mount the home directory in the code-server container and the
dind container at the same path. i.e you'd volume mount a directory from the host to `/home/coder`
on both. This will allow any volume mounts in the home directory to work. Similar process
to make volume mounts in any other directory work.
## Collaboration
We understand the high demand but the team is swamped right now.
You can follow progress at [#33](https://github.com/cdr/code-server/issues/33).
## How can I disable telemetry?
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
data collected only to improve code-server.
## How does code-server decide what workspace or folder to open?
code-server tries the following in order:
1. The `workspace` query parameter.
2. The `folder` query parameter.
3. The workspace or directory passed on the command line.
4. The last opened workspace or directory.
## How do I debug issues with code-server?
First run code-server with at least `debug` logging (or `trace` to be really
thorough) by setting the `--log` flag or the `LOG_LEVEL` environment variable.
`-vvv` and `--verbose` are aliases for `--log trace`.
```
code-server --log debug
```
Once this is done, replicate the issue you're having then collect logging
information from the following places:
1. stdout
2. The most recently created directory in the `~/.local/share/code-server/logs` directory
3. The browser console and network tabs.
Additionally, collecting core dumps (you may need to enable them first) if
code-server crashes can be helpful.
## Heartbeat file
`code-server` touches `~/.local/share/code-server/heartbeat` once a minute as long
as there is an active browser connection.
If you want to shutdown `code-server` if there hasn't been an active connection in X minutes
you can do so by continuously checking the last modified time on the heartbeat file and if it is
older than X minutes, you should kill `code-server`.
[#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better.
## How does the config file work?
When `code-server` starts up, it creates a default config file in `~/.config/code-server/config.yaml` that looks
like this:
```yaml
bind-addr: 127.0.0.1:8080
auth: password
password: mewkmdasosafuio3422 # This is randomly generated for each config.yaml
cert: false
```
Each key in the file maps directly to a `code-server` flag. Run `code-server --help` to see
a listing of all the flags.
The default config here says to listen on the loopback IP port 8080, enable password authorization
and no TLS. Any flags passed to `code-server` will take priority over the config file.
The `--config` flag or `$CODE_SERVER_CONFIG` can be used to change the config file's location.
## Enterprise
Visit [our enterprise page](https://coder.com) for more information about our
enterprise offerings.

View File

@@ -1,57 +0,0 @@
# Deploy on AWS
This tutorial shows you how to deploy `code-server` on an EC2 AWS instance.
If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup)
---
## Deploy to EC2
### Use the AWS wizard
- Click **Launch Instance** from your [EC2 dashboard](https://console.aws.amazon.com/ec2/v2/home).
- Select the Ubuntu Server 16.04 LTS (HVM), SSD Volume Type (`ami-0f9cf087c1f27d9b1)` at this time of writing)
- Select an appropriate instance size (we recommend t2.medium/large, depending on team size and number of repositories/languages enabled), then **Next: Configure Instance Details**
- Select **Next: ...** until you get to the **Configure Security Group** page, then add the default **HTTP** rule (port range "80", source "0.0.0.0/0, ::/0")
> Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance. We recommend setting [security group rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html?icmpid=docs_ec2_console) to allow access from known IP addresses only.
- Click **Launch**
- You will be prompted to create a key pair
> A key pair consists of a public key that AWS stores, and a private key file that you store. Together, they allow you to connect to your instance securely. For Windows AMIs, the private key file is required to obtain the password used to log into your instance. For Linux AMIs, the private key file allows you to securely SSH into your instance.
- From the dropdown choose "create a new pair", give the key pair a name
- Click **Download Key Pair**
> This is necessary before you proceed. A `.pem` file will be downloaded. make sure you store is in a safe location because it can't be retrieved once we move on.
- Finally, click **Launch Instances**
---
### SSH Into EC2 Instance
- First head to your [EC2 dashboard](https://console.aws.amazon.com/ec2/v2/home) and choose instances from the left panel
- In the description of your EC2 instance copy the public DNS (iPv4) address using the copy to clipboard button
- Open a terminal on your computer and use the following command to SSH into your EC2 instance
```
ssh -i "path/to/your/keypair.pem" ubuntu@(paste the public DNS here)
```
>example: `ssh -i "/Users/John/Downloads/TestInstance.pem" ubuntu@ec2-3-45-678-910.compute-1.amazonaws.co`
- You should see a prompt for your EC2 instance like so<img src="../../assets/aws_ubuntu.png">
- At this point it is time to download the `code-server` binary. We will of course want the linux version. Make sure you copy the link for the latest linux version on our [releases page](https://github.com/codercom/code-server/releases)
- With the URL in the clipboard, run:
```
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
```
- If you run into any permission errors, make the binary executable by running:
```
chmod +x code-server-linux
```
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
- Finally, run
```
sudo ./code-server-linux -p 80
```
- When you visit the public IP for your AWS instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
- Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">
> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed
> The `-p 80` flag is necessary in order to make the IDE accessible from the public IP of your instance (also available from the description in the instances page.
---
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).

View File

@@ -1,37 +0,0 @@
# Deploy on DigitalOcean
This tutorial shows you how to deploy `code-server` to a single node running on DigitalOcean.
If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup)
---
## Use the "Create Droplets" wizard
[Open your DigitalOcean dashboard](https://cloud.digitalocean.com/droplets/new) to create a new droplet
- **Choose an image -** Select the **Distributions** tab and then choose Ubuntu
- **Choose a size -** We recommend at least 4GB RAM and 2 CPU, more depending on team size and number of repositories/languages enabled.
- Launch your instance
- Open a terminal on your computer and SSH into your instance
> example: ssh root@203.0.113.0
- Once in the SSH session, visit code-server [releases page](https://github.com/codercom/code-server/releases/) and copy the link to the download for the latest linux release
- In the shell run the below command with the URL from your clipboard
```
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
```
- If you run into any permission errors when attempting to run the binary:
```
chmod +x code-server-linux
```
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
- Finally start the code-server
```
sudo ./code-server-linux -p 80
```
> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed
- When you visit the public IP for your Digital Ocean instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
- Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">
---
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).

View File

@@ -1,46 +0,0 @@
# Deploy on Google Cloud
This tutorial shows you how to deploy `code-server` to a single node running on Google Cloud.
If you're just starting out, we recommend [installing code-server locally](../../self-hosted/index.md). It takes only a few minutes and lets you try out all of the features. You can also try out the IDE on a container hosted [by Coder](http://coder.com/signup)
---
## Deploy to Google Cloud VM
> Pre-requisite: Please [set up Google Cloud SDK](https://cloud.google.com/sdk/docs/) on your local machine
- [Open your Google Cloud console](https://console.cloud.google.com/compute/instances) to create a new VM instance and click **Create Instance**
- Choose an appropriate machine type (we recommend 2 vCPU and 7.5 GB RAM, more depending on team size and number of repositories/languages enabled)
- Choose Ubuntu 16.04 LTS as your boot disk
- Check the boxes for **Allow HTTP traffic** and **Allow HTTPS traffic** in the **Firewall** section
- Create your VM, and **take note** of it's public IP address.
- Copy the link to download the latest Linux binary from our [releases page](https://github.com/codercom/code-server/releases)
---
## Final Steps
1. SSH into your Google Cloud VM
```
gcloud compute ssh --zone [region] [instance name]
```
2. Download the binary using the link we copied to clipboard
```
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
```
3. Make the binary executable if you run into any errors regarding permission:
```
chmod +x code-server-linux
```
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
4. Start the code-server
```
sudo ./code-server-linux -p 80
```
> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed
5. Access code-server from the public IP of your Google Cloud instance we noted earlier in your browser.
> example: 32.32.32.234
6. You will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
7. Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">
---
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

BIN
doc/assets/code-server.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

245
doc/guide.md Normal file
View File

@@ -0,0 +1,245 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# Setup Guide
- [1. Acquire a remote machine](#1-acquire-a-remote-machine)
- [Requirements](#requirements)
- [Google Cloud](#google-cloud)
- [2. Install code-server](#2-install-code-server)
- [3. Expose code-server](#3-expose-code-server)
- [SSH forwarding](#ssh-forwarding)
- [Let's Encrypt](#lets-encrypt)
- [Self Signed Certificate](#self-signed-certificate)
- [Change the password?](#change-the-password)
- [How do I securely access development web services?](#how-do-i-securely-access-development-web-services)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
This guide demonstrates how to setup and use code-server.
To reiterate, code-server lets you run VS Code on a remote server and then access it via a browser.
See [README.md](../README.md) for a general overview and [FAQ.md](./FAQ.md) for further user docs.
We'll walk you through acquiring a remote machine to run code-server on and then exposing `code-server` so you can
securely access it.
## 1. Acquire a remote machine
First, you need a machine to run code-server on. You can use a physical
machine you have lying around or use a VM on GCP/AWS.
### Requirements
For a good experience, we recommend at least:
- 1 GB of RAM
- 2 cores
You can use whatever linux distribution floats your boat but in this guide we assume Debian on Google Cloud.
### Google Cloud
For demonstration purposes, this guide assumes you're using a VM on GCP but you should be
able to easily use any machine or VM provider.
You can sign up at https://console.cloud.google.com/getting-started. You'll get a 12 month \$300
free trial.
Once you've signed up and created a GCP project, create a new Compute Engine VM Instance.
1. Navigate to `Compute Engine -> VM Instances` on the sidebar.
2. Now click `Create Instance` to create a new instance.
3. Name it whatever you want.
4. Choose the region closest to you based on [gcping.com](http://www.gcping.com).
5. Any zone is fine.
6. We'd recommend a `E2` series instance from the General-purpose family.
- Change the type to custom and set at least 2 cores and 2 GB of ram.
- Add more vCPUs and memory as you prefer, you can edit after creating the instance as well.
- https://cloud.google.com/compute/docs/machine-types#general_purpose
7. We highly recommend switching the persistent disk to a SSD of at least 32 GB.
- Click `Change` under `Boot Disk` and change the type to `SSD Persistent Disk` and the size
to `32`.
- You can always grow your disk later.
- The default OS of Debian 10 is fine.
8. Navigate to `Networking -> Network interfaces` and edit the existing interface
to use a static external IP.
- Click done to save network interface changes.
9. If you do not have a [project wide SSH key](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#project-wide), navigate to `Security - > SSH Keys` and add your public key there.
10. Click create!
Remember, you can shutdown your server when not in use to lower costs.
We highly recommend learning to use the [`gcloud`](https://cloud.google.com/sdk/gcloud) cli
to avoid the slow dashboard.
## 2. Install code-server
SSH into your instance and run the appropriate commands documented in [README.md](../README.md).
Assuming Debian:
```bash
curl -sSOL https://github.com/cdr/code-server/releases/download/3.3.0/code-server_3.3.0_amd64.deb
sudo dpkg -i code-server_3.3.0_amd64.deb
systemctl --user enable --now code-server
# Now code-server is running at http://127.0.0.1:8080
# Your password is in ~/.config/code-server/config.yaml
```
## 3. Expose code-server
**Never**, **ever** expose `code-server` directly to the internet without some form of authentication
and encryption as someone can completely takeover your machine with the terminal.
There are several approaches to securely operating and exposing code-server.
By default, code-server will enable password authentication which will
require you to copy the password from the code-server config file to login. You
can also set a custom password with `$PASSWORD`.
**tip**: You can list the full set of code-server options with `code-server --help`
### SSH forwarding
We highly recommend this approach for not requiring any additional setup, you just need an
SSH server on your remote machine. The downside is you won't be able to access `code-server`
without an SSH client like an iPad. If that's important to you, skip to [Let's Encrypt](#lets-encrypt).
Recommended reading: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding.
First, ssh into your instance and edit your code-server config file to disable password authentication.
```bash
# Replaces "auth: password" with "auth: none" in the code-server config.
sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
```
Restart code-server with (assuming you followed the guide):
```bash
systemctl --user restart code-server
```
Now forward local port 8080 to `127.0.0.1:8080` on the remote instance.
```bash
# -N disables executing a remote shell
ssh -N -L 8080:127.0.0.1:8080 <instance-ip>
```
Now if you access http://127.0.0.1:8080 locally, you should see code-server!
If you want to make the SSH port forwarding persistent we recommend using
[mutagen](https://mutagen.io/documentation/introduction/installation).
```
# Same as the above SSH command but runs in the background continously.
# Add `mutagen daemon start` to your ~/.bashrc to start the mutagen daemon when you open a shell.
mutagen forward create --name=code-server tcp:127.0.0.1:8080 <instance-ip>:tcp:127.0.0.1:8080
```
We also recommend adding the following lines to your `~/.ssh/config` to quickly detect bricked SSH connections:
```bash
Host *
ServerAliveInterval 5
ExitOnForwardFailure yes
```
You can also forward your SSH key and GPG agent to the instance to securely access GitHub
and sign commits without copying your keys onto the instance.
1. https://developer.github.com/v3/guides/using-ssh-agent-forwarding/
2. https://wiki.gnupg.org/AgentForwarding
### Let's Encrypt
[Let's Encrypt](https://letsencrypt.org) is a great option if you want to access code-server on an iPad
or do not want to use SSH forwarding. This does require that the remote machine is exposed to the internet.
Assuming you have been following the guide, edit your instance and checkmark the allow HTTP/HTTPS traffic options.
1. You'll need to buy a domain name. We recommend [Google Domains](https://domains.google.com).
2. Add an A record to your domain with your instance's IP.
3. Install caddy https://caddyserver.com/docs/download#debian-ubuntu-raspbian.
```bash
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
| sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
sudo apt update
sudo apt install caddy
```
4. Replace `/etc/caddy/Caddyfile` with sudo to look like this:
```
mydomain.com
reverse_proxy 127.0.0.1:8080
```
5. Reload caddy with:
```bash
sudo systemctl reload caddy
```
Visit `https://<your-domain-name>` to access code-server. Congratulations!
In a future release we plan to integrate Let's Encrypt directly with code-server to avoid
the dependency on caddy.
### Self Signed Certificate
**note:** Self signed certificates do not work with iPad and will cause a blank page. You'll
have to use [Let's Encrypt](#lets-encrypt) instead.
Recommended reading: https://security.stackexchange.com/a/8112.
We recommend this as a last resort as self signed certificates do not work with iPads and can
cause other bizarre issues. Not to mention all the warnings when you access code-server.
Only use this if:
1. You do not want to buy a domain.
2. You cannot expose the remote machine to the internet.
3. You do not want to use SSH forwarding.
ssh into your instance and edit your code-server config file to use a randomly generated self signed certificate:
```bash
# Replaces "cert: false" with "cert: true" in the code-server config.
sed -i.bak 's/cert: false/cert: true/' ~/.config/code-server/config.yaml
# Replaces "bind-addr: 127.0.0.1:8080" with "bind-addr: 0.0.0.0:443" in the code-server config.
sed -i.bak 's/bind-addr: 127.0.0.1:8080/bind-addr: 0.0.0.0:443/' ~/.config/code-server/config.yaml
# Allows code-server to listen on port 443.
sudo setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node
```
Assuming you have been following the guide, restart code-server with:
```bash
systemctl --user restart code-server
```
Edit your instance and checkmark the allow HTTPS traffic option.
Visit `https://<your-instance-ip>` to access code-server.
You'll get a warning when accessing but if you click through you should be good.
To avoid the warnings, you can use [mkcert](https://mkcert.dev) to create a self signed certificate
trusted by your OS and then pass it into code-server via the `cert` and `cert-key` config
fields.
### Change the password?
Edit the code-server config file at `~/.config/code-server/config.yaml` and then restart
code-server with:
```bash
systemctl --user restart code-server
```
### How do I securely access development web services?
If you're working on a web service and want to access it locally, code-server can proxy it for you.
See [FAQ.md](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-securely-access-web-services).

34
doc/npm.md Normal file
View File

@@ -0,0 +1,34 @@
# npm Install Requirements
If you're installing the npm module you'll need certain dependencies to build
the native modules used by VS Code.
You also need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
## Ubuntu, Debian
```bash
sudo apt-get install -y \
build-essential \
pkg-config \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev
```
## Fedora, Red Hat, SUSE
```bash
sudo yum groupinstall -y 'Development Tools'
sudo yum config-manager --set-enabled PowerTools
sudo yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel
npm config set python python2
```
## macOS
Install [Xcode](https://developer.apple.com/xcode/downloads/) and run:
```bash
xcode-select --install
```

View File

@@ -1,53 +0,0 @@
# Generate a self-signed certificate đź”’
code-server has the ability to secure your connection between client and server using SSL/TSL certificates. By default, the server will start with an unencrypted connection. We recommend Self-signed TLS/SSL certificates for personal use of code-server or within an organization.
This guide will show you how to create a self-signed certificate and start code-server using your certificate/key.
## TLS / HTTPS
You can specify any location that you want to save the certificate and key. In this example, we will navigate to the root directory, create a folder called `certs` and cd into it.
```shell
mkdir ~/certs && cd ~/certs
```
If you don't already have a TLS certificate and key, you can generate them with the command below. They will be placed in `~/certs`
```shell
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/certs/MyKey.key -out ~/certs/MyCertificate.crt
```
You will be prompted to add some identifying information about your organization
```shell
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:TX
Locality Name (eg, city) []:Austin
Organization Name (eg, company) [Coder Technologies]:Coder
Organizational Unit Name (eg, section) []:Docs
Common Name (e.g. server FQDN or YOUR name) []:hostname.example.com
Email Address []:admin@example.com
```
>If you already have a TLS certificate and key, you can simply reference them in the `--cert` and `--cert-key` flags when launching code-server
## Starting code-server with certificate and key
1. At the end of the path to your binary, add the following flags followed by the path to your certificate and key like so. Then press enter to run code-server.
```shell
./code-server --cert=~/certs/MyCertificate.crt --cert-key=~/certs/MyKey.key
```
2. After that you will be running a secure code-server.
> You will know your connection is secure if the lines `WARN No certificate specified. This could be insecure. WARN Documentation on securing your setup: https://coder.com/docs` no longer appear.
## Other options
For larger organizations you may wish to rely on a Certificate Authority as opposed to a self-signed certificate. For more information on generating free and open certificates for your site, please check out EFF's [certbot](https://certbot.eff.org/). Certbot is a cli to generate certificates using [LetsEncrypt](https://letsencrypt.org/).

View File

@@ -1,93 +0,0 @@
# Getting Started
[code-server](https://coder.com) is used by developers at Azure, Google, Reddit, and more to give them access to VS Code in the browser.
## Quickstart guide
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).
This document pertains to Coder specific implementations of VS Code. For documentation on how to use VS Code itself, please refer to the official [documentation for VS Code](https://code.visualstudio.com/docs)
It takes just a few minutes to get your own self-hosted server running. If you've got a machine running macOS, Windows, or Linux, you're ready to start the binary which listens on port `8443` by default.
<!--
DO NOT CHANGE THIS TO A CODEBLOCK.
We want line breaks for readability, but backslashes to escape them do not work cross-platform.
This uses line breaks that are rendered but not copy-pasted to the clipboard.
-->
1. Visit [the releases](https://github.com/codercom/code-server/releases) page and download the latest cli for your operating system
2. Double click the executable to run in the current directory
3. Copy the password that appears in the cli<img src="../assets/cli.png">
4. In your browser navigate to `localhost:8443`
5. Paste the password from the cli into the login window<img src="../assets/server-password-modal.png">
> NOTE: Be careful with your password as sharing it will grant those users access to your server's file system
### Things to know
- When you visit the IP for your code-server, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../assets/chrome_warning.png">
- Then click **"proceed anyway"**<img src="../assets/chrome_confirm.png">
## Usage
<pre class="pre-wrap"><code>code-server<span class="virtual-br"></span> --help</code></pre>
code-server can be ran with a number of arguments to customize your working directory, host, port, and SSL certificate.
```
USAGE
$ code-server [WORKDIR]
ARGUMENTS
WORKDIR [default: (directory to binary)] Specify working dir
OPTIONS
-d, --data-dir=data-dir
-h, --host=host [default: 0.0.0.0]
-o, --open Open in browser on startup
-p, --port=port [default: 8443] Port to bind on
-v, --version show CLI version
--allow-http
--cert=cert
--cert-key=cert-key
--help show CLI help
--no-auth
--password=password
```
### Data directory
Use `code-server -d (path/to/directory)` or `code-server --data-dir=(path/to/directory)`, excluding the parentheses to specify the root folder that VS Code will start in
### Host
By default, code-server will use `0.0.0.0` as its address. This can be changed by using `code-server -h` or `code-server --host=` followed by the address you want to use.
> Example: `code-server -h 127.0.0.1`
### Open
You can have the server automatically open the VS Code in your browser on startup by using the `code server -o` or `code-server --open` flags
### Port
By default, code-server will use `8443` as its port. This can be changed by using `code-server -p` or `code-server --port=` followed by the port you want to use.
> Example: `code-server -p 9000`
### Cert and Cert Key
To encrypt the traffic between the browser and server use `code-server --cert=` followed by the path to your `.cer` file. Additionally, you can use certificate keys with `code-server --cert-key` followed by the path to your `.key` file.
> Example (certificate and key): `code-server --cert /etc/letsencrypt/live/example.com/fullchain.cer --cert-key /etc/letsencrypt/live/example.com/fullchain.key`
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
### Nginx Reverse Proxy
Nginx is for reverse proxy. Here is a example virtual host that works with code-server. Please also pass --allow-http. You can also use certbot by EFF to get a ssl certificates for free.
```
server {
listen 80;
listen [::]:80;
server_name code.example.com code.example.org;
location / {
proxy_pass http://localhost:8443/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
}
```
### Help
Use `code-server -h` or `code-server --help` to view the usage for the cli. This is also shown at the beginning of this section.

1
lib/vscode Submodule

Submodule lib/vscode added at 19c1c8ac0a

View File

@@ -1,56 +1,99 @@
{
"name": "@coder/code-server",
"repository": "https://github.com/codercom/code-server",
"author": "Coder",
"name": "code-server",
"license": "MIT",
"description": "Run VS Code remotely.",
"scripts": {
"build:rules": "cd ./rules && tsc -p .",
"packages:install": "cd ./packages && yarn",
"postinstall": "npm-run-all --parallel packages:install build:rules",
"start": "cd ./packages/server && yarn start",
"task": "ts-node -r tsconfig-paths/register build/tasks.ts",
"test": "cd ./packages && yarn test"
"version": "3.3.0",
"description": "Run VS Code on a remote server.",
"homepage": "https://github.com/cdr/code-server",
"bugs": {
"url": "https://github.com/cdr/code-server/issues"
},
"repository": "https://github.com/cdr/code-server",
"scripts": {
"clean": "./ci/build/clean.sh",
"vscode": "./ci/dev/vscode.sh",
"vscode:patch": "./ci/dev/patch-vscode.sh",
"vscode:diff": "./ci/dev/diff-vscode.sh",
"build": "./ci/build/build-code-server.sh",
"build:vscode": "./ci/build/build-vscode.sh",
"release": "./ci/build/build-release.sh",
"release:static": "./ci/build/build-static-release.sh",
"release:github-draft": "./ci/build/release-github-draft.sh",
"release:github-assets": "./ci/build/release-github-assets.sh",
"test:static-release": "./ci/build/test-static-release.sh",
"package": "./ci/build/build-packages.sh",
"_____": "",
"fmt": "./ci/dev/fmt.sh",
"lint": "./ci/dev/lint.sh",
"test": "./ci/dev/test.sh",
"ci": "./ci/dev/ci.sh",
"watch": "NODE_OPTIONS=--max_old_space_size=32384 ts-node ./ci/dev/watch.ts"
},
"main": "out/node/entry.js",
"devDependencies": {
"@types/fs-extra": "^5.0.4",
"@types/node": "^10.12.18",
"@types/trash": "^4.3.1",
"cross-env": "^5.2.0",
"crypto-browserify": "^3.12.0",
"css-loader": "^2.1.0",
"file-loader": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"fs-extra": "^7.0.1",
"happypack": "^5.0.1",
"html-webpack-plugin": "^3.2.0",
"http-browserify": "^1.7.0",
"ignore-loader": "^0.1.2",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"npm-run-all": "^4.1.5",
"path-browserify": "^1.0.0",
"preload-webpack-plugin": "^3.0.0-beta.2",
"sass-loader": "^7.1.0",
"string-replace-loader": "^2.1.1",
"style-loader": "^0.23.1",
"ts-loader": "^5.3.3",
"ts-node": "^7.0.1",
"tsconfig-paths": "^3.8.0",
"tslint": "^5.12.1",
"typescript": "^3.2.2",
"typescript-tslint-plugin": "^0.2.1",
"uglifyjs-webpack-plugin": "^2.1.1",
"webpack": "^4.28.4",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "^3.2.1",
"webpack-dev-middleware": "^3.5.0",
"webpack-dev-server": "^3.1.14",
"webpack-hot-middleware": "^2.24.3",
"write-file-webpack-plugin": "^4.5.0"
"@types/adm-zip": "^0.4.32",
"@types/fs-extra": "^8.0.1",
"@types/http-proxy": "^1.17.4",
"@types/js-yaml": "^3.12.3",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.7",
"@types/parcel-bundler": "^1.12.1",
"@types/pem": "^1.9.5",
"@types/safe-compare": "^1.1.0",
"@types/semver": "^7.1.0",
"@types/tar-fs": "^1.16.2",
"@types/tar-stream": "^1.6.1",
"@types/ws": "^6.0.4",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"doctoc": "^1.4.0",
"eslint": "^6.2.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.0",
"leaked-handles": "^5.2.0",
"mocha": "^6.2.0",
"parcel-bundler": "^1.12.4",
"prettier": "^2.0.5",
"stylelint": "^13.0.0",
"stylelint-config-recommended": "^3.0.0",
"ts-node": "^8.4.1",
"typescript": "3.7.2"
},
"resolutions": {
"@types/node": "^12.12.7",
"safe-buffer": "^5.1.1",
"vfile-message": "^2.0.2"
},
"dependencies": {
"node-loader": "^0.6.0",
"webpack-merge": "^4.2.1"
"@coder/logger": "1.1.11",
"adm-zip": "^0.4.14",
"env-paths": "^2.2.0",
"fs-extra": "^8.1.0",
"http-proxy": "^1.18.0",
"httpolyglot": "^0.1.2",
"js-yaml": "^3.13.1",
"limiter": "^1.1.5",
"pem": "^1.14.2",
"safe-compare": "^1.1.4",
"semver": "^7.1.3",
"tar": "^6.0.1",
"tar-fs": "^2.0.0",
"ws": "^7.2.0",
"xdg-basedir": "^4.0.0",
"yarn": "^1.22.4"
},
"bin": {
"code-server": "out/node/entry.js"
},
"keywords": [
"vscode",
"development",
"ide",
"coder",
"vscode-remote",
"browser-ide"
],
"engines": {
"node": ">= 12"
}
}

View File

@@ -1,12 +0,0 @@
{
"name": "@coder/app",
"scripts": {
"start": "node ../../../node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack.config.js",
"build": "node ../../../node_modules/webpack/bin/webpack.js --config ./webpack.config.js"
},
"dependencies": {
"@material/checkbox": "^0.44.1",
"@material/textfield": "^0.44.1",
"material-components-web": "^0.44.0"
}
}

View File

@@ -1,28 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>Authenticate: code-server</title>
</head>
<body>
<div class="login">
<div class="back"> <- Back </div>
<h4 class="title">code-server</h4>
<h2 class="subtitle">
Enter server password
</h2>
<div class="mdc-text-field">
<input type="password" id="password" class="mdc-text-field__input" required>
<label class="mdc-floating-label" for="password">Password</label>
<div class="mdc-line-ripple"></div>
</div>
<button id="submit" class="mdc-button mdc-button--unelevated">
<span class="mdc-button__label">Enter IDE</span>
</button>
<div id="error-display"></div>
</div>
</body>
</html>

View File

@@ -1,121 +0,0 @@
@import url("https://use.typekit.net/vzk7ygg.css");
html, body {
background-color: #FFFFFF;
min-height: 100%;
}
body {
font-family: 'aktiv-grotesk';
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh - 20px);
margin: 0;
padding: 10px;
--mdc-theme-primary: #AAADA1;
--mdc-theme-secondary: #AAADA1;
&.in-app {
.back {
pointer-events: all;
opacity: 1;
}
}
}
.login {
box-shadow: 0 18px 80px 10px rgba(69, 65, 78, 0.08);
max-width: 328px;
width: 100%;
padding: 40px;
border-radius: 5px;
position: relative;
color: #575962;
.title {
margin-bottom: 0px;
font-size: 12px;
font-weight: 500;
letter-spacing: 1.5px;
line-height: 15px;
margin-bottom: 5px;
margin-top: 0px;
text-align: center;
text-transform: uppercase;
}
.subtitle {
text-align: center;
margin: 0;
font-size: 19px;
font-weight: bold;
line-height: 25px;
margin-bottom: 45px;
}
.mdc-text-field {
width: 100%;
background: none !important;
&::before {
background: none !important;
}
}
.mdc-form-field {
text-align: left;
font-size: 12px;
color: #797E84;
margin-top: 16px;
}
.mdc-button {
border-radius: 24px;
padding-left: 75px;
padding-right: 75px;
padding-top: 15px;
padding-bottom: 15px;
height: 48px;
margin: 0 auto;
display: block;
box-shadow: 0 12px 17px 2px rgba(171,173,163,0.14), 0 5px 22px 4px rgba(171,173,163,0.12), 0 7px 8px -4px rgba(171,173,163,0.2);
margin-top: 40px;
}
}
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
color: var(--mdc-theme-primary);
}
.mdc-floating-label--float-above {
transform: translateY(-70%) scale(0.75);
}
.mdc-text-field:not(.mdc-text-field--disabled):not(.mdc-text-field--outlined):not(.mdc-text-field--textarea) .mdc-text-field__input, .mdc-text-field:not(.mdc-text-field--disabled):not(.mdc-text-field--outlined):not(.mdc-text-field--textarea) .mdc-text-field__input:hover {
border-bottom-color: #EBEDF2;
}
.back {
position: absolute;
top: -50px;
left: -50px;
font-weight: bold;
opacity: 0;
pointer-events: none;
// transition: 500ms opacity ease;
}
#error-display {
box-sizing: border-box;
color: #bb2d0f;
font-size: 14px;
font-weight: 400;
letter-spacing: 0.3px;
line-height: 12px;
padding: 8px;
padding-bottom: 0;
padding-top: 20px;
text-align: center;
}

View File

@@ -1,41 +0,0 @@
//@ts-ignore
import { MDCTextField } from "@material/textfield";
//@ts-ignore
import { MDCCheckbox } from "@material/checkbox";
import "material-components-web/dist/material-components-web.css";
import "./app.scss";
document.querySelectorAll(".mdc-text-field").forEach((d) => new MDCTextField(d));
document.querySelectorAll(".mdc-checkbox").forEach((d) => new MDCCheckbox(d));
window.addEventListener("message", (event) => {
if (event.data === "app") {
document.body.classList.add("in-app");
const back = document.querySelector(".back")!;
back.addEventListener("click", () => {
(event.source as Window).postMessage("back", event.origin);
});
}
});
const password = document.getElementById("password") as HTMLInputElement;
const submit = document.getElementById("submit") as HTMLButtonElement;
if (!submit) {
throw new Error("No submit button found");
}
submit.addEventListener("click", () => {
document.cookie = `password=${password.value}`;
location.reload();
});
/**
* Notify user on load of page if previous password was unsuccessful
*/
const reg = new RegExp(`password=(\\w+);?`);
const matches = document.cookie.match(reg);
const errorDisplay = document.getElementById("error-display") as HTMLDivElement;
if (document.referrer === document.location.href && matches) {
errorDisplay.innerText = "Password is incorrect!";
}

View File

@@ -1,17 +0,0 @@
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const root = path.resolve(__dirname, "../../..");
module.exports = merge(
require(path.join(root, "scripts/webpack.client.config.js"))({
entry: path.join(root, "packages/app/browser/src/app.ts"),
template: path.join(root, "packages/app/browser/src/app.html"),
}), {
output: {
path: path.join(__dirname, "out"),
},
},
);

View File

@@ -1,606 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@material/animation@^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@material/animation/-/animation-0.41.0.tgz#315b45b32e1aeebee8a4cf555b8ad52076d09ddd"
integrity sha512-yYAwJbX3Q2AFd4dr6IYOsWLQy2HN8zWOFVl9AbUXunjzTfJCa/ecfXCriaT6qkmoNoHeTdJHRrsQJZC5GsPvzA==
"@material/auto-init@^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@material/auto-init/-/auto-init-0.41.0.tgz#8a59bb0b83e0f51ead9508074f9a29b2b6a20eec"
integrity sha512-jp6L8MpYu7DudgDfA8iTyD9BwQrYPEDsIJGbqzN9vcCBl5FoBatkB8pcFXKr+1mRBk7T1Qmf6+H5nDtxyXjHEQ==
"@material/base@^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@material/base/-/base-0.41.0.tgz#badadce711b4c25b1eb889a5e7581e32cd07c421"
integrity sha512-tEyzwBRu3d1H120SfKsDVYZHcqT5lKohh/7cWKR93aAaPDkSvjpKJIjyu2yuSkjpDduVZGzVocYbOvhUKhhzXQ==
"@material/button@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/button/-/button-0.44.0.tgz#f01dcbea88bdc314e7640b76e5558101c8b4d69d"
integrity sha512-T8u8s8rlB49D9/5Nh5b0XsKRgSq3X0yWGo71MgaTnCnwxt8oZ6PxW/cH6Nn3Xp0NCr3mlSVQs08BviUfAmtlsg==
dependencies:
"@material/elevation" "^0.44.0"
"@material/feature-targeting" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/card@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/card/-/card-0.44.0.tgz#e62050e3e77f525173a015119200055cd7b71bf0"
integrity sha512-fUixXuh133bVp5c1gPIHreL5jwMJEeVIQf0E4xdxhkA+i4ku8fIAvIW62EuCmfJsXicv4q8NG3Ip6pCY+NW3ZA==
dependencies:
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/checkbox@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/checkbox/-/checkbox-0.44.0.tgz#5d0eee1db006db9f0fb700bf1c20408292305cf7"
integrity sha512-IzucxG+NuPNyByGmHg/cuYJ5ooMKouuj994PZXZyqb7owfrjjtXm7wjav66cvCowbVbcoa1owQMGBi18C9f4TQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/selection-control" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/checkbox@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/checkbox/-/checkbox-0.44.1.tgz#7e69271ccab7c57914a475da3a15d4d36702c1c4"
integrity sha512-RFUNc+9RKRozL+gXfJ8V57tXfC31Q9R9tRMTHpe62NXZriTrwNJDnSkFIERDXqtMGtkKUnIlPfPE5znF6XyPUw==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/feature-targeting" "^0.44.1"
"@material/ripple" "^0.44.1"
"@material/rtl" "^0.42.0"
"@material/selection-control" "^0.44.1"
"@material/theme" "^0.43.0"
"@material/chips@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/chips/-/chips-0.44.0.tgz#bf553a5bf5db7320978402ac92069c9688b84d5a"
integrity sha512-+qrme6sGwYmX/ixHAo3Z1M7lorsxRyKexn1l+BSBX5PBc2f4w5Ml1eYYYcyVGfLX9LXmefRk0G6dUXXPyCE00g==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/checkbox" "^0.44.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/dialog@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/dialog/-/dialog-0.44.0.tgz#388f93f9f225824c75cbe9da8c464a52d79972e8"
integrity sha512-V6ButfknOMKOscL0Y39yLjamxvrIuyugobjf5s44ZeJc+9jUSkC7M3zP+T7rh358NcX+JSPP8iCGmUn/+LXpMQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/dom" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
focus-trap "^4.0.2"
"@material/dom@^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@material/dom/-/dom-0.41.0.tgz#6756865f97bad4c91ee75e69d769d7cdc25398ae"
integrity sha512-wOJrMwjPddYXpQFZAIaCLWI3TO/6KU1lxESTBzunni8A4FHQVWhokml5Xt85GqZwmPFeIF2s+D0wfbWyrGBuKQ==
"@material/drawer@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/drawer/-/drawer-0.44.0.tgz#74b3ddfb741bffc72331c7a73cf62716fd3f0ab3"
integrity sha512-AYwFe0jgqqSmJd1bny8JJTA2SScF86Wfbk99lXXEwd/acS8IbnnuH6zfAg6MyJX12FDb8dE8Z/Ok1IwLiVa9sQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/list" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
focus-trap "^4.0.2"
"@material/elevation@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/elevation/-/elevation-0.44.0.tgz#ca16a67188ce9810dc2fa3d7a39073e72df4b754"
integrity sha512-edNou34yFCSMb6XXe/6Y7AEh8DigWAhBUyIeMiMBD4k1km2xYCJbcnl8FBPJFteOrca97KoJComRlJPB6EurRQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/theme" "^0.43.0"
"@material/fab@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/fab/-/fab-0.44.0.tgz#0bcbbdfb6f24c53d59e08c9c0d400d2616dea184"
integrity sha512-1CEP4NlXDYioJ/YpSjh/MlIygtoC7CaHqIbucxX1O5WRPmS7K1uPt+o7netbLErAmcJdV/JrI/tqh9kKuX2x/Q==
dependencies:
"@material/animation" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/feature-targeting@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/feature-targeting/-/feature-targeting-0.44.0.tgz#52cc73f0c8a83159de0357aebe74f15f9856fb4c"
integrity sha512-ShuC2TOLfjFpYUCQFtvkqDJhM6HTaucSx5HkRbOvOG+VlpzDx6pAqRUmdVaq2p7tHoQf2vwPMlSVm3gOjWt4VQ==
"@material/feature-targeting@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/feature-targeting/-/feature-targeting-0.44.1.tgz#afafc80294e5efab94bee31a187273d43d34979a"
integrity sha512-90cc7njn4aHbH9UxY8qgZth1W5JgOgcEdWdubH1t7sFkwqFxS5g3zgxSBt46TygFBVIXNZNq35Xmg80wgqO7Pg==
"@material/floating-label@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/floating-label/-/floating-label-0.44.0.tgz#8694cd49f6905641b67a9e7a112b820d028f09c7"
integrity sha512-k4npGNxyMtnjgJZNjU5VvqqaUqlbzlbVAhepT8PxYTpj+4Skg6PjHwieTCDCgsbqHvFcQX+WfUrSZXY7wFV7cw==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/rtl" "^0.42.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/floating-label@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/floating-label/-/floating-label-0.44.1.tgz#39af84a3a0abbfa6d210911d5f4200a65c2ef59b"
integrity sha512-umj5q5feJcZuB8snRX5aVBrwQNnrt/HcvN7pENzgqaYZNcmBnxRl0OutTlHCn6l7OVU9VlWhFMf77DYwmMWKJQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/rtl" "^0.42.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.1"
"@material/form-field@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/form-field/-/form-field-0.44.0.tgz#b7518e885c0e953a2a5fe0140af927c30e066f4e"
integrity sha512-SK+V34dzoBCQ/CHn5nBp8BAh21Vj9p1pcok+/WpYBTeg4EphTYP2nUQLMNEN92l6zjgAYf+g9Ocj3t26HNHWqA==
dependencies:
"@material/base" "^0.41.0"
"@material/rtl" "^0.42.0"
"@material/selection-control" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/grid-list@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/grid-list/-/grid-list-0.44.0.tgz#bd31d992ab1a910731e4a47c11fe91d44e3bc02b"
integrity sha512-NxLL0A48K1O14ZZymFIyf6HDbF33+NgXYXqP2yosTC3Jw4iwmUcJTpFTmSw1U/m1xT4zEpeKEGJ4vjVUWpS9Mg==
dependencies:
"@material/base" "^0.41.0"
"@material/rtl" "^0.42.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/icon-button@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/icon-button/-/icon-button-0.44.0.tgz#febbcfd27d91eca8096ae042b9c07ed0f65345e9"
integrity sha512-n6L7RaRyEci6eGsuBTSEG+t9ATHAHaMlf9zuTWorEnIXY4DAmGO7ggBjw4+1XIOjhpLeIjyJdcvUK6Yz/UVM6Q==
dependencies:
"@material/base" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/icon-toggle@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/icon-toggle/-/icon-toggle-0.44.0.tgz#b9de32f194b5aa9721ca799d59be0f477a5c5305"
integrity sha512-8T1b4iK61/q/3U0iIjEDJ9do5viCQ45IbrQqa8EYCZ1KDU/Q8z5N+bvOzQK8XnTL51BdDRMgP9lfQZh6nszmkA==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/image-list@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/image-list/-/image-list-0.44.0.tgz#a27996962044ac8c9ce6cb509f63746f08ed2e98"
integrity sha512-kI9aKJdc1Bd02l8nRTGG1wy/lNkECScfnBmCiLQ3XjAFtRYd2eWO0Z/AVvUG3egsIZnZBxqFGGsf5Htm9E/HiQ==
dependencies:
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/layout-grid@^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@material/layout-grid/-/layout-grid-0.41.0.tgz#2e7d3be76313e0684d573b10c2c6a88b3230d251"
integrity sha512-Sa5RNoTGgfIojqJ9E94p7/k11V6q/tGk7HwKi4AQNAPjxield0zcl3G/SbsSb8YSHoK+D+7OXDN+n11x6EqF7g==
"@material/line-ripple@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@material/line-ripple/-/line-ripple-0.43.0.tgz#6cb530bab53f055f3583646a21ad20c1703f3a83"
integrity sha512-sXZYW4Em5uLEnAuVsQCO+sVHsTg7J2TOTJ0+akwZFMmd2tmNicjarQdlGIE9iU7Wjm51NOoLAu6Mz+8kLg90bQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/theme" "^0.43.0"
"@material/linear-progress@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@material/linear-progress/-/linear-progress-0.43.0.tgz#4821424aa24c78de256e74a91d5be3df55c534d9"
integrity sha512-bqkDcob+xp1mFkyBsOkoaLgrtapmz7jznGoI3nmkqyk75EB2XQcn1H8Vr6cnp/jkF4nbKu0GdVJO3VXUFmGmrQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/theme" "^0.43.0"
"@material/list@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/list/-/list-0.44.0.tgz#cf1910e15b66759334b8618d1110fbcc72c3d326"
integrity sha512-35gkN1+XZaau9d9ngyN2x14bzkj/ajZCDm7mbWibDQy272A16j6KuFLQFA8RUQV04OgL4YPVxY87dpCn/p+uTg==
dependencies:
"@material/base" "^0.41.0"
"@material/dom" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/menu-surface@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/menu-surface/-/menu-surface-0.44.0.tgz#902c081df42859b925a5b4502791b3febf48f1ae"
integrity sha512-s49kvIlQ4H5wvMD4yeHMMqnamPod06IUagMK6Ry0oTpUANSnyeNXxa3HkScl7DMJiS8IJeV21fSLAzlZYP2PDQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/menu@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/menu/-/menu-0.44.0.tgz#776ec8a04406266a0a0a13eb140b1fd691e442cb"
integrity sha512-92XvAcv9rBW1jQ3UvwJ8zk9hbSRe/FqSuFdZ9fNPE348dCY2pbcdQfnUJTe3ycAN/I1c5frkrhx8F0II+nfbNQ==
dependencies:
"@material/base" "^0.41.0"
"@material/list" "^0.44.0"
"@material/menu-surface" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/notched-outline@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/notched-outline/-/notched-outline-0.44.0.tgz#d5a2e1d649921575a7cd2e88ee4581e4a1809573"
integrity sha512-c3nqOqUQAmW3h4zBbZVbMRdf4nNTYm0tVwXIAwmcCs5nvAthEHnzHwwFddNP7/9Wju6LZ0uqWn6xlyKly0uipw==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/floating-label" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/notched-outline@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/notched-outline/-/notched-outline-0.44.1.tgz#dba4812286ba4c20f0361e6040bf9b9cad307434"
integrity sha512-x1ZJtrrqZgXT8gYE7aRF+6hTWpX7XaKZzsuwD+e0HBsogYNNsYmkBdLjl4YwhhFuHhX8vWzgkay41GtbgQx84Q==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/floating-label" "^0.44.1"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.44.1"
"@material/theme" "^0.43.0"
"@material/radio@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/radio/-/radio-0.44.0.tgz#f4cacdfabc7d765aa000cb34c5a37966f6d4fd6d"
integrity sha512-ar7uhlfHuSwM9JUUjpv7pLDLE0p436cCMxNTpmMjWabfvo3pMWlExvk72Oj81tBgfxY/uASLB3oj4neudXu9JQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/selection-control" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/ripple@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/ripple/-/ripple-0.44.0.tgz#98920ff8ec4bf5714c97df3d190f02f8a5b476cc"
integrity sha512-MlaW4nUDgzS0JOBfsUawXyTOilr0jn+xvTVn6PEaGh2rmhNA54AhixXvdsVUWE9lfmHAsZV0AJHz2z7nunNhbQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/feature-targeting" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/ripple@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/ripple/-/ripple-0.44.1.tgz#79cb2ddf1f998498d877d3e3c46b50fed6f13b01"
integrity sha512-prJ1p3bR+GvwAtJgtdeIixsnRVApN3bizGnX7upKoqxsqbBDHj84JxaO8EsG9bjruG/LJu8Fb6WKKdIp2oXHTA==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/feature-targeting" "^0.44.1"
"@material/theme" "^0.43.0"
"@material/rtl@^0.42.0":
version "0.42.0"
resolved "https://registry.yarnpkg.com/@material/rtl/-/rtl-0.42.0.tgz#1836e78186c2d8b996f6fbf97adab203535335bc"
integrity sha512-VrnrKJzhmspsN8WXHuxxBZ69yM5IwhCUqWr1t1eNfw3ZEvEj7i1g3P31HGowKThIN1dc1Wh4LE14rCISWCtv5w==
"@material/select@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/select/-/select-0.44.0.tgz#8041b4fe6247d013b0f12685fbdf50aa9ff57b35"
integrity sha512-tw3/QIBLuRCT+5IXx4IPiJk7FzeGeR65JEizdRUItH8yzoIiQLs/b2i3KtHM2YBXHgeUcEBF2AOqPX2opdYhug==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/floating-label" "^0.44.0"
"@material/line-ripple" "^0.43.0"
"@material/menu" "^0.44.0"
"@material/menu-surface" "^0.44.0"
"@material/notched-outline" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/selection-control@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/selection-control/-/selection-control-0.44.0.tgz#63d5c65a47a9f54f5a0316b5ecdb5e5f35108609"
integrity sha512-HgCAPnMVMEj4X4ILkFSifqtZ3Tcc5HkU+Lfk9g0807sCaN/qBKWkYKLH2WJUbW8uk+MXK7DgP1khtS5zzanJWA==
dependencies:
"@material/ripple" "^0.44.0"
"@material/selection-control@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/selection-control/-/selection-control-0.44.1.tgz#77a47354a4c5128fa34e3ba98d9cc26e8a92839a"
integrity sha512-Xf1ee2ZV2XJ+rK8OcOD1DZOihfU0uVRdY6iYX/Bqi8k8RXnAbLIBoh6zG3xSwjRNODNvAyHEQaS/ozEfH8eehg==
dependencies:
"@material/ripple" "^0.44.1"
"@material/shape@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@material/shape/-/shape-0.43.0.tgz#b877acfd8be8abc9ddcf6601eb60dd0588292415"
integrity sha512-KGnoQV4G2OQbMe5Lr5Xbk8XNlO93Qi/juxXtd2wrAfiaPmktD8ug0CwdVDOPBOmj9a0gX3Ofi9XWcoU+tLEVjg==
"@material/shape@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/shape/-/shape-0.44.1.tgz#ff4d5d42b07c5781306677bffee43234b756ea8e"
integrity sha512-8mCDQmyTEhDK+HX8Tap2Lc82QlVySlXU8zDCNkWoIn1ge+UnRezSDjE4y4P1ABegN5PrkJZPartuQ1U0ttIYXw==
dependencies:
"@material/feature-targeting" "^0.44.1"
"@material/slider@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/slider/-/slider-0.44.0.tgz#2055df894eb725e541cde50a544719c07934755b"
integrity sha512-Lnn2fdUesXX4O0UpJzveEuOj+og+dXCwhal73u3l3NXEdc/eRgYxwWdF3ww4MmCZ786EwUmjb4vIc9olN4DO3A==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/rtl" "^0.42.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/snackbar@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/snackbar/-/snackbar-0.44.0.tgz#d98672b849f5f295e4fac2d474a9c80f11945518"
integrity sha512-KhCrmJm8Zu/ZZPuRCGfMKsZ0vudINlNgTjlOau0kQ/UgR1xBUvLOE8NjyXZr0RQz5obyW7xpyIWIpscn0IUeyw==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/button" "^0.44.0"
"@material/dom" "^0.41.0"
"@material/icon-button" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/switch@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/switch/-/switch-0.44.0.tgz#f2cbb447437b12eb3bc7f0ec8318dbd3b4f0afce"
integrity sha512-EadCg6lHUF260R2Q/l++vXIITqacvbXlobSoewA5ib6y9BU2g7l13wL1W8xAVJNUMgFa/PyN+EKT3oCql7jZLg==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/selection-control" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/tab-bar@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/tab-bar/-/tab-bar-0.44.0.tgz#b17d791bd557b1d84892fef1a1d8b8d6fef7c6d6"
integrity sha512-kCrt05d61YXyY43SNc0dPGuqysbcLr/KRDBvzpXgE4gv2jCCVhhjAH10KPlx8pthp/UtvrYJHb34acAKEGzdHA==
dependencies:
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/tab" "^0.44.0"
"@material/tab-scroller" "^0.44.0"
"@material/tab-indicator@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@material/tab-indicator/-/tab-indicator-0.43.0.tgz#37fd05513ba55ae218d9068c986c2676096fd6eb"
integrity sha512-RMNMQpWYghWpM6d0ayfuHEPzTiebKG0bMthViiD6tly8PubmOT8mShNhPm8ihybhDPUOLSz+7V4QNE5wikLEYg==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/theme" "^0.43.0"
"@material/tab-scroller@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/tab-scroller/-/tab-scroller-0.44.0.tgz#82d092ed45d2ee9d82038bed318e6ff6bdc36dad"
integrity sha512-Ufd3NWBN11kY2oA7bGmTYWGP1uz2mq0tfDM0JOiqoLMgD7y3Z18kmxnpq2qkg1vi4kvix28hBYGGMfLlq9rGDA==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/tab" "^0.44.0"
"@material/tab@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/tab/-/tab-0.44.0.tgz#254b92cff99015f0bd59a86d08d3f1c4744d0742"
integrity sha512-czrbGjtKkmUS3iYBX523xT5GOkjP0h+0x9fTnw+heFNpw5dCn6cZvlj3D9ayZU+ZH93x68TFhFVBuLU5f0EBXw==
dependencies:
"@material/base" "^0.41.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/tab-indicator" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/textfield@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/textfield/-/textfield-0.44.0.tgz#277b33948ddff33f7f643323895e5a683f013601"
integrity sha512-IMBwMcE82eVU+Wifpu0t84tozvBPLCeqQELDtZNYujKg3RxaultzJLwIyGKPMZ9R4yPEpV2vgXPGKE+2/AWt0g==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/floating-label" "^0.44.0"
"@material/line-ripple" "^0.43.0"
"@material/notched-outline" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/textfield@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/textfield/-/textfield-0.44.1.tgz#2bba41cc94e68e328683997a1acf222b643dea9c"
integrity sha512-zy+56+uqr+L9DGrdOfQjOIMdKlai/7ruyqVfqIY6ieABM7LEGsOsxHhyExQmXo9IiuFhrOceWKFa4yIb8jBsmQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/floating-label" "^0.44.1"
"@material/line-ripple" "^0.43.0"
"@material/notched-outline" "^0.44.1"
"@material/ripple" "^0.44.1"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.44.1"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.1"
"@material/theme@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@material/theme/-/theme-0.43.0.tgz#6d9fa113c82e841817882172c152d60d2d203ca6"
integrity sha512-/zndZL6EihI18v2mYd4O8xvOBAAXmLeHyHVK28LozSAaJ9okQgD25wq5Ktk95oMTmPIC+rH66KcK6371ivNk8g==
"@material/toolbar@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/toolbar/-/toolbar-0.44.0.tgz#6689aecdeccc78b7a890a3abbe8b68a2c6339307"
integrity sha512-YgLlOFQ5VzFLQBpXYSMviEbYox0fia+sasHuYPUhTAtas1ExVt9EEiIolDSVvhv2PruTReKKefxSbXAqGlOHog==
dependencies:
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/top-app-bar@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/top-app-bar/-/top-app-bar-0.44.0.tgz#2495c7f9567568fb961ccced24f479c4806a72af"
integrity sha512-tf0yXQJARYs8UPaH8oo3LnsSHEiur7Zm8Fc3hv3F0gNRRaZYBjwsMQMVbZZaWoQCWskMALyntBg+Fo18zdgDxw==
dependencies:
"@material/animation" "^0.41.0"
"@material/base" "^0.41.0"
"@material/elevation" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/shape" "^0.43.0"
"@material/theme" "^0.43.0"
"@material/typography" "^0.44.0"
"@material/typography@^0.44.0":
version "0.44.0"
resolved "https://registry.yarnpkg.com/@material/typography/-/typography-0.44.0.tgz#cf61dce2ee89bfa084d86e1b0f270a585bf9dfaf"
integrity sha512-m4SjA9OjZRDKowN3cPzEa8e2GlTlEn3ZmW/Fy9eRNSp83iY+8a0xl6kCaF80v5qAVwVcpfEFyEHWxMJtkBw2uA==
"@material/typography@^0.44.1":
version "0.44.1"
resolved "https://registry.yarnpkg.com/@material/typography/-/typography-0.44.1.tgz#a94f01172f9122180bc2ce0aa55658183a35590d"
integrity sha512-wMXHusg+Lp5Fdgoj3m0c+Lt6GCeGSh3EPRtQ1TQ2bwdBa0et2FqBaQRgXoq3tVmr0O/7unTfa0DoXlh4nVp1wA==
dependencies:
"@material/feature-targeting" "^0.44.1"
focus-trap@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-4.0.2.tgz#4ee2b96547c9ea0e4252a2d4b2cca68944194663"
integrity sha512-HtLjfAK7Hp2qbBtLS6wEznID1mPT+48ZnP2nkHzgjpL4kroYHg0CdqJ5cTXk+UO5znAxF5fRUkhdyfgrhh8Lzw==
dependencies:
tabbable "^3.1.2"
xtend "^4.0.1"
material-components-web@^0.44.0:
version "0.44.0"
resolved "https://registry.yarnpkg.com/material-components-web/-/material-components-web-0.44.0.tgz#ff782e8d7bdd8212d3c6022a731258d0d42da531"
integrity sha512-BSRLf58SMVhAvlDhJDlcgYuvzeMwbMHKTJ7oIB8LaM24ZpXBxP9XCYJpKheMtiVLrgllCGDlJ/47OIDReHQXdQ==
dependencies:
"@material/animation" "^0.41.0"
"@material/auto-init" "^0.41.0"
"@material/base" "^0.41.0"
"@material/button" "^0.44.0"
"@material/card" "^0.44.0"
"@material/checkbox" "^0.44.0"
"@material/chips" "^0.44.0"
"@material/dialog" "^0.44.0"
"@material/dom" "^0.41.0"
"@material/drawer" "^0.44.0"
"@material/elevation" "^0.44.0"
"@material/fab" "^0.44.0"
"@material/feature-targeting" "^0.44.0"
"@material/floating-label" "^0.44.0"
"@material/form-field" "^0.44.0"
"@material/grid-list" "^0.44.0"
"@material/icon-button" "^0.44.0"
"@material/icon-toggle" "^0.44.0"
"@material/image-list" "^0.44.0"
"@material/layout-grid" "^0.41.0"
"@material/line-ripple" "^0.43.0"
"@material/linear-progress" "^0.43.0"
"@material/list" "^0.44.0"
"@material/menu" "^0.44.0"
"@material/menu-surface" "^0.44.0"
"@material/notched-outline" "^0.44.0"
"@material/radio" "^0.44.0"
"@material/ripple" "^0.44.0"
"@material/rtl" "^0.42.0"
"@material/select" "^0.44.0"
"@material/selection-control" "^0.44.0"
"@material/shape" "^0.43.0"
"@material/slider" "^0.44.0"
"@material/snackbar" "^0.44.0"
"@material/switch" "^0.44.0"
"@material/tab" "^0.44.0"
"@material/tab-bar" "^0.44.0"
"@material/tab-indicator" "^0.43.0"
"@material/tab-scroller" "^0.44.0"
"@material/textfield" "^0.44.0"
"@material/theme" "^0.43.0"
"@material/toolbar" "^0.44.0"
"@material/top-app-bar" "^0.44.0"
"@material/typography" "^0.44.0"
tabbable@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-3.1.2.tgz#f2d16cccd01f400e38635c7181adfe0ad965a4a2"
integrity sha512-wjB6puVXTYO0BSFtCmWQubA/KIn7Xvajw0x0l6eJUudMG/EAiJvIUnyNX6xO4NpGrJ16lbD0eUseB9WxW0vlpQ==
xtend@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

View File

@@ -1,42 +0,0 @@
{
"manifest_version": 2,
"name": "Coder",
"version": "1",
"icons": {
"128": "icon_128.png"
},
"permissions": [
"storage",
"webview",
"http://*/*",
"https://*/*"
],
"app": {
"background": {
"scripts": [
"out/background.js"
]
},
"content": {
"scripts": [
"out/content.js"
]
}
},
"commands": {
"toggle-feature-foo": {
"suggested_key": {
"default": "Ctrl+W"
},
"description": "Toggle feature foo",
"global": true
}
},
"sockets": {
"tcpServer": {
"listen": [
""
]
}
}
}

View File

@@ -1,9 +0,0 @@
{
"name": "@coder/chrome-app",
"dependencies": {
"@types/chrome": "^0.0.79"
},
"scripts": {
"build": "../../../node_modules/.bin/webpack --config ./webpack.config.js"
}
}

View File

@@ -1,13 +0,0 @@
/// <reference path="../node_modules/@types/chrome/index.d.ts" />
// tslint:disable-next-line:no-any
const chromeApp = (<any>chrome).app;
chromeApp.runtime.onLaunched.addListener(() => {
chromeApp.window.create("src/index.html", {
outerBounds: {
width: 400,
height: 500,
},
});
});

View File

@@ -1,92 +0,0 @@
//@ts-ignore
import { TcpHost, TcpServer, TcpConnection } from "@coder/app/common/src/app";
import { Event, Emitter } from "@coder/events/src";
export const tcpHost: TcpHost = {
listen(host: string, port: number): Promise<TcpServer> {
const socketApi: {
readonly tcpServer: {
create(props: {}, cb: (createInfo: { readonly socketId: number }) => void): void;
listen(socketId: number, address: string, port: number, callback: (result: number) => void): void;
disconnect(socketId: number, callback: () => void): void;
readonly onAccept: {
addListener(callback: (info: { readonly socketId: number; readonly clientSocketId: number }) => void): void;
};
};
readonly tcp: {
readonly onReceive: {
addListener(callback: (info: { readonly socketId: number; readonly data: ArrayBuffer; }) => void): void;
};
close(socketId: number, callback?: () => void): void;
send(socketId: number, data: ArrayBuffer, callback?: () => void): void;
setPaused(socketId: number, value: boolean): void;
};
// tslint:disable-next-line:no-any
} = (<any>chrome).sockets;
return new Promise((resolve, reject): void => {
socketApi.tcpServer.create({}, (createInfo) => {
const serverSocketId = createInfo.socketId;
socketApi.tcpServer.listen(serverSocketId, host, port, (result) => {
if (result < 0) {
return reject("Failed to listen: " + chrome.runtime.lastError);
}
const connectionEmitter = new Emitter<TcpConnection>();
socketApi.tcpServer.onAccept.addListener((info) => {
if (info.socketId !== serverSocketId) {
return;
}
const dataEmitter = new Emitter<ArrayBuffer>();
socketApi.tcp.onReceive.addListener((recvInfo) => {
if (recvInfo.socketId !== info.clientSocketId) {
return;
}
dataEmitter.emit(recvInfo.data);
});
socketApi.tcp.setPaused(info.clientSocketId, false);
connectionEmitter.emit({
send: (data): Promise<void> => {
return new Promise<void>((res): void => {
socketApi.tcp.send(info.clientSocketId, data, () => {
res();
});
});
},
close: (): Promise<void> => {
return new Promise((res): void => {
socketApi.tcp.close(info.clientSocketId, () => {
res();
});
});
},
get onData(): Event<ArrayBuffer> {
return dataEmitter.event;
},
});
});
resolve({
get onConnection(): Event<TcpConnection> {
return connectionEmitter.event;
},
close: (): Promise<void> => {
return new Promise((res): void => {
socketApi.tcpServer.disconnect(serverSocketId, () => {
res();
});
});
},
});
});
});
});
},
};

View File

@@ -1,33 +0,0 @@
import { create } from "@coder/app/common/src/app";
import { tcpHost } from "./chome";
create({
storage: {
get: <T>(key: string): Promise<T | undefined> => {
return new Promise<T | undefined>((resolve, reject): void => {
try {
chrome.storage.sync.get(key, (items) => {
resolve(items[key]);
});
} catch (ex) {
reject(ex);
}
});
},
set: <T>(key: string, value: T): Promise<void> => {
return new Promise<void>((resolve, reject): void => {
try {
chrome.storage.sync.set({
[key]: value,
}, () => {
resolve();
});
} catch (ex) {
reject(ex);
}
});
},
},
tcp: tcpHost,
node: document.getElementById("main") as HTMLDivElement,
});

View File

@@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="style-src 'self' https://use.typekit.net; font-src 'self' https://use.typekit.net;">
<link rel="stylesheet" type="text/css" href="/out/main.css">
</head>
<body>
<div id="main"></div>
<script src="/out/content.js"></script>
</body>
</html>

View File

@@ -1,37 +0,0 @@
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const HtmlWebpackPlugin = require("html-webpack-plugin");
const prod = process.env.NODE_ENV === "production";
module.exports = [
merge(require(path.join(__dirname, "../../../scripts", "webpack.general.config.js"))(), {
devtool: "none",
mode: "development",
target: "web",
output: {
path: path.join(__dirname, "out"),
filename: "background.js",
},
entry: [
"./packages/app/chrome/src/background.ts"
],
plugins: [
]
}),
merge(require(path.join(__dirname, "../../../scripts", "webpack.general.config.js"))(), {
devtool: "none",
mode: "development",
target: "web",
output: {
path: path.join(__dirname, "out"),
filename: "content.js",
},
entry: [
"./packages/app/chrome/src/content.ts"
],
plugins: [
]
}),
];

View File

@@ -1,22 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chrome@^0.0.79":
version "0.0.79"
resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.79.tgz#1c83b35bd9b21b6204fb56e4816a1ea65dc013e5"
integrity sha512-4+Xducpig6lpwVX65Hk8KSZwRoURHXMDbd38SDNcV8TBaw4xyJki39fjB1io2h7ip+BsyFvgTm9OxR5qneLPiA==
dependencies:
"@types/filesystem" "*"
"@types/filesystem@*":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.29.tgz#ee3748eb5be140dcf980c3bd35f11aec5f7a3748"
integrity sha512-85/1KfRedmfPGsbK8YzeaQUyV1FQAvMPMTuWFQ5EkLd2w7szhNO96bk3Rh/SKmOfd9co2rCLf0Voy4o7ECBOvw==
dependencies:
"@types/filewriter" "*"
"@types/filewriter@*":
version "0.0.28"
resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.28.tgz#c054e8af4d9dd75db4e63abc76f885168714d4b3"
integrity sha1-wFTor02d11205jq8dviFFocU1LM=

View File

@@ -1,13 +0,0 @@
{
"name": "@coder/app-common",
"main": "src/app.ts",
"dependencies": {
"material-components-web": "^0.44.0",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
"devDependencies": {
"@types/react": "^16.8.2",
"@types/react-dom": "^16.8.0"
}
}

View File

@@ -1,279 +0,0 @@
@font-face {
font-family: 'aktiv-grotesk';
font-weight: 400;
// src: url("fonts/AktivGroteskRegular.ttf"); /* IE9 Compat Modes */
src: url("fonts/AktivGroteskRegular.woff2") format("woff2"), url("fonts/AktivGroteskRegular.woff") format("woff"); /* Pretty Modern Browsers */
}
@font-face {
font-family: 'aktiv-grotesk';
font-weight: 500;
src: url("fonts/AktivGroteskMedium.woff2") format("woff2"), url("fonts/AktivGroteskMedium.woff") format("woff"); /* Pretty Modern Browsers */
// src: url("fonts/AktivGroteskMedium.ttf");
}
@font-face {
font-family: 'aktiv-grotesk';
font-weight: 700;
src: url("fonts/AktivGroteskBold.woff2") format("woff2"), url("fonts/AktivGroteskBold.woff") format("woff"); /* Pretty Modern Browsers */
// src: url("fonts/AktivGroteskBold.ttf") format("ttf"); /* IE9 Compat Modes */
}
body, button, input {
font-family: 'aktiv-grotesk',sans-serif !important;
}
body {
margin: 0;
background-color: #F6F8FB;
--mdc-theme-primary: #2A2E37;
}
webview {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0;
pointer-events: none;
transition: 150ms opacity ease;
&.active {
opacity: 1;
pointer-events: all;
}
}
.logo-fill {
fill: #2A2E37;
}
.main {
& > .header {
width: 100%;
height: 71px;
border-bottom: 1px solid rgba(117, 122, 131, 0.1);
display: flex;
margin-bottom: 60px;
.logo {
max-height: fit-content;
width: 145px;
}
.shrinker {
max-width: 1145px;
width: 100%;
margin: 0 auto;
display: flex;
}
}
.content {
max-width: 960px;
width: 100%;
padding-bottom: 100px;
margin: 0 auto;
}
}
.servers {
color: #2B343B;
& > .header {
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 21px;
h3 {
font-size: 24px;
font-weight: 500;
letter-spacing: 0.35px;
line-height: 33px;
margin: 0;
margin-left: 30px;
}
.add-server {
margin-left: auto;
border-radius: 24px;
font-weight: bold;
font-size: 14px;
letter-spacing: 1.25px;
}
.refresh {
margin-left: 16px;
margin-right: 15px;
cursor: pointer;
svg {
@keyframes rotate {
100% { transform: rotate(360deg); }
}
&.refreshing {
animation: rotate 1s linear infinite;
}
}
}
}
& > .grid {
display: grid;
grid-template-columns: 1fr 1.6fr 1.3fr 1.1fr 0.6fr 0.4fr;
box-shadow: 0 18px 80px 10px rgba(69, 65, 78, 0.08);
border-radius: 0 0 5px 5px;
.mdc-linear-progress {
grid-column-start: 1;
grid-column-end: 7;
// height: 0;
position: relative;
--mdc-theme-primary: rgb(107, 109, 102);
height: 5px;
&:after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: #2A2E37;
transition: 500ms opacity ease;
content: " ";
}
&.loading {
&:after {
opacity: 0;
}
}
}
.title, .value {
padding-top: 14px;
padding-bottom: 14px;
}
.title {
background-color: var(--mdc-theme-primary);
font-size: 10px;
color: #9D9FA4;
font-weight: bold;
letter-spacing: 2px;
line-height: 12px;
text-transform: uppercase;
// padding-top: 15px;
// padding-bottom: 10px;
&:first-child {
padding-left: 30px;
border-radius: 10px 0 0 0;
}
&:nth-child(6) {
padding-right: 30px;
border-radius: 0 10px 0 0;
}
&.servername {
color: white;
}
}
.value {
border-top: 1px solid #EBEBF2;
font-size: 14px;
letter-spacing: 0.2px;
display: flex;
align-items: center;
color: #717680;
background-color: white;
&.dark {
background-color: #F6F8FB;
}
&.servername {
.logo {
height: 25px;
}
}
&.strong {
font-weight: 600;
color: #2B343B;
font-size: 14px;
letter-spacing: 0.6px;
}
&.status {
padding-left: 36px;
span {
margin-left: 7px;
line-height: 0px;
}
}
&.buttons {
button {
margin-left: auto;
border-radius: 24px;
border: 1px solid #CFD1D7;
font-size: 14px;
font-weight: bold;
letter-spacing: 1.25px;
line-height: 16px;
padding-left: 18px;
padding-right: 18px;
}
}
&.icons {
padding-left: 16px;
}
&:last-child {
border-bottom-right-radius: 5px;
}
&:nth-last-child(6) {
border-bottom-left-radius: 5px;
}
}
}
}
.flex-row {
display: flex;
flex-direction: row;
}
.floater {
box-shadow: 0 8px 80px 10px rgba(69, 65, 78, 0.08);
border-radius: 10px;
padding: 3em;
min-width: 300px;
width: 100%;
& > h1 {
font-size: 3.5em;
margin-top: 0px;
// margin-bottom: 0px;
}
}
.mdc-ripple-upgraded--unbounded {
padding: 2px;
padding-top: 5px;
cursor: pointer;
}

View File

@@ -1,33 +0,0 @@
//@ts-ignore
import { MDCTextField } from "@material/textfield";
import { TcpHost } from "./connection";
import { StorageProvider } from "./storage";
import "material-components-web/dist/material-components-web.css";
import "./app.scss";
import "./tooltip.scss";
import * as React from "react";
import { render } from "react-dom";
import { Main } from "./containers";
export * from "./connection";
export interface App {
readonly tcp: TcpHost;
readonly storage: StorageProvider;
readonly node: HTMLElement;
}
export interface RegisteredServer {
readonly host: "coder" | "self";
readonly hostname: string;
readonly name: string;
}
export const create = async (app: App): Promise<void> => {
let servers = await app.storage.get<RegisteredServer[]>("servers");
if (!servers) {
servers = [];
}
render(<Main />, app.node);
};

View File

@@ -1,17 +0,0 @@
import { Event } from "@coder/events";
import { TunnelCloseEvent } from "@coder/tunnel/src/client";
export interface TcpHost {
listen(host: string, port: number): Promise<TcpServer>;
}
export interface TcpServer {
readonly onConnection: Event<TcpConnection>;
close(): Promise<void>;
}
export interface TcpConnection {
readonly onData: Event<ArrayBuffer>;
send(data: ArrayBuffer): Promise<void>;
close(): Promise<void>;
}

View File

@@ -1,573 +0,0 @@
//@ts-ignore
import { MDCRipple } from "@material/ripple";
//@ts-ignore
import { MDCTextField } from "@material/textfield";
//@ts-ignore
import { MDCLinearProgress } from "@material/linear-progress";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { RegisteredServer } from "./app";
// tslint:disable-next-line:no-any
declare var WebSettings: any;
interface AuthedUser {
readonly username: string;
}
export class Main extends React.Component<void, {
readonly view: "servers" | "add-server";
readonly loading: boolean;
}> {
private webview: HTMLWebViewElement | undefined;
public constructor(props: void) {
super(props);
this.state = {
view: "servers",
loading: false,
};
}
public componentDidMount(): void {
window.addEventListener("message", (event) => {
if (event.data === "back") {
if (this.webview) {
this.webview.classList.remove("active");
}
}
if (event.data === "loaded") {
if (this.webview) {
// this.setState({ loading: false });
// this.webview.classList.add("active");
}
}
});
if (this.webview) {
this.webview.addEventListener("error", (event) => {
console.error(event);
});
this.webview.addEventListener("loadstart", (event) => {
this.setState({ loading: true });
});
this.webview.addEventListener("loadstop", (event) => {
this.setState({ loading: false });
this.webview!.classList.add("active");
// tslint:disable-next-line:no-any
const cw = (this.webview as any).contentWindow as Window;
cw.postMessage("app", "*");
});
}
}
public render(): JSX.Element {
return (
<div className="main">
<div className="header">
<div className="shrinker">
<Logo />
</div>
</div>
<div className="content">
{((): JSX.Element => {
switch (this.state.view) {
case "servers":
return (
<Servers servers={[
{
host: "coder",
hostname: "--",
name: "Coder",
},
{
host: "self",
hostname: "http://localhost:8080",
name: "Dev Server",
},
]}
user={{
username: "Kyle",
}}
onSelect={(server): void => {
if (this.webview) {
this.webview.setAttribute("src", server.hostname);
}
}}
onAddServer={() => this.setState({ view: "add-server" })}
loading={this.state.loading}
/>
);
case "add-server":
return (
<div>Add server</div>
);
}
})()}
</div>
<webview ref={(wv: HTMLWebViewElement): HTMLWebViewElement => this.webview = wv}></webview>
</div>
);
}
}
export class AddServer extends React.Component {
public render(): JSX.Element {
return (
<div className="add-server">
<h3>Add Server</h3>
<p>Something about what you can do once you add your own server. A link to setup guides for this would be great as well.</p>
<Input label="Address" id="address" />
<br></br>
</div>
);
}
}
export class Servers extends React.Component<{
readonly user?: AuthedUser;
readonly servers: ReadonlyArray<RegisteredServer>;
readonly onSelect: (server: RegisteredServer) => void;
readonly onAddServer: () => void;
readonly loading: boolean;
}, {
readonly refreshing: boolean;
}> {
// tslint:disable-next-line:no-any
public constructor(props: any) {
super(props);
this.state = {
refreshing: false,
};
}
public render(): JSX.Element {
return (
<div className="servers">
<div className="header">
<h3>Servers</h3>
<Button onClick={(): void => this.props.onAddServer()} className="add-server" type="unelevated">Add Server</Button>
<Ripple>
<div className="refresh">
<svg onClick={(): void => this.doRefresh()} className={this.state.refreshing ? "refreshing" : ""} width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g>
<g transform="translate(4.000000, 4.000000)" fill="#2A2E37">
<path d="M8,3 C9.179,3 10.311,3.423 11.205,4.17 L8.883,6.492 L15.094,7.031 L14.555,0.82 L12.625,2.75 C11.353,1.632 9.71,1 8,1 C4.567,1 1.664,3.454 1.097,6.834 L3.07,7.165 C3.474,4.752 5.548,3 8,3 Z" id="Path"></path>
<path d="M8,13 C6.821,13 5.689,12.577 4.795,11.83 L7.117,9.508 L0.906,8.969 L1.445,15.18 L3.375,13.25 C4.647,14.368 6.29,15 8,15 C11.433,15 14.336,12.546 14.903,9.166 L12.93,8.835 C12.526,11.248 10.452,13 8,13 Z" id="Path"></path>
</g>
<rect id="Rectangle" fillRule="nonzero" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</svg>
</div>
</Ripple>
</div>
<div className="grid">
<div className="title status">
Status
</div>
<div className="title servername">
Server Name
</div>
<div className="title hostname">
Hostname
</div>
<div className="title details">
Details
</div>
<div className="title">
{/* Used for continue/launch buttons */}
</div>
<div className="title">
{/* Used for logout and delete buttons */}
</div>
<div role="progressbar" className={`mdc-linear-progress mdc-linear-progress--indeterminate ${this.props.loading ? "loading" : ""}`} ref={(d) => {
if (d) new MDCLinearProgress(d)}}>
<div className="mdc-linear-progress__buffering-dots"></div>
<div className="mdc-linear-progress__buffer"></div>
<div className="mdc-linear-progress__bar mdc-linear-progress__primary-bar">
<span className="mdc-linear-progress__bar-inner"></span>
</div>
<div className="mdc-linear-progress__bar mdc-linear-progress__secondary-bar">
<span className="mdc-linear-progress__bar-inner"></span>
</div>
</div>
{this.props.servers.map((server, i) => {
return (
<Server key={server.hostname + i} user={this.props.user} server={server} onSelect={(): void => this.props.onSelect(server)} />
);
})}
</div>
</div>
);
}
private doRefresh(): void {
if (this.state.refreshing) {
return;
}
this.setState({
refreshing: true,
}, () => {
setTimeout(() => {
this.setState({
refreshing: false,
});
}, 1500);
});
}
}
interface ServerProps {
readonly user?: AuthedUser;
readonly server: RegisteredServer;
readonly onSelect: () => void;
}
export class Server extends React.Component<ServerProps, {
readonly user?: AuthedUser;
readonly status: "Online" | "Offline" | "Checking";
readonly version: string;
}> {
// tslint:disable-next-line:no-any
public constructor(props: ServerProps) {
super(props);
this.state = {
status: props.server.host === "coder" ? "Online" : "Checking",
version: "",
};
}
public componentWillMount(): void {
if (this.props.server.host !== "self") {
return;
}
const xhr = new XMLHttpRequest();
xhr.open("GET", this.props.server.hostname);
xhr.addEventListener("error", (err) => {
this.setState({
status: "Offline",
});
});
xhr.addEventListener("loadend", () => {
if (xhr.status === 200) {
this.setState({
status: "Online",
version: process.env.VERSION,
});
} else {
this.setState({
status: "Offline",
});
}
});
xhr.send();
}
public render(): JSX.Element {
return (
<>
<div className={`status value ${this.extraClasses}`}>
{((): JSX.Element => {
switch (this.state.status) {
case "Offline":
return (
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g id="Artboard-Copy-3" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<circle id="Oval" stroke="#2B343B" strokeWidth="1.5" fillRule="nonzero" cx="8" cy="8" r="7.25"></circle>
<path d="M5.15444712,5.15444712 L10.8455529,10.8455529" id="Path-4" stroke="#2B343B" strokeWidth="1.5" fillRule="nonzero"></path>
<path d="M5.15444712,5.15444712 L10.8455529,10.8455529" id="Path-4" stroke="#2B343B" strokeWidth="1.5" fillRule="nonzero" transform="translate(8.000000, 8.000000) scale(-1, 1) translate(-8.000000, -8.000000) "></path>
</g>
</svg>
);
case "Online":
return (
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g id="Artboard-Copy-4" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g id="checkmark-copy-21" fillRule="nonzero">
<circle id="Oval" fill="#2B343B" cx="8" cy="8" r="8"></circle>
<polyline id="Path-2" stroke="#FFFFFF" strokeWidth="1.5" points="3.46296296 8.62222222 6.05555556 11.1111111 12.537037 4.88888889"></polyline>
</g>
</g>
</svg>
);
case "Checking":
return (
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g id="Artboard-Copy-5" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<circle id="Oval" stroke="#2B343B" strokeWidth="1.5" fillRule="nonzero" cx="8" cy="8" r="7.25"></circle>
<polyline id="Path" stroke="#2B343B" strokeWidth="1.5" points="7.90558664 4.63916767 7.90558664 8.63916767 11.9055866 8.63916767"></polyline>
</g>
</svg>
);
default:
throw new Error("unsupported status");
}
})()}
<span>
{this.state.status}
</span>
</div>
<div className={`servername value strong ${this.extraClasses}`}>
{this.props.server.host === "coder" ? (
<Logo />
) : this.props.server.name}
</div>
<div className={`hostname value ${this.extraClasses}`}>
{this.props.server.hostname}
</div>
<div className={`details value ${this.extraClasses}`}>
{this.props.server.host === "coder" && this.props.user ? `Logged in as ${this.props.user.username}` : this.state.version}
</div>
<div className={`buttons value ${this.extraClasses}`}>
<Button onClick={(): void => this.props.onSelect()} className="add-server" type="outlined">{this.props.server.host === "coder" ? "Continue" : "Launch"}</Button>
</div>
<div className={`icons value ${this.extraClasses}`}>
<Ripple>
<div>
{this.props.server.host === "coder" ? (
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g id="log-out-copy-2" transform="translate(4.000000, 4.000000)" fill="#2A2E37">
<polygon id="Path" points="4 4 0 8 4 12 4 9 10 9 10 7 4 7"></polygon>
<path d="M15,16 L6,16 C5.4,16 5,15.6 5,15 L5,12 L7,12 L7,14 L14,14 L14,2 L7,2 L7,4 L5,4 L5,1 C5,0.4 5.4,0 6,0 L15,0 C15.6,0 16,0.4 16,1 L16,15 C16,15.6 15.6,16 15,16 Z" id="Path"></path>
</g>
</g>
</svg>
) : (
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<g id="Artboard" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g id="bin" transform="translate(4.000000, 4.000000)" fill="#2B343B">
<rect id="Rectangle" x="5" y="7" width="2" height="6"></rect>
<rect id="Rectangle" x="9" y="7" width="2" height="6"></rect>
<path d="M12,1 C12,0.4 11.6,0 11,0 L5,0 C4.4,0 4,0.4 4,1 L4,3 L0,3 L0,5 L1,5 L1,15 C1,15.6 1.4,16 2,16 L14,16 C14.6,16 15,15.6 15,15 L15,5 L16,5 L16,3 L12,3 L12,1 Z M6,2 L10,2 L10,3 L6,3 L6,2 Z M13,5 L13,14 L3,14 L3,5 L13,5 Z" id="Shape" fillRule="nonzero"></path>
</g>
</g>
</svg>
)}
</div>
</Ripple>
</div>
</>
);
}
private get extraClasses(): string {
return this.props.server.host === "coder" ? "dark" : "";
}
}
export class Input extends React.Component<{
readonly label: string;
readonly id: string;
readonly type?: string;
}> {
private wrapper: HTMLDivElement | undefined;
public componentDidMount(): void {
if (this.wrapper) {
const textInput = new MDCTextField(this.wrapper);
}
}
public render(): JSX.Element {
return (
<div className="mdc-text-field mdc-text-field--outlined" ref={(i: HTMLDivElement): HTMLDivElement => this.wrapper = i}>
<input type={this.props.type || "text"} id={this.props.id} className="mdc-text-field__input" spellCheck={false}></input>
<div className="mdc-notched-outline">
<div className="mdc-notched-outline__leading"></div>
<div className="mdc-notched-outline__notch">
<label htmlFor={this.props.id} className="mdc-floating-label">{this.props.label}</label>
</div>
<div className="mdc-notched-outline__trailing"></div>
</div>
</div>
);
}
}
export class Button extends React.Component<{
readonly type: "outlined" | "unelevated";
readonly className?: string;
readonly onClick?: () => void;
}> {
private button: HTMLButtonElement | undefined;
public componentDidMount(): void {
if (this.button) {
const b = new MDCRipple(this.button);
}
}
public render(): JSX.Element {
return (
<button onClick={() => this.props.onClick ? this.props.onClick() : undefined} className={`mdc-button mdc-button--${this.props.type} ${this.props.className || ""}`} ref={(b: HTMLButtonElement): HTMLButtonElement => this.button = b}>
<span className="mdc-button__label">{this.props.children}</span>
</button>
);
}
}
export class Tooltip extends React.Component<{
readonly message: string;
}> {
public componentDidMount(): void {
Object.keys(this.refs).forEach((ref) => {
const el = this.refs[ref];
if (el) {
const element = ReactDOM.findDOMNode(el);
if (element) {
const te = document.createElement("div");
te.className = "md-tooltip-content";
te.innerHTML = this.props.message;
element.appendChild(te);
(element as HTMLElement).classList.add("md-tooltip");
}
}
});
}
public render(): JSX.Element {
return (
<>
{React.Children.map(this.props.children, (element, idx) => {
return React.cloneElement(element as any, { ref: idx });
})}
</>
);
}
}
export class Ripple extends React.Component<{
readonly className?: string;
}> {
public componentDidMount(): void {
Object.keys(this.refs).forEach((ref) => {
const el = this.refs[ref];
if (el) {
const element = ReactDOM.findDOMNode(el);
if (element) {
(element as HTMLElement).classList.add("mdc-ripple-surface");
(element as HTMLElement).setAttribute("data-mdc-ripple-is-unbounded", "");
const r = new MDCRipple(element);
}
}
});
}
public render(): JSX.Element {
return (
<>
{React.Children.map(this.props.children, (element, idx) => {
return React.cloneElement(element as any, { ref: idx });
})}
</>
);
}
}
export class Logo extends React.Component {
public render(): JSX.Element {
return (
<svg className="logo" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 471 117"
style={{enableBackground: "new 0 0 471 117"} as any} xmlSpace="preserve">
<g>
<g>
<path className="logo-fill" d="M217,75.6c5.9,0,10.7-2.3,14.5-7l7.7,7.9c-6.1,6.9-13.3,10.3-21.6,10.3s-15.1-2.6-20.5-7.9
C191.7,73.7,189,67,189,59s2.7-14.7,8.2-20s12.2-8,20.1-8c8.8,0,16.2,3.4,22.2,10.1l-7.5,8.5c-3.8-4.7-8.5-7.1-14.2-7.1
c-4.5,0-8.4,1.5-11.6,4.4c-3.2,3-4.8,6.9-4.8,11.9s1.5,9,4.5,12.1C209,74.1,212.6,75.6,217,75.6z M284.1,46.7
c-3.1-3.4-6.9-5.1-11.4-5.1s-8.3,1.7-11.4,5.1s-4.6,7.5-4.6,12.3s1.5,8.9,4.6,12.3s6.9,5,11.4,5s8.3-1.7,11.4-5
c3.1-3.4,4.6-7.5,4.6-12.3S287.2,50.1,284.1,46.7z M272.7,86.8c-8,0-14.7-2.7-20.1-8s-8.2-11.9-8.2-19.9c0-7.9,2.7-14.5,8.2-19.9
c5.4-5.3,12.2-8,20.1-8c8,0,14.7,2.7,20.1,8s8.2,11.9,8.2,19.9c0,7.9-2.7,14.5-8.2,19.9C287.4,84.1,280.7,86.8,272.7,86.8z
M352.3,39.4c5.1,4.7,7.7,11.2,7.7,19.6s-2.5,15-7.5,19.9s-12.7,7.3-22.9,7.3h-18.4V32.3h19C339.8,32.4,347.2,34.7,352.3,39.4z
M343.5,71.5c3-2.8,4.4-6.8,4.4-12.1s-1.5-9.4-4.4-12.2c-3-2.9-7.5-4.3-13.6-4.3h-6.7v32.8h7.6C336.3,75.6,340.5,74.2,343.5,71.5z
M409.3,32.4v10.7h-26.8v11.1h24.1v10.3h-24.1v11.2h27.7v10.6h-39.7V32.4H409.3L409.3,32.4z M464.6,50.3c0,8.6-3.4,14.2-10.3,16.7
l13.6,19.3h-14.8l-11.9-17.2h-8.3v17.2h-12V32.4h20.4c8.4,0,14.4,1.4,17.9,4.2C462.8,39.4,464.6,44,464.6,50.3z M450.1,56.7
c1.5-1.3,2.2-3.5,2.2-6.4s-0.8-4.9-2.3-6s-4.2-1.6-8.1-1.6h-9v16h8.8C445.8,58.7,448.6,58,450.1,56.7z"/>
</g>
<g>
<path className="logo-fill" d="M164.8,50.9c-3.3,0-5.5-1.9-5.5-5.8V22.7c0-14.3-6-22.2-21.5-22.2h-7.2v15.1h2.2c6.1,0,9,3.3,9,9.2v19.8
c0,8.6,2.6,12.1,8.3,13.9c-5.7,1.7-8.3,5.3-8.3,13.9c0,4.9,0,9.8,0,14.7c0,4.1,0,8.1-1.1,12.2c-1.1,3.8-2.9,7.4-5.4,10.5
c-1.4,1.8-3,3.3-4.8,4.7v2h7.2c15.5,0,21.5-7.9,21.5-22.2V71.9c0-4,2.1-5.8,5.5-5.8h4.1V51h-4V50.9L164.8,50.9z"/>
<path className="logo-fill" d="M115.8,23.3H93.6c-0.5,0-0.9-0.4-0.9-0.9v-1.7c0-0.5,0.4-0.9,0.9-0.9h22.3c0.5,0,0.9,0.4,0.9,0.9v1.7
C116.8,22.9,116.3,23.3,115.8,23.3z"/>
<path className="logo-fill" d="M119.6,44.9h-16.2c-0.5,0-0.9-0.4-0.9-0.9v-1.7c0-0.5,0.4-0.9,0.9-0.9h16.2c0.5,0,0.9,0.4,0.9,0.9V44
C120.5,44.4,120.1,44.9,119.6,44.9z"/>
<path className="logo-fill" d="M126,34.1H93.6c-0.5,0-0.9-0.4-0.9-0.9v-1.7c0-0.5,0.4-0.9,0.9-0.9h32.3c0.5,0,0.9,0.4,0.9,0.9v1.7
C126.8,33.6,126.5,34.1,126,34.1z"/>
<g>
<path className="logo-fill" d="M67.9,28.2c2.2,0,4.4,0.2,6.5,0.7v-4.1c0-5.8,3-9.2,9-9.2h2.2V0.5h-7.2c-15.5,0-21.5,7.9-21.5,22.2v7.4
C60.4,28.9,64.1,28.2,67.9,28.2z"/>
</g>
<path className="logo-fill" d="M132.8,82.6c-1.6-12.7-11.4-23.3-24-25.7c-3.5-0.7-7-0.8-10.4-0.2c-0.1,0-0.1-0.1-0.2-0.1
c-5.5-11.5-17.3-19.1-30.1-19.1S43.6,44.9,38,56.4c-0.1,0-0.1,0.1-0.2,0.1c-3.6-0.4-7.2-0.2-10.8,0.7c-12.4,3-21.8,13.4-23.5,26
c-0.2,1.3-0.3,2.6-0.3,3.8c0,3.8,2.6,7.3,6.4,7.8c4.7,0.7,8.8-2.9,8.7-7.5c0-0.7,0-1.5,0.1-2.2c0.8-6.4,5.7-11.8,12.1-13.3
c2-0.5,4-0.6,5.9-0.3c6.1,0.8,12.1-2.3,14.7-7.7c1.9-4,4.9-7.5,8.9-9.4c4.4-2.1,9.4-2.4,14-0.8c4.8,1.7,8.4,5.3,10.6,9.8
c2.3,4.4,3.4,7.5,8.3,8.1c2,0.3,7.6,0.2,9.7,0.1c4.1,0,8.2,1.4,11.1,4.3c1.9,2,3.3,4.5,3.9,7.3c0.9,4.5-0.2,9-2.9,12.4
c-1.9,2.4-4.5,4.2-7.4,5c-1.4,0.4-2.8,0.5-4.2,0.5c-0.8,0-1.9,0-3.2,0c-4,0-12.5,0-18.9,0c-4.4,0-7.9-3.5-7.9-7.9V78.4V63.9
c0-1.2-1-2.2-2.2-2.2h-3.1c-6.1,0.1-11,6.9-11,14.1s0,26.3,0,26.3c0,7.8,6.3,14.1,14.1,14.1c0,0,34.7-0.1,35.2-0.1
c8-0.8,15.4-4.9,20.4-11.2C131.5,98.8,133.8,90.8,132.8,82.6z"/>
</g>
</g>
</svg>
);
}
}
// const $ = <K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, content?: string): HTMLElementTagNameMap[K] => {
// const el = document.createElement(tagName);
// if (className) {
// el.className = className;
// }
// if (content) {
// el.innerText = content;
// }
// return el;
// };
// const createInput = (id: string, labelName: string, type: string = "text"): HTMLDivElement => {
// // <div class="mdc-text-field mdc-text-field--outlined">
// // <input type="password" id="password" class="mdc-text-field__input">
// // <!-- <label class="mdc-floating-label" for="name">Name</label>
// // <div class="mdc-line-ripple"></div> -->
// // <div class="mdc-notched-outline">
// // <div class="mdc-notched-outline__leading"></div>
// // <div class="mdc-notched-outline__notch">
// // <label for="password" class="mdc-floating-label">Password</label>
// // </div>
// // <div class="mdc-notched-outline__trailing"></div>
// // </div>
// const wrapper = $("div", "mdc-text-field mdc-text-field--outlined");
// const input = $("input", "mdc-text-field__input");
// input.type = type;
// input.id = id;
// wrapper.appendChild(input);
// const notchedOutline = $("div", "mdc-notched-outline");
// notchedOutline.appendChild($("div", "mdc-notched-outline__leading"));
// const notch = $("div", "mdc-notched-outline__notch");
// const label = $("label", "mdc-floating-label", labelName);
// label.setAttribute("for", id);
// notch.appendChild(label);
// notchedOutline.appendChild(notch);
// wrapper.appendChild(notchedOutline);
// wrapper.appendChild($("div", "mdc-notched-outline__trailing"));
// const field = new MDCTextField(wrapper);
// return wrapper;
// };
// export const createCoderLogin = (parentNode: HTMLElement): void => {
// parentNode.appendChild($("h1", "header", "Login with Coder"));
// parentNode.appendChild(createInput("username", "Username"));
// parentNode.appendChild($("br"));
// parentNode.appendChild($("br"));
// parentNode.appendChild(createInput("password", "Password", "password"));
// };

Some files were not shown because too many files have changed in this diff Show More