Skip to content

Commit c0b9ee1

Browse files
authored
chore: Add husky, lint-staged, prettier (coder#194)
- Add husky, lint-staged for a better developer experience - Add prettier to format all file types (JSON, MD, YAML) - Format the entire codebase
1 parent 0fbd0c8 commit c0b9ee1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1471
-842
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ jobs:
3434
run: yarn
3535

3636
- name: Lint
37-
run: yarn lint
37+
run: |
38+
yarn lint
39+
yarn fmt

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"overrides": [
4+
{
5+
"files": ["*.md"],
6+
"options": {
7+
"proseWrap": "always"
8+
}
9+
}
10+
]
11+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Coder Docs
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4+
45
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-)
6+
57
<!-- ALL-CONTRIBUTORS-BADGE:END -->
68

79
This repository contains the documentation source files for

admin/access-control/organizations.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,20 +315,20 @@ organization.
315315
**Deprecation Notice**: The `namespaceWhitelist` field has been deprecated in
316316
[Coder version 1.17](../../changelog/1.17.0.md).
317317

318-
Coder's Helm chart previously included a `namespaceWhitelist` field that accepted
319-
a list of cluster namespaces and made them available to Coder. The
320-
[Workspace Provider feature](../workspace-providers/index.md) supersedes this field.
321-
You will not be able to make any changes *unless* you are removing namespaces that
322-
no longer contain environments with Coder deployments v1.17.0 or later (if you
323-
remove namespaces from the `namespaceWhitelist` field, the environments in the
324-
namespaces are no longer accessible). For older Coder deployments, you can continue
325-
using existing environments in whitelisted namespaces, though you cannot create new
326-
environments in those namespaces.
318+
Coder's Helm chart previously included a `namespaceWhitelist` field that
319+
accepted a list of cluster namespaces and made them available to Coder. The
320+
[Workspace Provider feature](../workspace-providers/index.md) supersedes this
321+
field. You will not be able to make any changes _unless_ you are removing
322+
namespaces that no longer contain environments with Coder deployments v1.17.0 or
323+
later (if you remove namespaces from the `namespaceWhitelist` field, the
324+
environments in the namespaces are no longer accessible). For older Coder
325+
deployments, you can continue using existing environments in whitelisted
326+
namespaces, though you cannot create new environments in those namespaces.
327327

328328
If you want to separate Coder environments by namespaces in a Kubernetes
329-
cluster, you can do so by [deploying a new workspace
330-
provider](../workspace-providers/deployment.md) to each
331-
additional namespace in the cluster. The workspace provider provisions
329+
cluster, you can do so by
330+
[deploying a new workspace provider](../workspace-providers/deployment.md) to
331+
each additional namespace in the cluster. The workspace provider provisions
332332
environments to the namespace it has been deployed to, and you can control
333333
access to each workspace provider via an organization allowlist to replace the
334334
previous organization namespace behaviors.

