Commit Graph

335 Commits

Author SHA1 Message Date
Mathias Fredriksson e821b98918
ci: Revert to local tag creation and push for releases (#5714) 2023-01-13 20:45:31 +02:00
Steven Masley f76ef98a32
chore!: Standardize prometheus time metrics to seconds (#5709)
* chore!: Standardize prometheus time metrics to seconds
* Update prometheus docs
2023-01-13 11:15:25 -06:00
Mathias Fredriksson a5073a8770
ci: Fix release workflow input booleans, remove snapshot (#5688)
* s/github.event.inputs/inputs/g

* Add run name and prevent non-dry-run releases on non-main branches

* Add logrun to lib.sh
2023-01-12 15:50:58 +00:00
Mathias Fredriksson c7e1ecfe36
ci: Fix release workflow inputs (#5681) 2023-01-11 23:32:25 +00:00
Mathias Fredriksson c0d9e32300
ci: Allow missing commit metadata to be ignored in releases (#5678) 2023-01-11 20:14:04 +00:00
Mathias Fredriksson 8e4af79cb2
ci: Do release tagging in CI and add --draft support (#5652)
* ci: Do release tagging in CI and add --draft support

* Add -h, --help to release.sh

* Add -h, --help to increment_version_tag.sh

* Limit release concurrency

* Add automatic release watching

* ci: Add git config, tag as "GitHub Actions Bot"

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-01-11 18:38:01 +02:00
Marcin Tojek d9436fab69
docs: API enterprise (#5625)
* docs: audit, deploymentconfig, files, parameters

* Swagger comments in workspacebuilds.go

* structs in workspacebuilds.go

* workspaceagents: instance identity

* workspaceagents.go in progress

* workspaceagents.go in progress

* Agents

* workspacebuilds.go

* /workspaces

* templates.go, templateversions.go

* templateversion.go in progress

* cancel

* templateversions

* wip

* Merge

* x-apidocgen

* NullTime hack not needed anymore

* Fix: x-apidocgen

* Members

* Fixes

* Fix

* WIP

* WIP

* Users

* Logout

* User profile

* Status suspend activate

* User roles

* User tokens

* Keys

* SSH key

* All

* Typo

* Fix

* Entitlements

* Groups

* SCIM

* Fix

* Fix

* Clean templates

* Sort API pages

* Fix: HashedSecret

* General is first
2023-01-11 16:05:42 +01:00
Marcin Tojek a23a471034
docs: update swaggo/swag v1.8.9 (#5590)
* docs: update swaggo/swag v1.8.9

* Fix: format

* swaggo: time.Duration

* swaggo: provisionertype

* Fix: AuthorizationObject

* Fix: enums

* Fix: netip.Addr

* Fix: clickable response properties
2023-01-10 15:47:08 +01:00
Mathias Fredriksson bbe33fef41
chore: Revert title case in release notes (#5653) 2023-01-10 16:04:33 +02:00
Mathias Fredriksson 68324c7263
chore: Add security section to release notes (#5636) 2023-01-09 19:57:42 +00:00
Mathias Fredriksson aec15905b5
chore: Add more categories and titles for release notes (#5632)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-01-09 21:19:07 +02:00
Dean Sheather f1fe2b5c06
feat: add GPG forwarding to coder ssh (#5482) 2023-01-06 07:52:19 +00:00
Dean Sheather 5a968e2f93
feat: add flag to disaable all rate limits (#5570) 2023-01-05 18:05:20 +00:00
Marcin Tojek 66fa2a1a8c
docs: API workspace agents and builds (#5538) 2023-01-05 15:27:10 +01:00
Mathias Fredriksson ebe1b56c08
chore: Switch from npm to yarn in `scripts/apidocgen` (#5575) 2023-01-04 19:38:48 +01:00
Marcin Tojek 925b29836c
docs: improve authentication page (#5567)
* docs: improve authentication page

* Update docs/admin/automation.md

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Update docs/admin/automation.md

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Fix

* Fix

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2023-01-04 10:14:47 -08:00
Marcin Tojek e67d131514
docs: audit, deploymentconfig, files, parameters (#5506)
* docs: audit, deploymentconfig, files, parameters

* Fix: mark as binary

* Fix: show format in docs

* Fix: use .swaggo

* Fix: swagger notice

* Swagger notice
2023-01-03 19:21:10 +01:00
Mathias Fredriksson 856f0ab6f5
chore: Improve project-wide prettier formatting and ignored files (#5505)
* chore: Improve project-wide prettier formatting and ignored files

* chore: `Run make fmt/prettier`

* Fix gitignore for `.vscode` folder so that ! works

* Add comment in `.prettierrc.yaml` to explain `.editorconfig`

* Remove scripts/apidocgen/markdown-template/README.md

* Use `yq` for processing prettierrc, update lib.sh dependency check

* Add `yq` to Dockerfile and Nix
2023-01-03 15:11:13 +02:00
Marcin Tojek cfd02d959c
docs: api root, buildinfo, csp (#5493)
* docs: Applications

* WIP

* WIP

* WIP

* Fix: consume

* Fix: @Description

* Fix

* docs: apiroot, buildinfo, csp

* Fix: buildinfo

* docs: updatecheck

* docs: apiroot

* Fix: s/none//g

* Fix: godoc nice

* Fix: description

* Fix: It

* Fix: code sample trim empty line

* More fixes

* Fix: br

* Merge

* Fix: no-security on updatecheck

* Fix: code tags

* Fix: enumerated values in code tags

* Rephrased

* Address PR comments

* Fix: URL, id

* Fix: array items

* Fix: any property

* Fix: array item singular
2022-12-22 15:53:14 +01:00
Marcin Tojek 2bbeff53f9
docs: applications and authorization (#5477)
* docs: Applications

* WIP

* WIP

* WIP

* Fix: consume

* Fix: @Description

* Fix

* Fix: s/none//g

* Fix: godoc nice

* Fix: description

* Fix: It

* Fix: code sample trim empty line

* More fixes

* Fix: br
2022-12-21 15:37:30 +01:00
Marcin Tojek dc6d271293
feat: Build framework for generating API docs (#5383)
* WIP

* Gen

* WIP

* chi swagger

* WIP

* WIP

* WIP

* GetWorkspaces

* GetWorkspaces

* Markdown

* Use widdershins

* WIP

* WIP

* WIP

* Markdown template

* Fix: makefile

* fmt

* Fix: comment

* Enable swagger conditionally

* fix: site

* Default false

* Flag tests

* fix

* fix

* template fixes

* Fix

* Fix

* Fix

* WIP

* Formatted

* Cleanup

* Templates

* BEGIN END SECTION

* subshell exit code

* Fix

* Fix merge

* WIP

* Fix

* Fix fmt

* Fix

* Generic api.md page

* Fix merge

* Link pages

* Fix

* Fix

* Fix: links

* Add icon

* Write manifest file

* Fix fmt

* Fix: enterprise

* Fix: Swagger.Enable

* Fix: rename apidocs to apidoc

* Fix: find -not -prune

* Fix: json not available

* Fix: rename Coderd API to Coder API

* Fix: npm exec

* Fix: api dir

* Fix: by ID

* Fix: string uuid

* Fix: include deleted

* Fix: indirect go.mod

* Fix: source lib.sh

* Fix: shellcheck

* Fix: pushd popd

* Fix: fmt

* Fix: improve workspaces

* Fix: swagger-enable

* Fix

* Fix: mention only HTTP 200

* Fix: IDs

* Fix: https

* Fix: icon

* More APis

* Fix: format swagger.json

* Fix: SwaggerEndpoint

* Fix: SCRIPT_DIR

* Fix: PROJECT_ROOT

* Fix: use code tags in schemas.md

* Fix: examples

* Fix: examples

* Fix: improve format

* Fix: date-time,enums

* Fix: include_deleted

* Fix: array of

* Fix: parameter, response

* Fix: string time or null

* Workspaces: more docs

* Workspaces: more docs

* Fix: renderDisplayName

* Fix: ActiveUserCount

* Fix

* Fix: typo

* Templates: docs

* Notice: incomplete
2022-12-19 18:43:46 +01:00
Dean Sheather 31d38d4246
feat: allow http and https listening simultaneously (#5365) 2022-12-15 20:09:19 +00:00
Mathias Fredriksson 306fe4a91b
ci: Fix release publish script (#5436) 2022-12-15 14:31:57 +00:00
Mathias Fredriksson e96fdbed26
feat: Add `release.sh` script and detect breaking changes (#5366)
This commit introduces three new scripts:

- `release.sh` To be run by a user on their local machine to preview and
  create a new release (tag + push)
- `check_commit_metadata.sh` For e.g. detecting breaking changes
- `genereate_release_notes.sh` To display the generated release notes,
  used for previews and in `publish_release.sh`

The `release.sh` script can be run without arguments, and it will
automatically determine if we're to do a patch or minor release. A minor
release can be forced via `--minor` flag.

Breaking changes can be annotated either via commit/merge title prefix
(`feat!:`, `feat(api)!:`), or by adding the `release/breaking` label to
the PR that was merged (on GitHub).

Related #5233
2022-12-15 15:41:30 +02:00
Dean Sheather 9e80322fe5
fix: do not truncate system PATH in win installer (#5243)
The path.nsh script in the NSIS installer provided methods for adding
paths to the PATH and removing them. It would do this by reading the
current PATH value from the registry, adding the new value (if it
doesn't exist) and then writing it to the registry.

Unfortunately, it would read from the user's PATH and write the updated
result to the system PATH, which would remove important PATH entries
like the following in the process:

- C:\Windows\System32
- C:\Windows
- C:\Windows\System32\wbem
- C:\Windows\System32\WindowsPowerShell\v1.0
- C:\Windows\System32\OpenSSH
- C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

and would copy all user environment variables in their place. The
variables listed above were the ones missing from my machine when I
compared with a friend's machine.

Recommended course of action for affected users:
1. Add the paths listed above to your system PATH if they aren't there
   already and exist on your system.
2. Remove any paths that are in your user's PATH from your system PATH.

The existing installers for the last couple of versions of Coder have
been yanked from GitHub releases and this message will be included in
the release notes for the next patch.

Thanks to @cmor for finding and reporting this bug in #5240.
2022-12-02 09:56:49 +10:00
Mathias Fredriksson 9557d456e8
fix: Generate trial in `scripts/develop.sh` (#5231) 2022-12-01 17:12:16 +02:00
Marcin Tojek 883cf8afa9
chore: Add missing metrics description (#5212)
* chore: Add missing metrics description

* Update provisionerd/provisionerd.go

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Fix

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-12-01 12:50:57 +01:00
Marcin Tojek 38bdae7016
docs: Prometheus metrics + generator (#5179)
* docs: Prometheus metrics

* Fix

* Typo

* Typo

* Typo

* Fix: link

* Update docs/admin/prometheus.md

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update docs/admin/prometheus.md

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update docs/admin/prometheus.md

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update docs/admin/prometheus.md

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update docs/admin/prometheus.md

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Rephrase

* notice

* use ```shell

* Generator

* gosec

* fix: lint

* PR comments

* not needed anymore

Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Geoffrey Huntley <ghuntley@ghuntley.com>
2022-11-30 17:39:51 +01:00
Mathias Fredriksson 085f1917db
fix: Fix develop script pid tracking, improve logging and interrupt (#5186) 2022-11-29 15:45:14 +02:00
Muhammad Atif Ali 990be63c60
feat: create winget package workflow (#4761)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2022-11-14 12:59:08 +00:00
Arthur Normand 9578ce9f77
OAuth now uses client TLS certs (if configured) (#5042)
* OAuth now uses client TLS certs (if configured)

* Update docs

* Cleaning

* Fix lint errors and generate static files

* Fix lint error and regenerate more static files

* Suppress lint error
2022-11-13 14:15:06 -06:00
Mathias Fredriksson 71601f4971
fix: Fix log wrapper for vite in `scripts/develop.sh` (#5030)
The pid tracking refactor resulted in the pipe while echo to block the
script from continuing and showing the banner at the end. This change
redirects the stdout for the `start_cmd` to a new fd which `while` is
reading from.
2022-11-11 12:39:33 +00:00
Mathias Fredriksson 5e2253030f
fix: Revert develop.sh timeout -> curl change (#5008)
It seems `--retry-all-errors` is not available on e.g. curl 7.68.0.
2022-11-10 19:49:11 +00:00
Mathias Fredriksson a25deb939b
fix: Misc improvements to `scripts/develop.sh` (#4995)
* Use new `/healthz` endpoint for checking API liveness
* Improved credential handling/retrying in failure scenarios
* Separate site (`vite`) logs with prefix and date, additionally this
  method also disables the `vite` clearing of the screen
* Show all interfaces coder API is listening on (due to `0.0.0.0`)
* Improved shutdown procedure / interrupt handling
2022-11-10 20:47:42 +02:00
Joe Previte ffe461ae58
chore(site): enable eslint-plugin-eslint-comments (#4799)
* chore(site): enable eslint-plugin-eslint-comments

* chore: add descriptions to eslint-disable comments

* chore: update eslint-disable comments in main.go
2022-10-28 17:46:51 -03:00
Kira Pilot 8282e46813
chore: add audit log tests (#4764)
* added test for stopping a workspace build

* formatted sfriendly string; added tests

* logging unmarshal error in auditLogDescription

* prettier

* got rid of extra workspace word

* PR feedback

* fixed mistake; wrote tests in penance

* fix be
2022-10-27 15:57:41 -04:00
Dean Sheather 067362cf31
feat: add windows amd64 installer (#4719) 2022-10-26 00:19:54 +10:00
Kyle Carberry 7bc5b89f7a
feat: Support config files with viper (#4696) 2022-10-21 17:08:23 -05:00
Garrett Delfosse e8537067ef
Revert "Revert "Revert "feat: Support config files with viper"" (#4693)" (#4695)
This reverts commit 372fb1f345.
2022-10-21 16:07:38 -05:00
Garrett Delfosse 372fb1f345
Revert "Revert "feat: Support config files with viper"" (#4693) 2022-10-21 20:55:20 +00:00
Garrett Delfosse a2fb444911
Revert "feat: Support config files with viper (#4558)" (#4692)
This reverts commit c8e299c8f1.
2022-10-21 20:04:27 +00:00
Garrett Delfosse c8e299c8f1
feat: Support config files with viper (#4558) 2022-10-21 19:26:39 +00:00
Steven Masley 369b5d1c2d
chore: Add generics to typescript generator (#4664)
* feat: Support generating generics in interfaces
* Switch struct to a template
* Support generics in apitypings
2022-10-20 08:15:24 -05:00
Garrett Delfosse 0f3221f9d0
fix: use more descriptive login flags (#4493) 2022-10-11 18:45:30 +00:00
Garrett Delfosse a70278e0e1
feat: make flags in one place (#4452) 2022-10-11 15:16:19 +00:00
Kyle Carberry 3cc77d96eb
feat: Add tunnel by default (#4399)
* feat: Add tunnel by default

If an access URL is not specified, we will always tunnel.

This is from community-member feedback who exclaimed that
it's confusing having the default for `coder server` display
a warning message, and I agree.

There is very little (maybe none) in running `coder server`
without tunnel and without an access URL, so this seems like
overall a much better UX.

* Update install.sh

Co-authored-by: Ben Potter <ben@coder.com>

* Update docs/install/packages.md

Co-authored-by: Ben Potter <ben@coder.com>

* Fix reset pass test

* Fix e2e test

Co-authored-by: Ben Potter <ben@coder.com>
2022-10-07 08:05:56 -05:00
Bruno Quaresma 59cc4a2586
chore: Use Vite as main dev runner for FE (#4230) 2022-09-27 21:09:16 -03:00
Steven Masley 27c8345ef2
chore: Add linter rule to prevent breaking of sse (#4144)
* chore: Add linter rule to prevent breaking of sse
2022-09-27 11:14:58 -04:00
Bruno Quaresma 189c562826
chore: Use Vite instead of Webpack for development (#4156) 2022-09-23 15:22:48 -03:00
Colin Adler 5de6f86959
feat: trace httpapi.{Read,Write} (#4134) 2022-09-21 17:07:00 -05:00
Joe Previte 3db9ea9dd2
fix: disable inspect xstate in develop (#4145) 2022-09-21 11:08:54 -07:00
Dean Sheather 29d804e692
feat: add API key scopes and application_connect scope (#4067) 2022-09-19 17:39:02 +00:00
Steven Masley 9ab437d6e2
feat: Add serving applications on subdomains and port-based proxying (#3753)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2022-09-14 03:31:33 +10:00
Steven Masley 21e8fb243b
fix: Allow develop.sh to host docker workspaces (#3802) 2022-09-13 09:21:05 -04:00
Kyle Carberry 5e04a2f800
chore: Remove DataDog test reporting (#3958)
It was costing a lot of money, and it wasn't being used very much.
2022-09-08 14:29:30 +00:00
Dean Sheather 6a3876d6df
chore: hide template check 404 error from develop.sh (#3942) 2022-09-08 15:22:08 +10:00
Dean Sheather a79e34c0c7
chore: build releases on a single Linux runner (switch to rcodesign) (#3890)
* chore: build, sign and notarize darwin binaries on linux

* chore: download rcodesign during release

* chore: change nfpm install to be a download instead of compile

* chore: delete apple cert secrets after build

* fix: fix dependencies in archive.sh and build_go.sh

* chore: reduce output from rcodesign
2022-09-07 18:56:46 +00:00
Dean Sheather 819622182b
chore: parallel makefile attempt 3 (#3926)
* Revert "chore: Revert parallel Makefile builds (#3918)"

This reverts commit b077f71015.

* fix: fix release workflow with parallel makefile

* fix: mark generated files as fresh during releases
2022-09-08 02:40:17 +10:00
Kyle Carberry b077f71015
chore: Revert parallel Makefile builds (#3918)
This was breaking the release process. Namely it was running
the `gen` targets due to the dependency tree, which was failing
on macOS and Linux runners. This revert can be reverted once
we fix that up.
2022-09-07 01:56:51 +00:00
Dean Sheather 1b6f9e54a3
fix: fix ERRPIPE in scripts/lib.sh (#3908) 2022-09-07 04:42:45 +10:00
Dean Sheather 419d701927
chore: parallel builds with Makefile (#3854)
* Revert "revert: Makefile buff-ification (#3700) (#3848)"

This reverts commit e490bdd531.

* fix: fix slim targets in makefile

* fix: don't clobber slim binaries, make sure they're in the correct location
2022-09-06 17:27:06 +00:00
Kyle Carberry e490bdd531
revert: Makefile buff-ification (#3700) (#3848)
This caused the following issues:
- Slim binaries weren't being updated.
- The coder.tar.ztd was misplaced.
- There is no coder.sha1 file with proper filenames.

This should be reintroduced in a future change with those fixes.
2022-09-02 14:46:58 -05:00
Dean Sheather e1a4f3a16b
Makefile buff-ification (#3700)
Remove old go_build_matrix and go_build_slim scripts in favor of full makefile-ification.
2022-09-02 12:58:23 +00:00
Joe Previte 05f932b37e
refactor(scripts): remove -P from ln calls (#3740) 2022-08-29 15:05:08 -07:00
Mathias Fredriksson 78a24941fe
feat: Add `codersdk.NullTime`, change workspace build deadline (#3552)
Fixes #2015

Co-authored-by: Joe Previte <jjprevite@gmail.com>
2022-08-25 19:10:42 +03:00
Spike Curtis b101a6f3f4
POST license API endpoint (#3570)
* POST license API

Signed-off-by: Spike Curtis <spike@coder.com>

* Support interface{} types in generated Typescript

Signed-off-by: Spike Curtis <spike@coder.com>

* Disable linting on empty interface any

Signed-off-by: Spike Curtis <spike@coder.com>

* Code review updates

Signed-off-by: Spike Curtis <spike@coder.com>

* Enforce unique licenses

Signed-off-by: Spike Curtis <spike@coder.com>

* Renames from code review

Signed-off-by: Spike Curtis <spike@coder.com>

* Code review renames and comments

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-22 15:02:50 -07:00
Dean Sheather 369a9fb535
fix: add writeable home dir to docker image (#3603) 2022-08-22 19:43:13 +10:00
Kyle Carberry b0fe9bcdd1
chore: Upgrade to Go 1.19 (#3617)
This is required as part of #3505.
2022-08-21 22:32:53 +00:00
Spike Curtis 690e6c6585
Check AGPL code doesn't import enterprise (#3602)
* Check AGPL code doesn't import enterprise

Signed-off-by: Spike Curtis <spike@coder.com>

* use error/log instead of echo/exit

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-19 17:49:08 +00:00
Spike Curtis 5c898d0c83
Fix archive.sh for LICENSE files (#3535)
Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-17 10:27:52 -07:00
Spike Curtis 5817c6ac7f
Build enterprise coder binary by default (#3517)
* Build enterprise coder binary by default

Signed-off-by: Spike Curtis <spike@coder.com>

* Add --agpl to develop.sh

Signed-off-by: Spike Curtis <spike@coder.com>

* Add --agpl flag to archive.sh

Signed-off-by: Spike Curtis <spike@coder.com>

* shell format

Signed-off-by: Spike Curtis <spike@coder.com>

* Move AGPL back to LICENSE, explain enterprise license is forthcoming

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-17 09:02:25 -07:00
Kyle Carberry 9c12b4ed8e
chore: Add nix shell for simple development setup (#3399)
* chore: Add nix shell for simple development setup

This enables contributors using Nix to set up their environment with ease.

* improve nix style, flake output schema

* fix error message

* Update scripts/build_go_slim.sh

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Update scripts/build_go_slim.sh

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Add UTC default for timezone and remove unnecessary goreleaser dependency

* Skip TZ test if localtime does not exist

Co-authored-by: Charlie Moog <moogcharlie@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-08-08 15:49:12 +00:00
Cian Johnston 01fe5e668e
chore: add testutil.Eventually and friends (#3389)
This PR adds a `testutil` function aimed to replace `require.Eventually`.

Before:
```go
require.Eventually(t, func() bool { ... }, testutil.WaitShort, testutil.IntervalFast)
```

After:
```go
require.True(t, testutil.EventuallyShort(t, func(ctx context.Context) bool { ... }))

// or the full incantation if you need more control
ctx, cancel := context.WithTimeout(ctx.Background(), testutil.WaitLong)
require.True(t, testutil.Eventually(t, ctx, func(ctx context.Context) bool { ... }, testutil.IntervalSlow))
```

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-08-05 16:34:44 +01:00
Dean Sheather 66a5b0f7bc
fix: don't use adduser and addgroup for docker images (#3344)
* fix: don't use adduser and addgroup for docker images

* Revert "fix: Remove alternative image architectures until we virtualize (#3336)"

This reverts commit 00c5116a2e.
2022-08-01 19:28:38 +00:00
Mathias Fredriksson 4730c589fe
chore: Use standardized test timeouts and delays (#3291) 2022-08-01 15:45:05 +03:00
Steven Masley 6230d5512e
chore: Remove line numbers from auto-gen typescript (#3258)
* chore: Remove line numbers from auto-gen typescript

The line numbers are just extra noise that change when things shift
around. They are not required and usually make CI fail when you
forget to run 'make gen'.
2022-07-27 21:36:15 +00:00
Dean Sheather b19cf701c5
feat: change docker to use "coder" user and add basic Helm chart (#2746) 2022-07-26 13:19:29 -05:00
Cian Johnston 2c0d57e8c0
fix: update reference to agent.dev in examples and docs (#3198)
* fix: update agent ID in example templates
* fix: update agent ID in dogfood template
* chore: update default agent ID in documentation
* fix: develop.sh: start FE after template is created; leave template dir around if template creation fails
2022-07-26 14:09:09 +01:00
Mathias Fredriksson 51dd1fde3b
fix: Remove use of `require` in `require.Eventually` in tests (#3110)
* fix: Remove use of `require` in `require.Eventually` in tests

Because require uses `t.FailNow()` and `require.Eventually` runs the
function in a goroutine, which is not allowed.

* feat: Add ruleguard for require.Eventually

Co-authored-by: Cian Johnston <cian@coder.com>
2022-07-22 20:02:49 +03:00
Cian Johnston 0f5f30b6f6
fix: make agent scripts easier to troubleshoot (#2922)
- Adds distinct exit statuses to the bootstrap scripts
- Makes the bootstrap scripts loop forever trying to download the coder agent
- Surfaces and logs the status codes returned by the download tool
2022-07-13 10:17:40 +01:00
Cian Johnston 8d8c1a1927
develop.sh: add missing embed tag (#2885) 2022-07-11 12:20:54 +01:00
David Wahler 0dbfd265fb
chore: clean up scripts for internal godoc site that's no longer used (#2770) 2022-07-01 10:55:05 -05:00
Cian Johnston e14953461c
fix: develop.sh: do not clobber existing login, pre-build coder binary for speed (#2750) 2022-07-01 11:09:19 +01:00
Spike Curtis cb2d1f488a
fix: ci uses a migrated DB template (#2696)
Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-28 14:42:19 -07:00
Steven Masley 576aef40f2
chore: Add linter rule to catch missing return after http writes (#2702) 2022-06-28 14:13:37 -05:00
Kyle Carberry 6429dfee1f
test: Use a template to prevent migrations from running for every test (#2462)
* test: Use a template to prevent migrations from running for every test

* Create a single makefile target

* Fix built-in race

* Extend timeout of built-in PostgreSQL fetch
2022-06-27 17:07:39 +00:00
Cian Johnston bbbd5241c3
develop.sh: attempt to create a Docker template automatically (#2627)
This commit makes the following changes:

- Adds two variables docker_host and docker_arch to the example docker-code-server template
- Adds an example params.yaml to docker-code-server and updates the README.md to reference these parameters
- scripts/develop.sh will now attempt to create a template using docker-code-server with the appropriate parameters for the environment
- Updated Lima example to make use of the template parameters for docker-code-server


Additional drive-bys:

- webpack.dev.ts references CODER_HOST and not CODERV2_HOST; updated develop.sh accordingly
- develop.sh should now terminate child processes upon error.
2022-06-27 09:59:08 +01:00
Cian Johnston ac557e02b8
clean site/out and enforce make bin (#2604) 2022-06-23 15:16:27 +01:00
Mathias Fredriksson 69b7eed7ed
feat: Check decompressed coder-slim binaries via SHA1 (#2556) 2022-06-22 21:33:23 +03:00
Cian Johnston a0c8e70d1b
scripts/develop.sh: remove nc dependency (#2590) 2022-06-22 18:04:12 +00:00
David Wahler c366725472
Revert changes to scripts/build_go_matrix.sh from 1778db2 (#2581) 2022-06-22 15:59:20 +00:00
Kyle Carberry 1778db23cb
fix: Use WebSockets to stream workspace build logs (#2569)
* fix: Use WebSockets to stream workspace build logs

This was using a streaming HTTP request before, which didn't work
on my version of Chrome. This method seemed less reliable and standard
than a WebSocket, so figured switching would be best.

* Update site/src/xServices/workspaceBuild/workspaceBuildXService.ts

Co-authored-by: Abhineet Jain <AbhineetJain@users.noreply.github.com>

* Update site/src/pages/WorkspaceBuildPage/WorkspaceBuildPage.test.tsx

Co-authored-by: Abhineet Jain <AbhineetJain@users.noreply.github.com>

* Update site/src/api/api.ts

Co-authored-by: Abhineet Jain <AbhineetJain@users.noreply.github.com>

* Remove unused prop

Co-authored-by: Abhineet Jain <AbhineetJain@users.noreply.github.com>
2022-06-22 13:23:14 +00:00
Cian Johnston dc7d6def8e
improve develop.sh (#2572)
- Running make dev now prompts you to run ./scripts/develop.sh manually, as GNU make does not appear to pass SIGINT to subprocesses.
- Added checks to develop.sh to ensure that coderd is listening before running our initial setup steps
- Add some more troubleshooting/debugging output to develop.sh
2022-06-22 14:02:31 +01: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
Mathias Fredriksson 64f0473499
chore: Prefer `[[` over `[` in bash build scripts (#2543) 2022-06-21 19:51:32 +03:00
Dean Sheather 9bdaec6a21
fix: use armhf architecture in linux packages (#2514) 2022-06-20 06:12:38 +10:00
Dean Sheather 153ffc0ee9
fix: include architecture and version information in linux packages (#2511) 2022-06-19 18:56:07 +00:00
Dean Sheather 97348b1c9d
fix: replace underscores with hyphens in slim binary name (#2509) 2022-06-19 18:15:20 +00:00
Dean Sheather 8d6faa3c1a
fix: login before pushing docker images in release pipeline (#2496) 2022-06-19 13:12:09 +10:00
Dean Sheather 4b3608b628
fix: run git fetch --tags --force during release (#2495) 2022-06-19 10:39:01 +10:00
Dean Sheather 167ab281e4
fix: fix ERRPIPE in build scripts, fix deploy (#2492) 2022-06-18 21:47:37 +00:00
Dean Sheather 075e891f28
Remove goreleaser in favor of build scripts (#2143) 2022-06-19 05:47:10 +10:00
Kyle Carberry ccd061652b
feat: Add built-in PostgreSQL for simple production setup (#2345)
* feat: Add built-in PostgreSQL for simple production setup

Fixes #2321.

* Use fork of embedded-postgres for cache path
2022-06-15 16:02:18 -05:00
Steven Masley 251316751e
feat: Return more 404s vs 403s (#2194)
* feat: Return more 404s vs 403s
* Return vague 404 in all cases
2022-06-14 10:14:05 -05:00
Dean Sheather 7b76afb069
Revert split release (#2139)
* Revert "chore: ignore artifacts dir (#2132)"

This reverts commit 27acb98571.

* Revert "chore: split release workflow so the majority happens on Linux (#2092)"

This reverts commit b87096b500.
2022-06-07 20:57:32 +00:00
Dean Sheather b87096b500
chore: split release workflow so the majority happens on Linux (#2092) 2022-06-07 15:24:46 +00:00
Steven Masley af401e3fe1
chore: Linter rule for properly formatted api errors (#2123)
* chore: Linter rule for properly formatted api errors
* Add omitempty to 'Detail' field
2022-06-07 14:33:06 +00:00
Steven Masley e6ee7dd652
chore: Add linting rule to help catch InTx misuse (#1980)
* chore: Add linting rule to help catch InTx misuse

This isn't perfect, as if you nest your misuse in another code block
like an if statement, it won't catch it :/. It is better
than nothing
2022-06-02 14:50:15 +00:00
Spike Curtis 4b0ed06a26
Remove set -u on yarn_install.sh to allow it to run on zsh (#1930)
Signed-off-by: Spike Curtis <spike@coder.com>
2022-05-31 13:50:18 -07:00
Bruno Quaresma 83edbee2e1
fix: Replace yes by true and add set -x (#1914) 2022-05-31 14:14:14 +00:00
Steven Masley 26a2a169df
fix: Suspended users cannot authenticate (#1849)
* fix: Suspended users cannot authenticate

- Merge roles and apikey extract httpmw
- Add member account to make dev
- feat: UI Shows suspended error logging into suspended account
- change 'active' route to 'activate'
2022-05-31 08:06:42 -05:00
Mathias Fredriksson 608eb322a8
chore: Add .editorconfig, shfmt, shellcheck and subshell dir changes (#1649) 2022-05-27 20:15:19 +03:00
Cian Johnston c2f74f3cc2
chore: avoid concurrent usage of t.FailNow (#1683)
* chore: golangci: add linter rule to report usage of t.FailNow inside goroutines
* chore: avoid t.FailNow in goroutines to appease the race detector
2022-05-24 08:58:39 +01:00
Steven Masley 6c1117094d
chore: Force codersdk to not import anything from database (#1576)
* chore: Force codersdk to not import anything from database (linter rule)
* chore: Move all database types in codersdk out
2022-05-19 13:04:44 -05:00
Garrett Delfosse 495c87b6c3
chore: add make dev (#1527) 2022-05-17 13:12:14 -05:00
David Wahler 86cba4d3f8
chore: Deploy internally accessible godoc container (#1415) 2022-05-12 19:39:18 -05:00
Steven Masley 64e408c954
feat: Check permissions endpoint (#1389)
* feat: Check permissions endpoint

Allows FE to query backend for permission capabilities.
Batch requests supported
2022-05-12 20:56:23 +00:00
Asher 26b04cc96f
chore: switch to generated types (#1394)
* Make column renderer use the same type as its key

That way the renderer only takes `string` for example when rendering the
name field instead of `string | number` when the interface has some
fields that are strings and some fields are numbers.

This will be necessary when switching to generated types since some of
the fields are numbers (like the owner count on a template).

* Switch fully to generated types

In some places the organization ID is part of the URL but not part of
the request so I separated out the ID into a separate argument in the
relevant API functions.

Otherwise this was a straightforward replacement where I mostly only
needed to change some of the interface names (User instead of
UserResponse for example) and add a few missing but required properties.

I kind of winged the template form; I am not sure what the difference
between a template and template version is or why the latter comes
before the former so the form just returns all the data required to
create both.

* Delete handwritten types

Except for UserAgent which seems to be purely frontend and
ReconnectingPTYRequest which is not in codersdk so I am just leaving it
for now.

* Remove implemented omitempty as a future idea

This was implemented in 2d3dc436a8.

* Add missing optionalities to generated request interfaces
2022-05-12 10:01:28 -05:00
Colin Adler f816bbe801
feat: add codegen for audit.AuditableResources entries (#1370) 2022-05-10 21:27:45 +00:00
Colin Adler 97a95f1377
chore: upgrade golangci-lint to v1.46.0 (#1373) 2022-05-10 16:04:23 -05:00
Mathias Fredriksson 2d3dc436a8
feat: Implement unified pagination and add template versions support (#1308)
* feat: Implement pagination for template versions

* feat: Use unified pagination between users and template versions

* Sync codepaths between users and template versions

* Create requestOption type in codersdk and add test

* Fix created_at edge case for pagination cursor in queries

* feat: Add support for json omitempty and embedded structs in apitypings (#1318)

* Add scripts/apitypings/main.go to Makefile
2022-05-10 07:44:09 +00:00
Steven Masley e330dc1321
feat: Switch packages for typescript generation code (#1196)
* feat: Switch packages for typescript generation code

Supports a larger set of types
  - [x] Basics (string/int/etc) 
  - [x] Maps
  - [x] Slices
  - [x] Enums
  - [x] Pointers
2022-04-28 16:59:14 +00:00
Garrett Delfosse e181007de1
fix: Add more golang types -> number ts type (#1108) 2022-04-22 21:01:43 +00:00
Garrett Delfosse 89aa39b5c8
fix: sort enum decls (#1075) 2022-04-19 16:02:32 +00:00
Joe Previte 73b8a5a929
chore: use /usr/bin/env bash (#1070) 2022-04-19 08:45:13 -07:00
Garrett Delfosse f46b4cf3da
feat: generate typescript types from codersdk structs (#1047) 2022-04-19 00:45:22 +00:00
Kyle Carberry 866205c145
feat: Sign MacOS binaries (#1060)
This fixes virus warnings when launching Coder on darwin.
2022-04-18 14:57:41 -05:00
Bryan 86994dacb1
feat: Initial E2E test framework for v2 (#288)
This brings an initial E2E test (really, an integration test - it's only running the server locally, as opposed to against a deployment - but it'd be easy to point playwright to a deployment).

Demo gif:
![test2](https://user-images.githubusercontent.com/88213859/156078517-6cb4ef84-337b-4e16-a8bc-aea7d06dcbcb.gif)

This test exercises a minimal flow for login:
- Run the `coderd` binary to start a server on 3000
- Create an initial user as part of setup
- Go through the login flow and verify we land on the projects page

It will be useful to have to ensure that #360 doesn't introduce a regression in the login flow

Future E2E tests that would be useful:
- Create a project & verify it shows in the UI
- Create a workspace and verify it shows in the UI
2022-03-02 09:26:53 -08:00
Kyle Carberry 41c3ee72e5
ci: Update DataDog GitHub branch to fallback to GITHUB_REF (#356)
This was detecting branches, but not our "main" branch before.
Hopefully this fixes it!
2022-02-24 16:47:51 +00:00
Jonathan Yu 3c04c7f3e6
chore: install optional dependencies (required for swc) (#335)
* chore: install optional dependencies (required for swc)

* Use install script in Makefile

* add trailing newline
2022-02-20 13:52:14 -06:00
Jonathan Yu 8f843d2364 chore: add script to install yarn dependencies
* Use frozen lockfile in build for reproducible builds
* Do not install optional dependencies
* Suppress interactive prompts in build
2022-02-20 17:43:51 +00:00
Kyle Carberry 5bfdb0cf98
ci: Use GITHUB_BASE_REF as backup if branch isn't set for DataDog (#321)
The change in #313 caused PRs to report "<id>/merge" as the name.
2022-02-18 11:19:06 -06:00
Kyle Carberry dd36317bbd
ci: Use GITHUB_REF_NAME to identify branch with DataDog (#313)
The "main" branch wasn't uploading properly before.
2022-02-17 17:30:44 +00:00
Kyle Carberry 3002a27dd1
ci: Replace DataDog CI with custom upload script (#169)
* ci: Replace DataDog CI with custom upload script

This will reduce CI time by ~6 minutes across all of
our runners. It's a bit janky, but I believe worth
the slight maintainance burden.

* Fix test race when job would complete too early

* Fix job cancelation override

* Fix race where provisioner job is inserted before project version
2022-02-07 17:32:32 +00:00
Kyle Carberry 7c260f88d1
feat: Create provisioner abstraction (#12)
* feat: Create provisioner abstraction

Creates a provisioner abstraction that takes prior art from the Terraform plugin system. It's safe to assume this code will change a lot when it becomes integrated with provisionerd.

Closes #10.

* Ignore generated files in diff view

* Check for unstaged file changes

* Install protoc-gen-go

* Use proper drpc plugin version

* Fix serve closed pipe

* Install sqlc with curl for speed

* Fix install command

* Format CI action

* Add linguist-generated and closed pipe test

* Cleanup code from comments

* Add dRPC comment

* Add Terraform installer for cross-platform

* Build provisioner tests on Linux only
2022-01-08 11:24:02 -06:00