-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into implement-caddy
- Loading branch information
Showing
159 changed files
with
12,025 additions
and
1,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 'test backend' | ||
on: ['push', 'pull_request'] | ||
|
||
jobs: | ||
# Uncomment to get a debug shell. | ||
# debug: {runs-on: 'ubuntu-latest', steps: [{uses: 'actions/checkout@v4'}, {uses: 'mxschmitt/action-tmate@v3'}]} | ||
|
||
test: | ||
name: 'test (linux)' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: 'actions/checkout@v4' | ||
- name: 'test (linux)' | ||
run: | | ||
# Quick exit on compile errors. | ||
go build -race ./cmd/goatcounter || exit 1 | ||
# Make sure it at least compiles on macOS, Windows, and arm64 | ||
GOARCH=arm64 go build ./cmd/goatcounter | ||
GOARCH=arm64 GOOS=darwin go build ./cmd/goatcounter | ||
GOOS=windows go build ./cmd/goatcounter | ||
go test -race -timeout=3m ./... | ||
docker compose up -d --wait | ||
export PGHOST=localhost | ||
export PGPORT=5433 | ||
export PGDATABASE=goatcounter | ||
export PGUSER=goatcounter | ||
export PGPASSWORD=goatcounter | ||
export PGSSLMODE=disable | ||
go test -race -timeout=3m -tags pgsql ./... | ||
staticcheck: | ||
name: 'staticcheck' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: 'actions/checkout@v4' | ||
- uses: 'dominikh/[email protected]' | ||
with: {version: '2024.1'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgZ+6CjBdA0CRpyZ7b | ||
uQDTAPO3mGuVslKgDJYBqQhsADWhRANCAARjVjMjeXYRvpQbHlGaxmQG5/zFMpyT | ||
R8AhaO2iYbniv79fig831YYcELEJ1aqdYSkkObSBkbxfbPe/0iXcvWfp | ||
-----END PRIVATE KEY----- | ||
-----BEGIN CERTIFICATE----- | ||
MIICVDCCAfqgAwIBAgIRAP7F6nNH6HULuRZf7hMhJYgwCgYIKoZIzj0EAwIwgYsx | ||
HTAbBgNVBAoTFHpjZXJ0IGRldmVsb3BtZW50IENBMTEwLwYDVQQLDChtYXJ0aW5A | ||
ZTU4NS5hcnAyNDIubmV0IChNYXJ0aW4gVG91cm5vaWopMTcwNQYDVQQDDC56Y2Vy | ||
dCBtYXJ0aW5AZTU4NS5hcnAyNDIubmV0IChNYXJ0aW4gVG91cm5vaWopMB4XDTIx | ||
MDcyMDEwNTA0NFoXDTIyMDcyMDEwNTA0NFowWzEmMCQGA1UEChMdemNlcnQgZGV2 | ||
ZWxvcG1lbnQgY2VydGlmaWNhdGUxMTAvBgNVBAsMKG1hcnRpbkBlNTg1LmFycDI0 | ||
Mi5uZXQgKE1hcnRpbiBUb3Vybm9paikwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC | ||
AARjVjMjeXYRvpQbHlGaxmQG5/zFMpyTR8AhaO2iYbniv79fig831YYcELEJ1aqd | ||
YSkkObSBkbxfbPe/0iXcvWfpo24wbDAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAww | ||
CgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRIhKNifk+PlpTR | ||
WaHGmtoEl5z4BzAWBgNVHREEDzANggtleGFtcGxlLmNvbTAKBggqhkjOPQQDAgNI | ||
ADBFAiEA+k4vdFwrZXskGCKZ5gwxpuiqqXqf5JDjDDmxT4r7S9gCIAxDStKT/SDg | ||
9NDcX1EZZ0h+Ay3jWg3Gggf2ccENAL/5 | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,18 +191,18 @@ func TestDBSite(t *testing.T) { | |
"-db="+dbc, | ||
"-find=1", | ||
) | ||
wantExit(t, exit, out, 1) | ||
wantExit(t, exit, out, 0) | ||
|
||
have := zdb.DumpString(ctx, `select site_id, parent, cname, state from sites order by site_id`) + | ||
zdb.DumpString(ctx, `select user_id, site_id, email from users order by user_id`) | ||
want := ` | ||
site_id parent cname state | ||
1 NULL gctest.localhost a | ||
2 1 update.example.com a | ||
3 1 stats2.stats a | ||
1 NULL NULL d | ||
2 NULL update.example.com a | ||
3 2 stats2.stats a | ||
user_id site_id email | ||
1 1 [email protected] | ||
2 1 [email protected]` | ||
1 2 [email protected] | ||
2 2 [email protected]` | ||
if d := zdb.Diff(have, want); d != "" { | ||
t.Error(d) | ||
} | ||
|
@@ -220,35 +220,12 @@ func TestDBSite(t *testing.T) { | |
zdb.DumpString(ctx, `select user_id, site_id, email from users order by user_id`) | ||
want := ` | ||
site_id parent cname state | ||
1 NULL gctest.localhost a | ||
2 1 update.example.com a | ||
3 1 stats2.stats d | ||
1 NULL NULL d | ||
2 NULL update.example.com a | ||
3 2 NULL d | ||
user_id site_id email | ||
1 1 [email protected] | ||
2 1 [email protected]` | ||
if d := zdb.Diff(have, want); d != "" { | ||
t.Error(d) | ||
} | ||
} | ||
|
||
{ // Force delete | ||
runCmd(t, exit, "db", "delete", "site", | ||
"-db="+dbc, | ||
"-find=1", | ||
"-force", | ||
) | ||
wantExit(t, exit, out, 0) | ||
|
||
have := zdb.DumpString(ctx, `select site_id, parent, cname, state from sites order by site_id`) + | ||
zdb.DumpString(ctx, `select user_id, site_id, email from users order by user_id`) | ||
want := ` | ||
site_id parent cname state | ||
1 NULL gctest.localhost d | ||
2 1 update.example.com d | ||
3 1 stats2.stats d | ||
user_id site_id email | ||
1 1 [email protected] | ||
2 1 [email protected]` | ||
1 2 [email protected] | ||
2 2 [email protected]` | ||
if d := zdb.Diff(have, want); d != "" { | ||
t.Error(d) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.