Skip to content

Commit e01bb69

Browse files
authored
Merge pull request #158 from DefGuard/release/1.5-alpha
Merge release/1.5-alpha into main
2 parents 002a4db + 56e7204 commit e01bb69

File tree

235 files changed

+5528
-4490
lines changed

Some content is hidden

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

235 files changed

+5528
-4490
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/[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"
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/[email protected]
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: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,32 @@ 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
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:
24-
node-version: 20
33+
node-version: 24
2534
- name: install deps
2635
working-directory: ./web
2736
run: |

.github/workflows/release.yml

Lines changed: 24 additions & 0 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:
@@ -168,6 +172,26 @@ jobs:
168172
asset_name: defguard-proxy-${{ env.VERSION }}-${{ matrix.target }}.deb
169173
asset_content_type: application/octet-stream
170174

175+
- name: Run `packer init`
176+
if: matrix.build == 'linux' && matrix.arch == 'amd64'
177+
id: init
178+
run: "packer init ./images/ami/proxy.pkr.hcl"
179+
180+
- name: Build AMI images for multiple regions
181+
if: matrix.build == 'linux' && matrix.arch == 'amd64'
182+
run: |
183+
regions=(us-east-1 eu-west-1 ap-northeast-1 eu-central-1)
184+
for region in "${regions[@]}"; do
185+
echo "Building AMI for region: $region"
186+
echo "Running packer validate for $region..."
187+
packer validate --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
188+
echo "Building AMI image for $region..."
189+
packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
190+
done
191+
env:
192+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
193+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
194+
171195
- name: Build RPM package
172196
if: matrix.build == 'linux'
173197
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
/target
22
/.idea
33
/*.local
4+
.direnv/
5+
.envrc
6+
/node_modules
7+
.env

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "proto"]
22
path = proto
33
url = ../proto.git
4+
[submodule "web/src/shared/defguard-ui"]
5+
path = web/src/shared/defguard-ui
6+
url = [email protected]:DefGuard/ui.git

0 commit comments

Comments
 (0)