Skip to content

Commit c9ef52d

Browse files
authored
Merge pull request #166 from DefGuard/release_1.5_merger
Release 1.5 merger
2 parents dd5307f + 996cdb2 commit c9ef52d

File tree

85 files changed

+2471
-2165
lines changed

Some content is hidden

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

85 files changed

+2471
-2165
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*.{rs,sql,toml}]
4+
charset = utf-8
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
end_of_line = lf
8+
9+
[*.{rs}]
10+
indent_style = tab
11+
indent_size = 4
12+
rulers = 100

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.eot -text
2+
*.ttf -text
3+
*.woff -text
4+
*.woff2 -text
5+
*.png -text
6+
*.pdf -text
7+
*.jpeg -text
8+
*.webm -text

.github/workflows/build-docker.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- self-hosted
2222
- Linux
2323
- ${{ matrix.runner }}
24+
2425
strategy:
2526
matrix:
2627
cpu: [arm64, amd64]
@@ -31,23 +32,31 @@ jobs:
3132
- cpu: amd64
3233
runner: X64
3334
tag: amd64
35+
36+
permissions:
37+
contents: read
38+
packages: write
39+
3440
steps:
3541
- name: Checkout
3642
uses: actions/checkout@v4
3743
with:
3844
submodules: recursive
45+
3946
- name: Login to GitHub container registry
4047
uses: docker/login-action@v3
4148
with:
4249
registry: ghcr.io
4350
username: ${{ github.actor }}
4451
password: ${{ secrets.GITHUB_TOKEN }}
52+
4553
- name: Set up Docker Buildx
4654
uses: docker/setup-buildx-action@v3
4755
with:
4856
buildkitd-config-inline: |
4957
[registry."docker.io"]
5058
mirrors = ["dockerhub-proxy.teonite.net"]
59+
5160
- name: Build container
5261
uses: docker/build-push-action@v5
5362
with:
@@ -59,10 +68,30 @@ jobs:
5968
cache-from: type=gha
6069
cache-to: type=gha,mode=max
6170

71+
- name: Scan image with Trivy
72+
uses: aquasecurity/trivy-action@0.32.0
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"
80+
6281
docker-manifest:
6382
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+
6489
needs: [build-docker]
90+
6591
steps:
92+
- name: Install Cosign
93+
uses: sigstore/cosign-installer@v3.9.2
94+
6695
- name: Docker meta
6796
id: meta
6897
uses: docker/metadata-action@v5
@@ -71,12 +100,14 @@ jobs:
71100
${{ env.GHCR_REPO }}
72101
flavor: ${{ inputs.flavor }}
73102
tags: ${{ inputs.tags }}
103+
74104
- name: Login to GitHub container registry
75105
uses: docker/login-action@v3
76106
with:
77107
registry: ghcr.io
78108
username: ${{ github.actor }}
79109
password: ${{ secrets.GITHUB_TOKEN }}
110+
80111
- name: Create and push manifests
81112
run: |
82113
tags='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
@@ -86,3 +117,13 @@ jobs:
86117
docker manifest create ${tag} ${{ env.GHCR_REPO }}:${{ github.sha }}-amd64 ${{ env.GHCR_REPO }}:${{ github.sha }}-arm64
87118
docker manifest push ${tag}
88119
done
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/proxy" -o text

.github/workflows/lint-web.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@ on:
55
branches:
66
- main
77
- dev
8-
paths:
9-
- "web/**"
8+
- 'release/**'
9+
paths-ignore:
10+
- "*.md"
11+
- "LICENSE"
1012
pull_request:
1113
branches:
1214
- main
1315
- dev
14-
paths:
15-
- "web/**"
16+
- 'release/**'
17+
paths-ignore:
18+
- "*.md"
19+
- "LICENSE"
1620

1721
jobs:
1822
lint-web:
19-
runs-on: [self-hosted, Linux, X64]
23+
runs-on:
24+
- codebuild-defguard-proxy-runner-${{ github.run_id }}-${{ github.run_attempt }}
25+
2026
steps:
21-
- uses: actions/checkout@v4
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
2231
- uses: actions/setup-node@v4
2332
with:
2433
node-version: 24

.github/workflows/release.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ jobs:
9595
target: ${{ matrix.target }}
9696
override: true
9797

98+
- name: Setup `packer`
99+
uses: hashicorp/setup-packer@main
100+
id: setup
101+
98102
- name: Set up Docker BuildX
99103
uses: docker/setup-buildx-action@v3
100104
with:
@@ -105,14 +109,12 @@ jobs:
105109
- name: Install pnpm
106110
uses: pnpm/action-setup@v4
107111
with:
108-
version: 9
112+
version: 10
109113

110-
- name: Use Node.js 20
114+
- name: Use Node.js 24
111115
uses: actions/setup-node@v4
112116
with:
113-
node-version: 20
114-
cache: "pnpm"
115-
cache-dependency-path: ./web/pnpm-lock.yaml
117+
node-version: 24
116118

117119
- name: Install frontend dependencies
118120
run: pnpm install --ignore-scripts --frozen-lockfile
@@ -168,6 +170,26 @@ jobs:
168170
asset_name: defguard-proxy-${{ env.VERSION }}-${{ matrix.target }}.deb
169171
asset_content_type: application/octet-stream
170172

173+
- name: Run `packer init`
174+
if: matrix.build == 'linux' && matrix.arch == 'amd64'
175+
id: init
176+
run: "packer init ./images/ami/proxy.pkr.hcl"
177+
178+
- name: Build AMI images for multiple regions
179+
if: matrix.build == 'linux' && matrix.arch == 'amd64'
180+
run: |
181+
regions=(us-east-1 eu-west-1 ap-northeast-1 eu-central-1)
182+
for region in "${regions[@]}"; do
183+
echo "Building AMI for region: $region"
184+
echo "Running packer validate for $region..."
185+
packer validate --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
186+
echo "Building AMI image for $region..."
187+
packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
188+
done
189+
env:
190+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
191+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
192+
171193
- name: Build RPM package
172194
if: matrix.build == 'linux'
173195
uses: bpicode/github-action-fpm@master

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
branches:
66
- main
77
- dev
8+
- 'release/**'
89
paths-ignore:
910
- "*.md"
1011
- "LICENSE"
1112
pull_request:
1213
branches:
1314
- main
1415
- dev
16+
- 'release/**'
1517
paths-ignore:
1618
- "*.md"
1719
- "LICENSE"
@@ -21,8 +23,9 @@ env:
2123

2224
jobs:
2325
test:
24-
runs-on: [self-hosted, Linux, X64]
25-
container: rust:1
26+
runs-on:
27+
- codebuild-defguard-proxy-runner-${{ github.run_id }}-${{ github.run_attempt }}
28+
container: public.ecr.aws/docker/library/rust:1
2629

2730
steps:
2831
- name: Debug
@@ -44,6 +47,8 @@ jobs:
4447
rustup component add clippy
4548
cargo clippy --all-targets --all-features -- -D warnings
4649
- name: Run cargo deny
47-
uses: EmbarkStudios/cargo-deny-action@v2
50+
run: |
51+
cargo install cargo-deny
52+
cargo deny check
4853
- name: Run tests
4954
run: cargo test --locked --no-fail-fast

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.direnv/
55
.envrc
66
/node_modules
7+
.env

0 commit comments

Comments
 (0)