Skip to content

Commit 2bf40fe

Browse files
committed
Merge remote-tracking branch 'origin/main' into reorg-status-card-for-clarity/kira-pilot
2 parents 43dbc3c + 913c0f5 commit 2bf40fe

File tree

19 files changed

+815
-101
lines changed

19 files changed

+815
-101
lines changed

.github/workflows/coder.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
- uses: actions/checkout@v3
5353
- name: Run ShellCheck
5454
uses: ludeeus/action-shellcheck@1.1.0
55+
env:
56+
SHELLCHECK_OPTS: --external-sources
5557
with:
5658
ignore: node_modules
5759

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ lint/go:
7171
# Use shfmt to determine the shell files, takes editorconfig into consideration.
7272
lint/shellcheck: $(shell shfmt -f .)
7373
@echo "--- shellcheck"
74-
shellcheck $(shell shfmt -f .)
74+
shellcheck --external-sources $(shell shfmt -f .)
7575

7676
peerbroker/proto/peerbroker.pb.go: peerbroker/proto/peerbroker.proto
7777
protoc \

README.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -56,47 +56,25 @@ You can use any Web IDE ([code-server](https://github.com/coder/code-server), [p
5656

5757
## Installing Coder
5858

59-
We recommend installing [the latest
60-
release](https://github.com/coder/coder/releases) on a system with at least 1
61-
CPU core and 2 GB RAM:
59+
There are a few ways to install Coder: [install script](./docs/install.md#installsh) (macOS, Linux), [docker-compose](./docs/install.md#docker-compose), or [manually](./docs/install.md#manual) via the latest release (macOS, Windows, and Linux).
6260

63-
1. Download the [release asset](https://github.com/coder/coder/releases) appropriate for your operating system
64-
1. Unzip the folder you just downloaded, and move the `coder` executable to a location that's on your `PATH`
61+
If you use the install script, you can preview what occurs during the install process:
6562

66-
```sh
67-
# ex. MacOS and Linux
68-
mv coder /usr/local/bin
69-
```
70-
71-
Windows: see [this guide](https://answers.microsoft.com/en-us/windows/forum/all/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23) on adding a folder to `PATH`
72-
73-
There are a few ways to run Coder:
74-
75-
- To run a **temporary deployment**, start with dev mode (all data is in-memory and destroyed on exit):
76-
77-
```bash
78-
coder server --dev
79-
```
80-
81-
- To run a **production deployment** with PostgreSQL:
82-
83-
```bash
84-
CODER_PG_CONNECTION_URL="postgres://<username>@<host>/<database>?password=<password>" \
85-
coder server
86-
```
63+
```sh
64+
curl -fsSL https://coder.com/install.sh | sh -s -- --dry-run
65+
```
8766

88-
- To run as a **system service**, install with `.deb` (Debian, Ubuntu) or `.rpm` (Fedora, CentOS, RHEL, SUSE):
67+
To install, run:
8968

90-
```bash
91-
# Edit the configuration!
92-
sudo vim /etc/coder.d/coder.env
93-
sudo service coder restart
94-
```
69+
```sh
70+
curl -fsSL https://coder.com/install.sh | sh
71+
```
9572

96-
> macOS and Windows users: You'll need to write your own
97-
> configuration to run Coder as a system service.
73+
Once installed, you can run a temporary deployment in dev mode (all data is in-memory and destroyed on exit):
9874

99-
- See the [installation guide](./docs/install.md) for additional ways to run Coder (e.g., docker-compose)
75+
```sh
76+
coder server --dev
77+
```
10078

10179
Use `coder --help` to get a complete list of flags and environment variables.
10280

coderd/database/databasefake/databasefake.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,9 +1128,14 @@ func (q *fakeQuerier) InsertAPIKey(_ context.Context, arg database.InsertAPIKeyP
11281128
q.mutex.Lock()
11291129
defer q.mutex.Unlock()
11301130

1131+
if arg.LifetimeSeconds == 0 {
1132+
arg.LifetimeSeconds = 86400
1133+
}
1134+
11311135
//nolint:gosimple
11321136
key := database.APIKey{
11331137
ID: arg.ID,
1138+
LifetimeSeconds: arg.LifetimeSeconds,
11341139
HashedSecret: arg.HashedSecret,
11351140
UserID: arg.UserID,
11361141
ExpiresAt: arg.ExpiresAt,

coderd/database/dump.sql

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE api_keys DROP COLUMN lifetime_seconds;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Default lifetime is 24hours.
2+
ALTER TABLE api_keys ADD COLUMN lifetime_seconds bigint default 86400 NOT NULL;

coderd/database/models.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/apikeys.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LIMIT
1212
INSERT INTO
1313
api_keys (
1414
id,
15+
lifetime_seconds,
1516
hashed_secret,
1617
user_id,
1718
last_used,
@@ -25,7 +26,13 @@ INSERT INTO
2526
oauth_expiry
2627
)
2728
VALUES
28-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING *;
29+
(@id,
30+
-- If the lifetime is set to 0, default to 24hrs
31+
CASE @lifetime_seconds::bigint
32+
WHEN 0 THEN 86400
33+
ELSE @lifetime_seconds::bigint
34+
END
35+
, @hashed_secret, @user_id, @last_used, @expires_at, @created_at, @updated_at, @login_type, @oauth_access_token, @oauth_refresh_token, @oauth_id_token, @oauth_expiry) RETURNING *;
2936

3037
-- name: UpdateAPIKeyByID :exec
3138
UPDATE

0 commit comments

Comments
 (0)