Skip to content

Commit 1d7b18c

Browse files
authored
Merge pull request #1577 from DefGuard/release_1.5_merger
Release 1.5 merger
2 parents 141976b + b589d42 commit 1d7b18c

File tree

291 files changed

+12346
-4994
lines changed

Some content is hidden

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

291 files changed

+12346
-4994
lines changed

.github/workflows/build-docker.yml

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,43 @@ env:
1818
jobs:
1919
build-docker:
2020
runs-on:
21-
- self-hosted
22-
- Linux
23-
- ${{ matrix.runner }}
21+
- codebuild-defguard-core-runner-${{ github.run_id }}-${{ github.run_attempt }}
22+
image:${{ matrix.os }}
23+
instance-size:${{ matrix.size }}
24+
2425
strategy:
2526
matrix:
26-
# cpu: [arm64, amd64, arm/v7]
2727
cpu: [arm64, amd64]
2828
include:
29-
- cpu: arm64
30-
runner: ARM64
29+
- os: arm-3.0
30+
size: xlarge
31+
cpu: arm64
3132
tag: arm64
32-
- cpu: amd64
33-
runner: X64
33+
- os: ubuntu-7.0
34+
size: xlarge
35+
cpu: amd64
3436
tag: amd64
35-
# - cpu: arm/v7
36-
# runner: ARM
37-
# tag: armv7
37+
38+
permissions:
39+
contents: read
40+
packages: write
41+
3842
steps:
3943
- name: Checkout
4044
uses: actions/checkout@v4
4145
with:
4246
submodules: recursive
47+
4348
- name: Login to GitHub container registry
4449
uses: docker/login-action@v3
4550
with:
4651
registry: ghcr.io
4752
username: ${{ github.actor }}
4853
password: ${{ secrets.GITHUB_TOKEN }}
54+
4955
- name: Set up Docker Buildx
5056
uses: docker/setup-buildx-action@v3
51-
with:
52-
buildkitd-config-inline: |
53-
[registry."docker.io"]
54-
mirrors = ["dockerhub-proxy.teonite.net"]
57+
5558
- name: Build container
5659
uses: docker/build-push-action@v6
5760
with:
@@ -60,13 +63,35 @@ jobs:
6063
provenance: false
6164
push: true
6265
tags: "${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.tag }}"
63-
cache-from: type=gha
64-
cache-to: type=gha,mode=max
66+
cache-from: |
67+
type=registry,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}
68+
type=registry,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}-${{ github.ref_name }}
69+
cache-to: type=registry,mode=max,ref=${{ env.GHCR_REPO }}:cache-${{ matrix.tag }}-${{ github.ref_name }}
70+
71+
- name: Scan image with Trivy
72+
uses: aquasecurity/[email protected]
73+
with:
74+
image-ref: "${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.tag }}"
75+
format: "table"
76+
exit-code: "1"
77+
ignore-unfixed: true
78+
vuln-type: "os,library"
79+
severity: "CRITICAL,HIGH,MEDIUM"
6580

6681
docker-manifest:
6782
runs-on: [self-hosted, Linux]
83+
84+
permissions:
85+
contents: read
86+
packages: write
87+
id-token: write # needed for signing the images with GitHub OIDC Token
88+
6889
needs: [build-docker]
90+
6991
steps:
92+
- name: Install Cosign
93+
uses: sigstore/[email protected]
94+
7095
- name: Docker meta
7196
id: meta
7297
uses: docker/metadata-action@v5
@@ -75,12 +100,14 @@ jobs:
75100
${{ env.GHCR_REPO }}
76101
flavor: ${{ inputs.flavor }}
77102
tags: ${{ inputs.tags }}
103+
78104
- name: Login to GitHub container registry
79105
uses: docker/login-action@v3
80106
with:
81107
registry: ghcr.io
82108
username: ${{ github.actor }}
83109
password: ${{ secrets.GITHUB_TOKEN }}
110+
84111
- name: Create and push manifests
85112
run: |
86113
tags='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
@@ -90,4 +117,13 @@ jobs:
90117
docker manifest create ${tag} ${{ env.GHCR_REPO }}:${{ github.sha }}-amd64 ${{ env.GHCR_REPO }}:${{ github.sha }}-arm64
91118
docker manifest push ${tag}
92119
done
93-
# ${{ env.GHCR_REPO }}:${{ github.sha }}-armv7
120+
121+
- name: Sign the images with GitHub OIDC Token
122+
run: |
123+
images='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
124+
cosign sign --yes ${images}
125+
126+
- name: Verify image signatures
127+
run: |
128+
images='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
129+
cosign verify ${images} --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp="https://github.com/DefGuard/defguard" -o text

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ on:
2020

