Commit Graph

2749 Commits

Author SHA1 Message Date
Asher 5499a3d125
Use baseUrl when redirecting from domain proxy
This will make the route more robust since it'll work under more than
just the root.
2020-11-12 11:23:52 -06:00
Asher 31b67062b0
Remove <type> from onMessage
Turns out that while Typescript can't infer the callback return type
from it, Typescript can do the opposite and infer it from the callback
return type.
2020-11-12 11:17:45 -06:00
Asher 72931edcf0
Fix cleanup after getting message from vscode 2020-11-12 11:16:21 -06:00
Asher 79478eb89f
Clarify some points around the cookie domain
Also add a check that the domain has a dot. This covers the localhost
case as well, so remove that.
2020-11-10 18:53:38 -06:00
Asher 4574593664
Refactor vscode init to use async
Hopefully is a bit easier to read.
2020-11-10 18:21:20 -06:00
Asher 71850e312b
Avoid setting ?to=/
That's the default so it's extra visual noise.
2020-11-10 18:14:18 -06:00
Asher b8340a2ae9
Close sockets correctly 2020-11-10 17:55:04 -06:00
Asher f706039a9d
Re-add TLS socket proxy 2020-11-10 17:55:03 -06:00
Asher de4949571c
Document getFirstPath better 2020-11-10 17:02:39 -06:00
Asher 0a01338edd
Deduplicate child process message dance 2020-11-10 16:36:46 -06:00
Matthew Beckett aa7415a479
Update CODEOWNERS file 2020-11-10 20:37:14 +00:00
Matthew Beckett 10799aa1ec
Bump chart app version 2020-11-10 20:10:50 +00:00
Matthew Beckett 0e39bb9f2c
Fix trailing line breaks 2020-11-10 20:09:48 +00:00
Matthew Beckett 03aa7709ca
Add maintainers 2020-11-10 20:09:13 +00:00
Matthew Beckett 77c2a72cf8
Bump version and update README 2020-11-10 20:07:38 +00:00
Matthew Beckett f3d7d3f616
Merge branch 'master' into feature/helm3 2020-11-10 19:08:53 +00:00
Ben Potter da6000b96f
Add Slack link to issue template (#2282) 2020-11-10 14:00:05 -05:00
Anmol Sethi d969a5bd6b
Merge pull request #2252 from cdr/plugin-5d60
Plugin API to add more applications to code-server
2020-11-06 14:49:00 -05:00
Anmol Sethi fe399ff0fe
Fix formatting 2020-11-06 14:47:08 -05:00
Anmol Sethi 277211c4ce
plugin: Make init and applications callbacks optional 2020-11-06 14:47:08 -05:00
Anmol Sethi 9d39c53c99
plugin: Give test-plugin some html to test overlay 2020-11-06 14:47:08 -05:00
Anmol Sethi 197a09f0c1
plugin: Test endpoints via supertest
Unfortunately we can't use node-mocks-http to test a express.Router
that has async routes. See https://github.com/howardabrams/node-mocks-http/issues/225

router will just return undefined if the executing handler is async and
so the test will have no way to wait for it to complete. Thus, we have
to use supertest which starts an actual HTTP server in the background
and uses a HTTP client to send requests.
2020-11-06 10:13:01 -05:00
Anmol Sethi 9453f891df
plugin.ts: Fix usage of routerPath in mount 2020-11-06 10:13:01 -05:00
Anmol Sethi 14f408a837
plugin: Plugin modules now export a single top level identifier
Makes typing much easier. Addresse's Will's last comment.
2020-11-06 10:13:01 -05:00
Anmol Sethi 8a8159c683
plugin: More review fixes
Next commit will address Will's comments about the typings being weird.
2020-11-06 10:13:01 -05:00
Anmol Sethi 706bc23f04
plugin: Fixes for CI 2020-11-06 10:13:01 -05:00
Anmol Sethi af73b96313
routes/apps.ts: Add example output 2020-11-06 10:12:47 -05:00
Anmol Sethi 2a13d003d3
plugin.ts: Add homepageURL to plugin and application 2020-11-06 10:12:47 -05:00
Anmol Sethi 687094802e
plugin.ts: Make application endpoint paths absolute 2020-11-06 10:12:46 -05:00
Anmol Sethi 139a28e0ea
plugin.ts: Describe private counterpart functions
Addresses Will's comments.
2020-11-06 10:12:46 -05:00
Anmol Sethi e03bbe3149
routes/apps.ts: Implement /api/applications endpoint 2020-11-06 10:12:46 -05:00
Anmol Sethi afff86ae9c
plugin.ts: Adjust to implement pluginapi.d.ts correctly 2020-11-06 10:12:46 -05:00
Anmol Sethi fed545e67d
plugin.d.ts -> pluginapi.d.ts
More clear.
2020-11-06 10:12:46 -05:00
Anmol Sethi 6638daf6f0
plugin.d.ts: Add explicit path field and adjust types to reflect
See my discussion with Will in the PR.
2020-11-06 10:12:46 -05:00
Anmol Sethi 8d3a7721fe
plugin.d.ts: Document plugin priority correctly 2020-11-06 10:12:46 -05:00
Anmol Sethi 75e52a3774
plugin.ts: Fixes for @code-asher 2020-11-06 10:12:46 -05:00
Anmol Sethi f4d7f00033
plugin.ts: Fixes for @wbobeirne 2020-11-06 10:12:46 -05:00
Anmol Sethi ef971009d9
plugin.test.ts: Make it clear iconPath is a path 2020-11-06 10:12:46 -05:00
Anmol Sethi 30d2962e21
src/node/plugin.ts: Warn on duplicate plugin and only load first 2020-11-06 10:12:46 -05:00
Anmol Sethi 82e8a00a0d
Fix CI 2020-11-06 10:12:46 -05:00
Anmol Sethi bea185b8b2
plugin: Add basic loading test
Will work on testing overlay next.
2020-11-06 10:12:46 -05:00
Anmol Sethi e08a55d44a
src/node/plugin.ts: Implement new plugin API 2020-11-06 10:12:45 -05:00
Anmol Sethi 481df70622
ci/dev/test.sh: Pass through args 2020-11-06 10:11:57 -05:00
Anmol Sethi aa2cfa2c17
typings/plugin.d.ts: Create 2020-11-06 10:11:57 -05:00
Asher 959497067c
Document HttpError
Also type the status.
2020-11-05 17:07:58 -06:00
Asher f7076247f9
Move domain proxy to routes
This matches better with the other routes.

Also add a missing authentication check to the path proxy web socket.
2020-11-05 17:07:32 -06:00
Asher f6c4434191
Tweak proxy fallthrough behavior
It will now redirect all HTML requests. Also it avoids req.accepts since
that's always truthy.
2020-11-05 16:49:30 -06:00
Asher cb991a9143
Handle errors for JSON requests
Previously it would have just given them the error HTML.
2020-11-05 15:19:56 -06:00
Asher 3f1750cf83
Fix destroying response in update again
I added another reject that doesn't destroy the response.
2020-11-05 15:08:10 -06:00
Asher 7b2752a62c
Move websocket routes into a separate app
This is mostly so we don't have to do any wacky patching but it also
makes it so we don't have to keep checking if the request is a web
socket request every time we add middleware.
2020-11-05 15:08:09 -06:00