admin/access-control/password-reset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ kubectl exec -it <cemanager pod> -- cemanager reset-admin-password
3939
```
4040

4141
You'll be presented with a temporary password for the **Site Admin** user; the
42-
next time the Site Admin logs in with this set of credentials, Coder will
43-
prompt them to change the password.
42+
next time the Site Admin logs in with this set of credentials, Coder will prompt
43+
them to change the password.

admin/access-control/user-management.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: "User Management"
33
description: Learn how to add, delete and manage Coder users.
44
---
55

6-
[Site managers](/access-control/user-roles#site-manager-permissions) can
7-
create and manage users from the **Users** page, which is accessible under
8-
**Manage** > **Users**.
6+
[Site managers](/access-control/user-roles#site-manager-permissions) can create
7+
and manage users from the **Users** page, which is accessible under **Manage** >
8+
**Users**.
99

1010
## Creating a New User
1111

@@ -36,5 +36,5 @@ To delete a user:
3636
1. You'll be prompted to confirm this action. Click **Delete** to proceed.
3737

3838
If you're using your organization's OpenID Connect Identity Provider to manage
39-
users, this process revokes the user's access to Coder; it does _not_ delete
40-
the user from your identity store.
39+
users, this process revokes the user's access to Coder; it does _not_ delete the
40+
user from your identity store.

admin/account-dormancy.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Account Dormancy
33
description: Learn how to manage the lifecycle of dormant user accounts.
44
---
55

6-
Coder's account dormancy feature allows you to free up license seats if you
7-
have users that aren't active on the platform for 90 days or more.
6+
Coder's account dormancy feature allows you to free up license seats if you have
7+
users that aren't active on the platform for 90 days or more.
88

99
You can choose to automatically delete a dormant account after a period of time.
10-
For example, you can set Coder to delete accounts 30 days after they go
11-
dormant (this means that the user has been inactive for 120 days: 90 days to
12-
become dormant, plus an additional 30 days).
10+
For example, you can set Coder to delete accounts 30 days after they go dormant
11+
(this means that the user has been inactive for 120 days: 90 days to become
12+
dormant, plus an additional 30 days).
1313

1414
![Account Dormancy](../assets/account-dormancy.png)

admin/audit.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Audit"
3-
description: Learn how Coder audits user and admin actions for greater traceability.
3+
description:
4+
Learn how Coder audits user and admin actions for greater traceability.
45
---
56

67
Coder maintains records of all user actions on system resources for auditing

admin/environment-management/cvms.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ title: Docker in Environments
33
description: Learn how to enable support for secure Docker inside Environments.
44
---
55

6-
If you're a site admin or a site manager, you can enable [container-based
7-
virtual machines (CVMs)](../../environments/cvms.md) as an environment
8-
deployment option. CVMs allow users to run system-level programs, such as Docker
9-
and systemd, in their environments.
6+
If you're a site admin or a site manager, you can enable
7+
[container-based virtual machines (CVMs)](../../environments/cvms.md) as an
8+
environment deployment option. CVMs allow users to run system-level programs,
9+
such as Docker and systemd, in their environments.
1010

1111
## Infrastructure Requirements
1212

13-
- CVMs leverage the [sysbox container
14-
runtime](https://github.com/nestybox/sysbox), so the Kubernetes Node must run
15-
a supported Linux distro with the minimum Kernel version (see [Sysbox Distro
16-
Compatibility](https://github.com/nestybox/sysbox/blob/master/docs/distro-compat.md)
13+
- CVMs leverage the
14+
[sysbox container runtime](https://github.com/nestybox/sysbox), so the
15+
Kubernetes Node must run a supported Linux distro with the minimum Kernel
16+
version (see
17+
[Sysbox Distro Compatibility](https://github.com/nestybox/sysbox/blob/master/docs/distro-compat.md)
1718
for more information)
1819
- The cluster must allow privileged containers and `hostPath` mounts. Read more
1920
about why this is still secure [here](#security).
@@ -28,8 +29,8 @@ such as Istio.
2829

2930
## Setting Up Your Cluster
3031

31-
The following sections show how you can set up your K8 clusters hosted by Google,
32-
Azure, and Amazon to support CVMs.
32+
The following sections show how you can set up your K8 clusters hosted by
33+
Google, Azure, and Amazon to support CVMs.
3334

3435
### Google Cloud Platform w/ GKE
3536

@@ -52,46 +53,46 @@ gcloud beta container clusters create "YOUR_NEW_CLUSTER" \
5253

5354
### Azure Kubernetes Service
5455

55-
If you're using Kubernetes version 1.18, Azure defaults to the correct Ubuntu node
56-
base image. When creating your cluster, set `--kubernetes-version` to `1.18.x`
57-
or newer for CVMs.
56+
If you're using Kubernetes version 1.18, Azure defaults to the correct Ubuntu
57+
node base image. When creating your cluster, set `--kubernetes-version` to
58+
`1.18.x` or newer for CVMs.
5859

5960
### Amazon Web Services w/ EKS
6061

6162
You can modify an existing [AWS-hosted container](../../setup/kubernetes/aws.md)
62-
to support CVMs by [creating a
63-
nodegroup](https://eksctl.io/usage/managing-nodegroups/#creating-a-nodegroup-from-a-config-file)
63+
to support CVMs by
64+
[creating a nodegroup](https://eksctl.io/usage/managing-nodegroups/#creating-a-nodegroup-from-a-config-file)
6465
and updating your `eksctl` config spec.
6566

6667
1. Define your config file in the location of your choice (we've named the file
6768
`coder-node.yaml`, but you can call it whatever you'd like):
6869

69-
```yaml
70-
apiVersion: eksctl.io/v1alpha5
71-
kind: ClusterConfig
70+
```yaml
71+
apiVersion: eksctl.io/v1alpha5
72+
kind: ClusterConfig
7273

73-
metadata:
74-
version: "1.17"
75-
name: <YOUR_CLUSTER_NAME>
76-
region: <YOUR_AWS_REGION>
74+
metadata:
75+
version: "1.17"
76+
name: <YOUR_CLUSTER_NAME>
77+
region: <YOUR_AWS_REGION>
7778

78-
nodeGroups:
79-
- name: coder-node-group
80-
amiFamily: Ubuntu1804
81-
```
79+
nodeGroups:
80+
- name: coder-node-group
81+
amiFamily: Ubuntu1804
82+
```
8283
8384
1. Create your nodegroup (be sure to provide the correct file name):
8485
85-
```console
86-
eksctl create nodegroup --config-file=coder-node.yaml
87-
```
86+
```console
87+
eksctl create nodegroup --config-file=coder-node.yaml
88+
```
8889

8990
## Security
9091

9192
The [Container-based Virtual Machine](../../environments/cvms.md) deployment
92-
option leverages the [sysbox container
93-
runtime](https://github.com/nestybox/sysbox) to offer a VM-like user experience
94-
while retaining the footprint of a typical container.
93+
option leverages the
94+
[sysbox container runtime](https://github.com/nestybox/sysbox) to offer a
95+
VM-like user experience while retaining the footprint of a typical container.
9596

9697
Coder first launches a supervising container with additional privileges. This
9798
container is standard and included with the Coder release package. During the
@@ -101,8 +102,8 @@ inner container is the user’s [environment](../../environments/index.md).
101102

102103
The user cannot gain access to the supervising container at any point. The
103104
isolation between the user's environment container and its outer, supervising
104-
container is what provides [strong
105-
isolation](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/security.md).
105+
container is what provides
106+
[strong isolation](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/security.md).
106107

107108
## Image Configuration
108109

@@ -111,8 +112,8 @@ and Docker for use in CVMs.
111112

112113
### systemd
113114

114-
If your image's OS distribution doesn't link the `systemd` init to
115-
`/sbin/init`, you'll need to do this manually in your Dockerfile.
115+
If your image's OS distribution doesn't link the `systemd` init to `/sbin/init`,
116+
you'll need to do this manually in your Dockerfile.
116117

117118
The following snippet shows how you can specify `systemd` as the init in your
118119
image:
@@ -133,9 +134,9 @@ a `PID` of 1.
133134

134135
### Docker
135136

136-
To add Docker, install the `docker` packages into your image. For a
137-
seamless experience, use [systemd](#systemd) and register the `docker` service
138-
so `dockerd` runs automatically during initialization.
137+
To add Docker, install the `docker` packages into your image. For a seamless
138+
experience, use [systemd](#systemd) and register the `docker` service so
139+
`dockerd` runs automatically during initialization.
139140

140141
The following snippet shows how your image can register the `docker` services in
141142
its Dockerfile.

admin/environment-management/extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ point Coder to an air-gapped instance of
2929

3030
View the [OpenVSX deployment wiki] for more information.
3131

32-
[OpenVSX deployment wiki]:
33-
https://github.com/eclipse/openvsx/wiki/Deploying-Open-VSX
32+
[openvsx deployment wiki]:
33+
https://github.com/eclipse/openvsx/wiki/Deploying-Open-VSX

0 commit comments

Comments
 (0)