2121
jobs:
2222
test:
23-
runs-on: [self-hosted, Linux, X64]
24-
container: rust:1
23+
runs-on:
24+
- codebuild-defguard-core-runner-${{ github.run_id }}-${{ github.run_attempt }}
25+
26+
container: public.ecr.aws/docker/library/rust:1
2527

2628
services:
2729
postgres:
28-
image: postgres:17-alpine
30+
image: public.ecr.aws/docker/library/postgres:17-alpine
2931
env:
3032
POSTGRES_DB: defguard
3133
POSTGRES_USER: defguard
@@ -52,21 +54,30 @@ jobs:
5254
uses: actions/checkout@v4
5355
with:
5456
submodules: recursive
57+
5558
- name: Cache
5659
uses: Swatinem/rust-cache@v2
60+
5761
- name: Install protoc
5862
run: apt-get update && apt-get -y install protobuf-compiler
63+
5964
- name: Check format
6065
run: |
6166
rustup component add rustfmt
6267
cargo fmt -- --check
68+
6369
- name: Run clippy linter
6470
run: |
6571
rustup component add clippy
6672
cargo clippy --all-targets --all-features -- -D warnings
73+
6774
- name: Run cargo deny
68-
uses: EmbarkStudios/cargo-deny-action@v2
75+
run: |
76+
cargo install cargo-deny
77+
cargo deny check
78+
6979
- name: Install nextest
7080
uses: taiki-e/install-action@nextest
81+
7182
- name: Run tests
7283
run: cargo nextest run --locked --no-fail-fast

.github/workflows/current.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build current image
22
permissions:
33
contents: read
4+
id-token: write
5+
packages: write
46
on:
57
push:
68
branches:

.github/workflows/e2e.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@ permissions:
1010

1111
jobs:
1212
test:
13-
runs-on: [self-hosted, Linux, X64]
13+
runs-on:
14+
- codebuild-defguard-core-runner-${{ github.run_id }}-${{ github.run_attempt }}
15+
instance-size:2xlarge
16+
1417
steps:
1518
- uses: actions/checkout@v4
1619
- name: Set up Docker Buildx
1720
uses: docker/setup-buildx-action@v3
18-
with:
19-
buildkitd-config-inline: |
20-
[registry."docker.io"]
21-
mirrors = ["dockerhub-proxy.teonite.net"]
21+
2222
- name: Login to GitHub container registry
2323
uses: docker/login-action@v3
2424
with:
2525
registry: ghcr.io
2626
username: ${{ github.actor }}
2727
password: ${{ secrets.GITHUB_TOKEN }}
28+
2829
- name: Export image tag
2930
run: |
3031
# strip "refs/heads.” to get just the branch name
@@ -38,16 +39,19 @@ jobs:
3839
fi
3940
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
4041
echo "E2E tests will run on IMAGE_TAG=$IMAGE_TAG"
42+
4143
- name: Set up Node
4244
uses: actions/setup-node@v4
4345
with:
4446
node-version-file: "./e2e/.nvmrc"
47+
4548
- name: Install pnpm
4649
id: pnpm-install
4750
uses: pnpm/action-setup@v4
4851
with:
4952
version: 10
5053
run_install: false
54+
5155
- name: Get pnpm store directory
5256
id: pnpm-cache
5357
shell: bash
@@ -61,34 +65,40 @@ jobs:
6165
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
6266
restore-keys: |
6367
${{ runner.os }}-pnpm-store-
68+
6469
- name: Pull images
6570
run: docker compose --file './docker-compose.e2e.yaml' pull
66-
- name: Start compose
67-
run: docker compose --file './docker-compose.e2e.yaml' up -d
71+
6872
- name: Install E2E dependencies
6973
working-directory: ./e2e
7074
run: pnpm install --frozen-lockfile
75+
7176
- name: Install playwright chromium
7277
working-directory: ./e2e
7378
run: npx playwright install chromium
79+
7480
- name: run tests
7581
working-directory: ./e2e
7682
run: pnpm test
83+
7784
- name: Stop compose
7885
if: always()
7986
run: docker compose --file './docker-compose.e2e.yaml' down
87+
8088
- uses: actions/upload-artifact@v4
8189
if: failure()
8290
with:
8391
name: playwright-report
8492
path: |
8593
./e2e/playwright-report
8694
retention-days: 7
95+
8796
trigger-dev-deploy:
8897
needs: test
8998
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'dev' }}
9099
uses: ./.github/workflows/dev-deployment.yml
91100
secrets: inherit
101+
92102
trigger-staging-deploy:
93103
needs: test
94104
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref_name, 'release/') }}

