Commit Graph

232 Commits

Author SHA1 Message Date
Muhammad Atif Ali 26876dc734
docs: add apache reverse-proxy example (#6213)
* docs: apache reverse proxy

* fixed to correctly pass WebSocket headers

* add a sample configuration file

* updating with suggestions

* Update coder.conf

* fix http to https redirection

* fix: upgrade http to https

* Update examples/web-server/apache/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* add other dns providers documentation link

---------

Co-authored-by: Ben Potter <me@bpmct.net>
Co-authored-by: Ben Potter <ben@coder.com>
2023-02-16 04:50:18 +00:00
Muhammad Atif Ali 99306642bb
docs: update caddy reverse proxy example (#6228)
Update caddy reverse proxy example to use `CODER_HTTP_ADDRESS` instead of deprecated `CODER_ADDRESS`

This resolved #5449
2023-02-16 04:31:43 +00:00
Muhammad Atif Ali 786ad8d8b1
docs: add nginx reverse-proxy example (#6185)
* docs: Add nginx reverse-proxy example

This PR adds nginx reverse-proxy example to provision coder with tls certificate using letsencrypt certbot.

This will partially resolve #6086.

* change nginx example to to absolute path

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* refactor: replaced bullets with numbered lists

* remove the ambiguous ip addr.

* fixed a typo

* correctly handle the wildcard subdomain

* simplified after testing

* fmt: prettier formatting

* Adapt to the coder style guide

* fix: agent disconnection

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update docs/admin/configure.md

Co-authored-by: Ben Potter <me@bpmct.net>

* Update examples/web-server/nginx/README.md

Co-authored-by: Ben Potter <me@bpmct.net>

* updated with suggested changes

* updated with requested changes

* add reference to certbot docs for other dns providers

---------

Co-authored-by: Ben Potter <me@bpmct.net>
2023-02-15 13:18:54 -06:00
Cian Johnston ab9cba9396
chore: update template examples and docs to install code-server under /tmp (#6138)
Updates templates examples and docs to pass the --method standalone argument
to code-server install script, and installs code-server under /tmp/code-server.

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

---------

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2023-02-10 13:36:46 +00:00
Ben Potter 968d7e4dc5
docs: rootless podman support (#6026)
* rootless podman WIP

* docs: rootless podman support
2023-02-06 08:05:38 -06:00
Bruno Quaresma 8ef0306c08
Revert "docs: Change console to shell and remove unused elements (#5960)" (#5964)
This reverts commit 61dcf643e8.
2023-02-01 17:05:45 -03:00
Bruno Quaresma 61dcf643e8
docs: Change console to shell and remove unused elements (#5960) 2023-02-01 18:27:11 +00:00
sharkymark 91ef8d90d5
chore: remove code-server release limitation and add image push policy in kubernetes example template (#5831)
* chore: remove code-server release limitation and add image push policy

* restore code-server changes

* chore: remove spaces in pod space

* Format terraform

---------

Co-authored-by: Eric Paulsen <ericpaulsen@coder.com>
Co-authored-by: Kyle Carberry <kyle@carberry.com>
2023-01-30 06:58:45 -05:00
Mathias Fredriksson a1212014df
chore(examples): Add `login_before_ready` and `startup_script_timeout` (#5880) 2023-01-27 21:01:48 +00:00
Kyle Carberry ba8dd496c3
chore: manually specify templates to embed (#5823)
This is part of a multi-step cleanup for the example templates.
The goal is to have a lot of templates here, and only embed
specific ones we feel are impactful during setup.
2023-01-23 18:12:11 +00:00
Colin Adler 341b7caff6
fix(examples): move k8s email label to an annotation (#5802) 2023-01-19 22:03:53 +00:00
Colin Adler b42e2ae81f
feat(examples): add labels and antiAffinity to k8s example (#5774) 2023-01-18 22:53:54 +00:00
Colin Adler 6ed4e21e8b
feat(examples): add labels and antiAffinity to k8s example (#5763) 2023-01-18 17:01:00 +00:00
Olivier Lance cd7b36d41a
fix(examples): use correct build args for Docker template (#5721) 2023-01-13 17:24:19 -06:00
Cian Johnston 19ae42af53
chore: update lima example to use --with-terraform arg (#5655)
#5586 added the capability for install.sh to download and install Terraform automatically.
Using this now in the example Lima specification.
Also no longer hard-coding the instance name in favour of {{.Instance.Name}} in the output
that gets emitted upon successful instance provisioning.
2023-01-10 17:25:46 +00:00
Cian Johnston e6b17b6ea7
chore: update Lima example (#5588)
* chore: lima: update ubuntu image version

* fix: lima: make docker socket usable by Lima user without sudo

* fix: lima: set access URL to host.lima.internal

* apply suggestion from PR
2023-01-05 11:47:33 +00: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
Geoffrey Huntley 26b54cd144
chore(autofix): upgrade-examples-terraform-provider-coder (#5498)
Automatically generated via https://github.com/coder/autofix
2022-12-23 12:25:56 +10:30
Dean Sheather 0c0e3f0e4d
fix: fix nested dirs in example tars (#5447) 2022-12-17 02:19:19 +10:00
Joe Previte fceac39143
refactor: pin code-server to 4.8.3 (#5440)
* chore(templates): pin code-server to 4.8.3

* docs: use code-server 4.8.3 in install snippets
2022-12-15 13:14:49 -07:00
sharkymark 8df02f42c0
docs: make it clear the CLI must be downloaded to use templates (#5373) 2022-12-13 19:31:09 +00:00
Garrett Delfosse ca0374b94f
feat: add examples to api (#5331)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2022-12-09 14:29:50 -05:00
Bruno Quaresma 6cc864c048
chore: Add icons to templates (#5368) 2022-12-09 18:47:09 +00:00
Muhammad Atif Ali 25c80566e7
docs: Add GitHub action to push template changes automatically (#5166)
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-11-26 13:36:14 +00:00
Mathias Fredriksson 570a1ffc2b
fix: Improve docker example first user experience (#4972)
The base ubuntu image lands the user as root, but the terraform tempalte
expected /home/coder to be used. This change adds a user with the same
name as the Coder users username and allows them to sudo.
2022-11-10 12:55:39 +02:00
Mathias Fredriksson ed7de90a55
fix: Use immutable names for volumes in example templates (#4954)
* fix: Use immutable names for volumes in example templates

This contributes towards #3000, #3386

Related #3409

* Add lifecycle and labels
2022-11-09 16:18:19 +02:00
Mathias Fredriksson b2a16d46c6
chore: Unify Docker terraform templates (#4952)
Changes to terraform templates:

* Remove DNS (this can interfere with users running their own DNS
  servers)
* Remove `lower()` restriction from hostnames so that it will show the
  name set by the user, as-is (there is no restriction on upper case
  letters in hostnames)
* Remove superfluous `trap` in entrypoints, this is already handled by
  the init script
* Switch from `command` to `entrypoint` as the latter can support more
  Docker images out-of-the-box
2022-11-08 18:52:19 +02:00
sharkymark 531f7cd489
docs: adding sharkymark example templates to community page (#4911) 2022-11-06 17:03:37 -06:00
Alexander Hansen ec4b397aa4
Add `8Bitz0/coder-rust-template` (#4804)
Put `8Bitz0/coder-rust-template` in `community-templates.md`
2022-10-31 09:25:41 -05:00
Dean Sheather 10df2fd4fb
feat: add new required slug property to coder_app, use in URLs (#4573) 2022-10-28 17:41:31 +00:00
Ammar Bandukwala c9bf2a9099
ci: verify that all docs links work (#4710) 2022-10-23 17:09:58 -05:00
Ben Potter df39920fcd
fix: remove default namespace in k8s example (#4645) 2022-10-19 16:34:03 +00:00
Ben Potter 12cb4f1eb3
docs: add Caddy+LetsEncrypt TLS example (#4585)
* structure

* docs: add Caddy+LetsEncrypt TLS example
2022-10-19 07:20:11 -05:00
Ben Potter d4585fefb8
chore: remove bare template (#4629) 2022-10-19 03:47:08 +00:00
Dean Sheather d898737d6d
feat: app sharing (now open source!) (#4378) 2022-10-15 02:46:38 +10:00
Garrett Delfosse 0f3221f9d0
fix: use more descriptive login flags (#4493) 2022-10-11 18:45:30 +00:00
Eric Paulsen 5411abb9c1
fix: PVC volume binding mode (#4471) 2022-10-10 22:05:54 -05:00
Kyle Carberry b402c6aba8
fix: Use `lower` function in default Kubernetes template (#4468)
Fixes #4467.
2022-10-10 21:16:06 -05:00
Mathias Fredriksson 93b8121c9b
fix: Change use of 1337 to 13337 in example templates (#4386) 2022-10-06 13:25:18 +00:00
Dean Sheather 2a66395fb7
feat: use app wildcards for apps if configured (#4263)
* feat: use app wildcards for apps if configured

* feat: relative_path -> subdomain

- rename relative_path -> subdomain when referring to apps
    - migrate workspace_apps.relative_path to workspace_apps.subdomain
- upgrade coder/coder terraform module to 0.5.0
2022-10-05 19:23:01 +00:00
Ammar Bandukwala 78a39a809d
examples: support both localhost and 127.0.0.1 in Docker examples (#4306)
And some minor fixes
2022-10-03 08:31:12 -05:00
Ammar Bandukwala 4b540b7c42
docs: simplify Docker quickstart (#4257) 2022-09-29 17:55:15 -05:00
Ben Potter 21e6bea792
docs: add health checks to docs & examples (#4223) 2022-09-27 12:58:39 -05:00
Ben Potter c86fc6e976
chore: examples/lima: bump terraform version (#4205)
Download terraform binary directly instead of using Hashicorp APT
repo.
Workaround for https://github.com/hashicorp/terraform/issues/31826

Signed-off-by: Cian Johnston <cian@coder.com>
Co-authored-by: Ben Potter <ben@coder.com>
2022-09-26 20:04:59 +00:00
Garrett Delfosse 4c8be34d81
feat: add health check monitoring to workspace apps (#4114) 2022-09-23 15:51:04 -04:00
Garrett Delfosse 7fe7ffea6d
chore: make fmt (#4121) 2022-09-19 20:22:46 +00:00
Ben Potter 64e4ea73c0
fix: docs: use diff view in Docker docs (#4110) 2022-09-19 09:43:54 -05:00
Eric Paulsen 45f39ba488
chore: rename AWS ECS template & fix docker template var (#4068) 2022-09-14 20:59:31 -05:00
Bruno Quaresma 214e59452f
feat: Show custom resource icons in the UI (#4020) 2022-09-13 11:32:59 -03:00
Joe Previte 067069d2e2
docs: add jsjoeio/coder-templates to community (#3986) 2022-09-12 10:49:05 +10:00
Eric Paulsen 9c5b879b16
add: ECS example template (#3915)
* add: ECS example template

* fix: empty main.tf

* cleanup

* rm: cluster & compute

* set CPU & memory vars

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

Co-authored-by: Ben Potter <ben@coder.com>
2022-09-08 15:27:27 +00:00
Andrei Kondratiev f5ba90b963
Home folder can be empty, so copying default bash settings (#3897) 2022-09-06 15:11:53 -05:00
Mickael 9583e16a05
Update community-templates.md (#3785)
added kubernetes dind template
2022-08-31 15:40:41 -05:00
Muhammad Atif Ali 774d7588dd
docs: Update community-templates.md (#3778)
Added docker based deep learning and matlab coder-templates
2022-08-31 12:04:16 +00:00
Eric Paulsen 8a60ee0391
add: code-server to template examples (#3739)
* add: code-server to template examples

* add: code-server to gcp templates

* add: code-server to gcp-linux template

* update: READMEs

* update: boot disk version

* update: google provider version
2022-08-30 10:55:40 -05:00
Eric Paulsen c4a9be9c41
update: google provider to latest (#3743)
* update: google provider to latest

* rm: code-server
2022-08-29 19:12:26 -05:00
Dean Sheather 14a9576b77
Auto import kubernetes template in Helm charts (#3550) 2022-08-26 05:32:35 +10:00
Eric Paulsen ca3c0490e0
chore: k8s example persistence & coder images (#3619)
* add: persistence & coder images

* add: code-server

* chore: README updates

* chore: README example
2022-08-24 11:23:02 -05:00
Kyle Carberry 09142255e6
fix: Add consistent use of `coder templates init` (#3665)
Closes #2303.
2022-08-24 11:40:36 -04:00
Ben Potter 8ca3fa9712
fix: use hardcoded "coder" user for AWS and Azure (#3625) 2022-08-22 22:19:30 +00:00
Mathias Fredriksson 544bf01fbb
chore: Update `coder/coder` provider in example templates (#3581)
Additionally, a convenience script was added to
`examples/update_template_versions.sh` to keep the templates up-to-date.

Fixes #2966
2022-08-19 17:18:11 +03:00
Ben Potter 4b6a82f92a
chore: rename to "template push" in docs (#3525) 2022-08-16 14:52:31 +00:00
Ammar Bandukwala d7b96f7d58
Correct spelling of macOS (#3478)
* Correct spelling of macOS

* fixup! Correct spelling of macOS

* fixup! Correct spelling of macOS
2022-08-11 21:22:06 -04:00
Ben Potter cee0d1f848
chore: add metadata to example templates (#3451) 2022-08-10 16:34:17 -05:00
Kyle Carberry fd73d6dd0d
fix: Reduce variables needed for Docker template (#3442)
* fix: Reduce variables needed for Docker template

This should make initial setup a bit simpler!

* Fix for M2 Macbooks

PostgreSQL 13 doesn't support the M series architecture.

* Fix name <-> id swap

* Update Docker provider to remove host requirement

Co-authored-by: Kyle Carberry <kyle@air.local>
2022-08-10 14:45:05 +00:00
Spike Curtis 049e7cb5df
azure-linux example template (#3348)
* azure-linux example template

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

* Use azurerm_linux_virtual_machine and wait for attachment

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

* Use azure-instance-identity

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-08 15:25:20 -07:00
David Wahler 9f54fa8e52
Make gcp-linux example template use a non-root user (#2480)
* make gcp-linux example template use a non-root user

* don't try to create user account if it already exists

* upgrade to debian-10 image since debian-9 is no longer available
2022-08-03 18:07:10 -05:00
Ammar Bandukwala 19fcf60864
ci: add typo detection (#3327)
And fix them.
2022-08-01 09:29:52 -04:00
Denbeigh Stevens 43b8cf04f0
fix: remove pipefail from standard shell options (#3269)
This isn't well-supported by every POSIX shell anyways.
2022-07-28 18:50:04 +00: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
Ammar Bandukwala f28d14197a
Rename default agent to "main" instead of "dev" (#3150)
Resolves #3143
2022-07-23 20:26:56 +00:00
David Wahler f7ea016494
Pass git configuration variables via terraform (#3034)
* Pass workspace owner email address to provisioner

* Remove owner_email and owner_username fields from agent metadata

* Add Git environment variables to example templates

* Remove "owner_name" field from provisioner metadata, use username instead

* Remove Git configuration from most templates, add documentation

* Proofreading/typo fixes from @mafredri

* Update example templates to latest version of terraform-provider-coder
2022-07-19 13:24:06 -05:00
Ben Potter b6ad5623a3
example: add a bare/custom template (#2965) 2022-07-19 13:29:24 +00:00
Cian Johnston 5e6320163d
change default aws linux instance type to t3.micro, reduce default template TTL (#2776)
- make default template max TTL 24 hours (still less than 168)
- make default workspace autostop 2 hours unless specified otherwise
- add instance type selector to aws templates
2022-07-12 19:37:59 +01:00
Ammar Bandukwala 13d7466ebc
docs: add Docker quickstart (#2875)
* Fix docker-compose file

* Add docker quickstart
2022-07-11 12:05:05 -05:00
Timo 752d6096a1
example: Added docker volume to docker-code-server (#2592) 2022-06-27 14:07:30 -05:00
Timo 7dfec821f5
example: Added code-server icon (#2591) 2022-06-27 14:46:41 -04:00
Camdon 09722ae1ef
Bump version number for coder terraform provider (#2673) 2022-06-27 08:49:26 -05: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
Oxylibrium 115730341e
fix: ensure gcp resource names are lowercase (#2619) 2022-06-24 15:11:24 -04:00
Cian Johnston 92bcacebde
cli/templateinit: add links to template READMEs (#2576)
- template init: add links to template docs
- examples: add URL field to examples, ensure that example fields are always non-empty
- cliui: bump wrap width to 80 from 58
2022-06-22 14:15:04 +00:00
Ketan Gangatirkar 93b78755a6
change Docker main.tf to be multiline and make the README.md wrap more nicely (#2537)
see issue #2385
2022-06-21 05:34:14 -05:00
Cian Johnston 0b6efce466
add lima template for coder (#2452)
This commit adds a lima example for Coder.
You can now run limactl start --name=coder ./examples/lima/coder.yaml and have a "prod-like" Coder instance up and running within a minute or so.

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-06-17 20:12:42 +00:00
Mathias Fredriksson b3f2b7c80a
feat: Add section for community templates (#2401)
* feat: Add section for community templates

* Add ntimo/coder-hetzner-cloud-template
2022-06-16 19:48:44 +03: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
Ben Potter 0ec1e8f89b
example: aws-linux: resize and use non-root user (#2186) 2022-06-09 18:10:01 +00:00
Mathias Fredriksson 567e4afdfc
example: Re-enable Digital Ocean project assignment (#2196)
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
2022-06-09 12:17:44 +03:00
Ben Potter 42c6b0849d
example: add and document dotfiles usage (#2046) 2022-06-08 21:23:54 +00:00
Spike Curtis a86c957871
feat: set /Users/spike for coder agent in gcp-linux template (#2147)
Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-08 11:22:18 -07:00
Spike Curtis 85821568a9
feat: set $HOME for coder agent in aws-linux template (#2150)
Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-08 09:51:33 -07:00
Spike Curtis a7a7e7561d
K8s template uses an authenticated environment (#2104)
* feat: K8s template uses authenticated environment

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

* fmt

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-06 14:39:23 -07:00
Katie Horne 318e9792ad
expand README files for examples (#1946) 2022-06-06 13:03:07 -05:00
Spike Curtis 3f3ecbf8b3
feat: Authenticate Digital Ocean via environment variable (#2051)
* Digital Ocean example uses environment variable auth

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-06 07:05:16 -05: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
Spike Curtis 847e2b18da
Don't use parameters to pass secrets to GCP or AWS (#2039)
* Don't use parameters to pass secrets to GCP or AWS

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

* Fix fmt

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-03 14:29:22 -07:00
Cian Johnston dcf03d8ba3
chore: refactor time.Duration -> int64 milliseconds for FE consumption (#1944)
* Changes all public-facing codersdk types to use a plain int64 (milliseconds) instead of time.Duration.
* Makes autostart_schedule a *string as it may not be present.
* Adds a utils/ptr package with some useful methods.
2022-06-02 11:23:34 +01:00
Cian Johnston 1c5d94ed5b
fix: add all regions to aws examples (#1934) 2022-06-01 11:20:14 +01:00
Ben Potter 7ad68ca36b
example: docker: support Windows hosts (#1880) 2022-05-28 01:09:29 +00:00
Ben Potter 5000edbfe0
example: docker warning on Coder host (#1842) 2022-05-27 13:02:59 -05:00
Mathias Fredriksson 1a70298b5c
feat: Add examples/templates/do-linux for Digital Ocean Droplets (#1749)
Co-authored-by: Cian Johnston <cian@coder.com>
2022-05-27 20:04:43 +03:00
Joe Previte d01a687caa
fix: typo in docker terraform template (#1811) 2022-05-26 21:28:17 +00:00
Ben Potter 47ef03fea4
example: fix: properly tag aws-windows workspaces (#1744) 2022-05-25 22:11:29 +01:00
David Wahler f8410dee3a
fix: include subdirectories in example templates (#1715) 2022-05-25 10:34:28 -05:00
Ben Potter 4afc66faf5
chore: remove docker host from docker-compose (#1596) 2022-05-19 20:38:07 +00:00
Ben Potter c47b6f0381
chore: use docker host in docker-compose (#1592) 2022-05-19 11:49:22 -05:00
LG 0438430c7c
fix: missing spacing added; typo fix (#1586)
Co-authored-by: Ben <ben@coder.com>
2022-05-19 15:51:49 +00:00
Ben Potter 37cf3bb491
example: add docker-image-builds + docker docs (#1526)
Co-authored-by: Katie Horne <katie@23spoons.com>
2022-05-18 16:03:20 -05:00
Cian Johnston 13571b0393
examples/docker-local: add explanatory comment (#1545) 2022-05-18 17:10:23 +01:00
Ben Potter 6bed620d6c
example: ec2: document "minimal" policy (#1536)
* example: ec2: document "minimal" policy

* move DescribeInstances

* move ModifyInstanceCreditSpecification
2022-05-18 08:17:05 -05:00
Cian Johnston 75dc8f59f6
fix: example: update docker-local to use host-gateway (#1507)
* fix: example: update docker-local to use host-gateway
* docker-compose.yaml: Add POSTGRES_ environment variables to CODER_PG_CONNECTION_URL

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-05-17 14:40:13 +00:00
Ben Potter 1ed69b95fc
example(k8s): clarify kubeconfig location (#1494) 2022-05-16 22:29:15 +00:00
G r e y 7bb7c6c295
example: use codercom/enterprise-intellij:ubuntu in docker-local (#1454)
Resolves: #1113
2022-05-14 13:58:12 -04:00
Ben Potter 982769f0dc
fix: uses "projects" instead of "templates" in examples docs 2022-05-11 13:42:47 -05:00
Kyle Carberry 3024e25c09
example: Add Kubernetes multi-service (#1092)
* example: Add Kubernetes multi-service

* fix: change to CODER_AGENT_TOKEN

* example: use ServiceAccount for cluster authentication (#1096)

Co-authored-by: Ben <ben@coder.com>
2022-05-11 18:27:31 +00:00
Ben Potter 568574c118
fix: use CODER_AGENT_TOKEN for docker example (#1295) 2022-05-04 22:42:58 +00:00
Ben Potter aaf6aee979
fix: clarify AWS access key ID vs secret (#1231) 2022-05-02 10:28:58 -05:00
Kyle Carberry b948f2dab5
fix: Use environment variables for agent authentication (#1238)
* fix: Update GIT_COMMITTER_NAME to use username

This was a mistake when adding the committer fields 🤦.

* fix: Use environment variables for agent authentication

Using files led to situations where running "coder server --dev" would
break `gitssh`. This is applicable in a production environment too. Users
should be able to log into another Coder deployment from their workspace.

Users can still set "CODER_URL" if they'd like with agent env vars!
2022-04-30 16:40:30 +00:00
Kyle Carberry 65d77383d0
fix: Allow nested Terraform resources (#1093)
This fixes the dependency tree by adding recursion. It
now finds indirect connections and associates it with
an agent.

An example is attached which surfaced this issue.
2022-04-20 12:28:48 -05:00
Bruno Quaresma 301451be40
refactor: remove index files from components (#1086) 2022-04-19 13:20:28 -05:00
Timo 9faa39aa23
example: added docker local workspace (#1025) 2022-04-18 10:20:45 -05:00
Kyle Carberry 19b4323512
feat: Allow workspace resources to attach multiple agents (#942)
This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.
2022-04-11 16:06:15 -05:00
Colin Adler 2b1a0ee126
chore: update v1 schema (#643) 2022-04-01 14:42:36 -05:00
Ben Potter e759b4a492
feat: Add aws-windows and aws-linux examples (#730)
* add readme for samples

* add sample of importing from repo

* add aws-linux and aws-windows examples

* cleanup

* cleanup

* sign

* fix grammar and comments from feedback

* use descript workspace name

* use TF version

* Fix requested changes on README

Co-authored-by: Kyle Carberry <kyle@coder.com>
2022-03-31 10:41:36 -05:00
Kyle Carberry 6612e3c9c7
feat: Add config-ssh command (#735)
* feat: Add config-ssh command

Closes #254 and #499.

* Fix Windows support
2022-03-30 17:59:54 -05:00
Colin Adler 6ab1a681c4
chore: specify google provider versions in example terraform projects (#740) 2022-03-30 13:12:11 -05:00
Kyle Carberry 82dfd6c72f
feat: Add UI for awaiting agent connections (#578)
* feat: Add stage to build logs

This adds a stage property to logs, and refactors the job logs
cliui.

It also adds tests to the cliui for build logs!

* feat: Add stage to build logs

This adds a stage property to logs, and refactors the job logs
cliui.

It also adds tests to the cliui for build logs!

* feat: Add config-ssh and tests for resiliency

* Rename "Echo" test to "ImmediateExit"

* Fix Terraform resource agent association

* Fix logs post-cancel

* Fix select on Windows

* Remove terraform init logs

* Move timer into it's own loop

* Fix race condition in provisioner jobs

* Fix requested changes
2022-03-28 19:19:28 -05:00
Kyle Carberry a06821c103
feat: Update Coder Terraform Provider to v0.2.1 (#563)
This update exposes the workspace name and owner, and changes
authentication methods to be explicit. Implicit authentication
added unnecessary complexity and introduced inconsistency.
2022-03-25 16:34:45 +00:00
Kyle Carberry 8c0f403546
fix: Build site in release (#561)
The static site wasn't being built before, resulting
in a directory listing!
2022-03-24 20:16:30 -05:00
Kyle Carberry c451f4e685
feat: Add templates to create working release (#422)
* Add templates

* Move API structs to codersdk

* Back to green tests!

* It all works, but now with tea! 🧋

* It works!

* Add cancellation to provisionerd

* Tests pass!

* Add deletion of workspaces and projects

* Fix agent lock

* Add clog

* Fix linting errors

* Remove unused CLI tests

* Rename daemon to start

* Fix leaking command

* Fix promptui test

* Update agent connection frequency

* Skip login tests on Windows

* Increase tunnel connect timeout

* Fix templater

* Lower test requirements

* Fix embed

* Disable promptui tests for Windows

* Fix write newline

* Fix PTY write newline

* Fix CloseReader

* Fix compilation on Windows

* Fix linting error

* Remove bubbletea

* Cleanup readwriter

* Use embedded templates instead of serving over API

* Move templates to examples

* Improve workspace create flow

* Fix Windows build

* Fix tests

* Fix linting errors

* Fix untar with extracting max size

* Fix newline char
2022-03-22 13:17:50 -06:00
Bryan 2e12cb92e5
refactor: Add example of project with resource (#346)
This just adds the most minimal terraform script to provision a resource (the [`null_resource`](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource)) that doesn't require a cloud provider.

With this, we can test creating projects that have an associated resource:
<img width="464" alt="Screen Shot 2022-02-21 at 2 31 54 PM" src="https://user-images.githubusercontent.com/88213859/155033757-372cafbf-b35f-4988-8fbe-af276e22421c.png">
2022-02-22 18:55:45 -08:00
Bryan 59ee22d368
refactor: Add a minimal example of a project with parameters (#331)
Thought it'd be helpful to show a bare-bones example of a project with a parameter, along with references to the Terraform docs so developers can learn about more interesting variable types (and ways to leverage them in expressions).

With this project, we can go through the `projects create` flow of setting a parameter:
<img width="677" alt="Screen Shot 2022-02-18 at 7 53 07 PM" src="https://user-images.githubusercontent.com/88213859/154785203-ab626268-0e51-48c3-b374-3d49d541042b.png">
2022-02-21 09:36:30 -08:00
Bryan 4c71ff93eb
refactor: Add minimal terraform project (#308)
I was thinking it might be nice to have some example projects (especially as we on-board new developers) to make it easy to create new projects.

This adds the most basic possible terraform module... just an output block. However, it's enough to run `coder projects create` and go through the whole lifecycle of creating a project and workspace (although, it's really boring since there are no parameters).
2022-02-17 21:11:48 -08:00