Commit Graph

40 Commits

Author SHA1 Message Date
Kyle Carberry fbb98b950a
chore: centralize build info for site (#13104)
The build info passed to the frontend via HTML was incorrect.
2024-04-29 20:50:49 -04:00
Garrett Delfosse 8ba05a9052
feat: add switch http(s) button to error page (#12942) 2024-04-26 11:52:53 -04:00
Steven Masley eeb3d63be6
chore: merge authorization contexts (#12816)
* chore: merge authorization contexts

Instead of 2 auth contexts from apikey and dbauthz, merge them to
just use dbauthz. It is annoying to have two.

* fixup authorization reference
2024-03-29 10:14:27 -05:00
Asher 4d39da294e
feat: add oauth2 token exchange (#12196)
Co-authored-by: Steven Masley <stevenmasley@gmail.com>
2024-02-20 14:58:43 -09:00
Steven Masley 07cccf9033
feat: disable directory listings for static files (#12229)
* feat: disable directory listings for static files

Static file server handles serving static asset files (js, css, etc).
The default file server would also list all files in a directory.
This has been changed to only serve files.
2024-02-20 15:50:30 -06:00
Marcin Tojek ad8e0db172
feat: add custom error message on signups disabled page (#11959) 2024-02-01 18:01:25 +01:00
Spike Curtis bc4ae53261
chore: refactor Appearance to an interface callable by AGPL code (#11769)
The new Agent API needs an interface for ServiceBanners, so this PR creates it and refactors the AGPL and Enterprise code to achieve it.

Before we depended on the fact that the HTTP endpoint was missing to serve an empty ServiceBanner on AGPL deployments, but that won't work with dRPC, so we need a real interface to call.
2024-01-29 12:17:31 +04:00
Marcin Tojek dae528f5e7
feat: expose application name and logo url via meta properties (#9900) 2023-09-28 10:50:40 +02:00
Steven Masley a18bf73131
chore: display warnings on app share failure (#9783)
* chore: add warnings to app share failure
Warnings only appear if the app is misconfigured to the deployment
2023-09-19 21:54:51 +00:00
Ammar Bandukwala 8f3b4075c7
ci: enable nestif linter (#9363) 2023-08-30 21:50:43 +00:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Marcin Tojek 164672e5d3
feat: expose docs URL via static meta (#8594) 2023-07-19 13:57:43 -03:00
Mathias Fredriksson f6a8a5f7be
fix(site): prevent ExtractAPIKey from dirtying the HTML output (#8450)
If `httpmw.ExtractAPIKey` fails when we are rendering an HTML page, the
HTML output will be dirtied with the error repsonse and the HTTP status
will also be wrong.

The use of this function in the `renderHTMLWithState` is additive, and
failure means we simply can't embed static data. To fix this, we can
simply pass a `http.ResponseWriter` that is no-op.

Fixes #8351
2023-07-12 15:38:30 +03:00
Cian Johnston 3f6a158016
chore: enable exhaustruct linter (#8403)
* chore: enable exhaustruct linter

* add exlusion rules

* move to allowlist instead

* exhaustruct httpmw package

* fixup! exhaustruct httpmw package

* make lint

* address PR comments
2023-07-11 14:30:33 +01:00
Mathias Fredriksson 90a3debe3f
fix(coderd): pass oauth configs to site (#8390) 2023-07-10 17:23:41 +03:00
Steven Masley f0bd258ff1
feat: move proxy settings page to deployment options (#8246)
* feat: Move workspace proxy page to deployment options

Workspace proxy settings page is now an admin feature

* WorkspaceProxy response extends region
2023-06-30 11:32:35 -04:00
Kyle Carberry f444100aa6
feat: add region querying to pre-fetched html (#8077) 2023-06-19 11:23:26 -05:00
Kyle Carberry 9df9ad4503
feat: embed common client requests into the template html (#8076)
This should reduce the number of API requests a client makes
when loading the dashboard dramatically!
2023-06-18 13:57:27 -05:00
Steven Masley 07608fc3fb
chore: fix proxy 404 page (#7421)
* chore: fix proxy 404 page

---------

Co-authored-by: Kyle Carberry <kyle@coder.com>
2023-05-05 13:53:19 -05:00
Steven Masley a1db82582f
chore: Dynamic CSP connect-src to support terminals connecting to workspace proxies (#7352)
* chore: Expose proxy hostnames to csp header
2023-05-02 08:30:44 -05:00
Bruno Quaresma ad665cef91
fix(site): Load monaco locally (#7092) 2023-04-14 13:11:28 +00:00
Bruno Quaresma 5cbe360176
fix(site): Fix CSP directives for monaco (#6709) 2023-03-21 12:51:02 -07:00
Kyle Carberry 71eecb3515
chore: embed build info in the html to reduce requests (#6605)
This will reduce a request on every page load of Coder!
2023-03-21 19:04:54 +00:00
Bruno Quaresma 2c309194e9
refactor(site): Remove untar dep and support nested folders on template version page (#6244) 2023-02-16 18:38:14 +00:00
Dean Sheather b19d644162
feat: add etag to slim binaries endpoint (#5750) 2023-01-18 04:38:08 +10:00
Dean Sheather 43b61ce33c
chore: support underscores in agent bin filenames (#5496) 2022-12-21 21:06:38 +00:00
Dean Sheather 1bc4eb5329
fix: fix security vulnerabilities reported by CodeQL (#5467) 2022-12-19 19:25:59 +00:00
Bruno Quaresma 92c5e97f85
fix: Fix CSP style directive for Monaco editor (#5360) 2022-12-08 16:53:50 -03:00
Bruno Quaresma 3c9dab34bf
fix: Fix CSP for monaco editor (#5358) 2022-12-08 18:32:41 +00:00
Bruno Quaresma e68923fa36
fix: Worker security policy (#5093) 2022-11-15 17:02:24 +00:00
Dean Sheather d165d76338
feat: static error page in applications handlers (#4299) 2022-10-05 02:30:55 +10:00
Bruno Quaresma 1755e97748
chore: Remove webpack (#4270) 2022-09-29 18:28:44 -03:00
Steven Masley 2306d2c709
chore: Fix misspelled "referrer" in site.go (#3507) 2022-08-15 14:12:34 +00:00
Ammar Bandukwala 19fcf60864
ci: add typo detection (#3327)
And fix them.
2022-08-01 09:29:52 -04:00
Kyle Carberry c801da45f3
fix: Add https: to image CSP to allow external images (#2870)
This broke external application icons.
2022-07-08 21:35:59 -05:00
Steven Masley 889e2e68ea
security: Tighten csp connect-src to prevent external websockets (#2705) 2022-06-29 16:42:17 +00:00
Mathias Fredriksson 69b7eed7ed
feat: Check decompressed coder-slim binaries via SHA1 (#2556) 2022-06-22 21:33:23 +03:00
Mathias Fredriksson e2785ada5e
feat: Compress and extract slim binaries with zstd (#2533)
Fixes #2202

Co-authored-by: Dean Sheather <dean@deansheather.com>
2022-06-21 19:53:36 +03:00
Kyle Carberry 013f028e55
feat: Add workspace application support (#1773)
* feat: Add app support

This adds apps as a property to a workspace agent.

The resource is added to the Terraform provider here:
https://github.com/coder/terraform-provider-coder/pull/17

Apps will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.

* Compare fields in apps test

* Update Terraform provider to use relative path

* Add some basic structure for routing

* chore: Remove interface from coderd and lift API surface

Abstracting coderd into an interface added misdirection because
the interface was never intended to be fulfilled outside of a single
implementation.

This lifts the abstraction, and attaches all handlers to a root struct
named `*coderd.API`.

* Add basic proxy logic

* Add proxying based on path

* Add app proxying for wildcards

* Add wsconncache

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* Add workspace route proxying endpoint

- Makes the workspace conn cache concurrency-safe
- Reduces unnecessary open checks in `peer.Channel`
- Fixes the use of a temporary context when dialing a workspace agent

* Add embed errors

* chore: Refactor site to improve testing

It was difficult to develop this package due to the
embed build tag being mandatory on the tests. The logic
to test doesn't require any embedded files.

* Add test for error handler

* Remove unused access url

* Add RBAC tests

* Fix dial agent syntax

* Fix linting errors

* Fix gen

* Fix icon required

* Adjust migration number

* Fix proxy error status code

* Fix empty db lookup
2022-06-04 15:13:37 -05:00
Kyle Carberry 61aacff444
chore: Refactor site to improve testing (#2014)
It was difficult to develop this package due to the
embed build tag being mandatory on the tests. The logic
to test doesn't require any embedded files.
2022-06-03 04:27:21 +00:00
Renamed from site/embed.go (Browse further)