.github/workflows/lint-web.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ on:
33
branches:
44
- main
55
- dev
6-
- 'release/**'
7-
paths:
8-
- "web/**"
6+
- "release/**"
7+
paths-ignore:
8+
- "*.md"
9+
- "LICENSE"
910
pull_request:
1011
branches:
1112
- main
1213
- dev
13-
- 'release/**'
14-
paths:
15-
- "web/**"
14+
- "release/**"
15+
paths-ignore:
16+
- "*.md"
17+
- "LICENSE"
1618

1719
jobs:
1820
lint-web:
19-
runs-on: [self-hosted, Linux, X64]
21+
runs-on:
22+
- codebuild-defguard-core-runner-${{ github.run_id }}-${{ github.run_attempt }}
23+
2024
steps:
2125
- uses: actions/checkout@v4
2226
with:
@@ -27,11 +31,11 @@ jobs:
2731
- name: install deps
2832
working-directory: ./web
2933
run: |
30-
npm i -g pnpm
34+
npm i -g npm pnpm
3135
pnpm i --frozen-lockfile
3236
- name: Lint
3337
working-directory: ./web
34-
run: pnpm run lint-ci
38+
run: pnpm run lint
3539
- name: Audit
3640
working-directory: ./web
3741
run: pnpm audit --prod

.github/workflows/release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ jobs:
5353

5454
build-binaries:
5555
needs: [create-release]
56+
5657
runs-on:
5758
- self-hosted
5859
- Linux
5960
- X64
61+
6062
strategy:
6163
fail-fast: false
6264
matrix:
@@ -71,6 +73,10 @@ jobs:
7173
- build: freebsd
7274
arch: amd64
7375
target: x86_64-unknown-freebsd
76+
77+
permissions:
78+
contents: write # needed to upload release assets
79+
7480
steps:
7581
# Store the version, stripping any v-prefix
7682
- name: Write release version
@@ -105,14 +111,12 @@ jobs:
105111
- name: Install pnpm
106112
uses: pnpm/action-setup@v4
107113
with:
108-
version: 9
114+
version: 10
109115

110-
- name: Use Node.js 20
116+
- name: Use Node.js 24
111117
uses: actions/setup-node@v4
112118
with:
113-
node-version: 20
114-
cache: "pnpm"
115-
cache-dependency-path: ./web/pnpm-lock.yaml
119+
node-version: 24
116120

117121
- name: Install frontend dependencies
118122
run: pnpm install --ignore-scripts --frozen-lockfile
@@ -165,7 +169,7 @@ jobs:
165169
- name: Build AMI images for multiple regions
166170
if: matrix.build == 'linux' && matrix.arch == 'amd64'
167171
run: |
168-
regions=(us-east-1 eu-west-1 ap-northeast-1)
172+
regions=(us-east-1 eu-west-1 ap-northeast-1 eu-central-1)
169173
for region in "${regions[@]}"; do
170174
echo "Building AMI for region: $region"
171175
echo "Running packer validate for $region..."

0 commit comments

Comments
 (0)