Skip to content

Commit 1441bde

Browse files
authored
Merge pull request #1744 from DefGuard/release_1.6_merger
Merge release/1.6 -> main
2 parents 1596f3f + a9cf75c commit 1441bde

166 files changed

Lines changed: 6186 additions & 2259 deletions

File tree

Some content is hidden

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

.fpm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-s dir
22
--name defguard
3-
--description "defguard core service"
3+
--description "Defguard Core service"
44
--url "https://defguard.net/"
5-
--maintainer "teonite"
5+
--maintainer "Defguard"
6+
--config-files /etc/defguard/core.conf

.github/workflows/release.yml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464

6565
build-binaries:
6666
needs: [create-release]
67-
6867
runs-on:
6968
- self-hosted
7069
- Linux
@@ -108,7 +107,7 @@ jobs:
108107
- name: Install Rust stable
109108
uses: actions-rs/toolchain@v1
110109
with:
111-
toolchain: 1.89.0
110+
toolchain: 1.89.0 # "stable" causes rust-lld: error on aarch64-linux
112111
target: ${{ matrix.target }}
113112
override: true
114113

@@ -173,26 +172,6 @@ jobs:
173172
fpm_args: "defguard-${{ github.ref_name }}-${{ matrix.target }}=/usr/bin/defguard defguard.service=/usr/lib/systemd/system/defguard.service .env-template=/etc/defguard/core.conf"
174173
fpm_opts: "--architecture ${{ matrix.arch }} --debug --output-type deb --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}-${{ matrix.target }}.deb"
175174

176-
- name: Run `packer init`
177-
if: matrix.build == 'linux' && matrix.arch == 'amd64'
178-
id: init
179-
run: "packer init ./images/ami/core.pkr.hcl"
180-
181-
- name: Build AMI images for multiple regions
182-
if: matrix.build == 'linux' && matrix.arch == 'amd64'
183-
run: |
184-
regions=(us-east-1 eu-west-1 ap-northeast-1 eu-central-1)
185-
for region in "${regions[@]}"; do
186-
echo "Building AMI for region: $region"
187-
echo "Running packer validate for $region..."
188-
packer validate --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/core.pkr.hcl
189-
echo "Building AMI image for $region..."
190-
packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/core.pkr.hcl
191-
done
192-
env:
193-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
194-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
195-
196175
- name: Upload DEB
197176
if: matrix.build == 'linux'
198177
uses: actions/upload-release-asset@v1.0.2
@@ -204,6 +183,20 @@ jobs:
204183
asset_name: defguard-${{ env.VERSION }}-${{ matrix.target }}.deb
205184
asset_content_type: application/octet-stream
206185

186+
- name: Install ruby with deb-s3
187+
if: matrix.build == 'linux'
188+
run: |
189+
sudo apt-get install -y ruby
190+
gem install deb-s3
191+
echo "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin" >> $GITHUB_PATH
192+
193+
- name: Upload DEB to apt repository
194+
if: matrix.build == 'linux'
195+
run: |
196+
COMPONENT=$([[ "${{ github.ref_name }}" == *"-"* ]] && echo "pre-release" || echo "release") # if tag contain "-" assume it's pre-release.
197+
198+
deb-s3 upload -l --bucket=apt.defguard.net --access-key-id=${{ secrets.AWS_ACCESS_KEY_APT }} --secret-access-key=${{ secrets.AWS_SECRET_KEY_APT }} --s3-region=eu-north-1 --no-fail-if-exists --codename=trixie --component="$COMPONENT" defguard-${{ env.VERSION }}-${{ matrix.target }}.deb
199+
207200
- name: Build RPM package
208201
if: matrix.build == 'linux'
209202
uses: defGuard/fpm-action@main
@@ -227,7 +220,7 @@ jobs:
227220
uses: defGuard/fpm-action@main
228221
with:
229222
fpm_args: "defguard-${{ github.ref_name }}-${{ matrix.target }}=/usr/local/bin/defguard defguard.service.freebsd=/usr/local/etc/rc.d/defguard"
230-
fpm_opts: "--architecture ${{ matrix.arch }} --debug --output-type freebsd --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}_${{ matrix.target }}.pkg --freebsd-osversion '*'"
223+
fpm_opts: "--architecture ${{ matrix.arch }} --debug --output-type freebsd --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}_${{ matrix.target }}.pkg --freebsd-osversion '*' --depends openssl"
231224

232225
- name: Upload FreeBSD
233226
if: matrix.build == 'freebsd'
@@ -239,3 +232,37 @@ jobs:
239232
asset_path: defguard-${{ env.VERSION }}_${{ matrix.target }}.pkg
240233
asset_name: defguard-${{ env.VERSION }}_${{ matrix.target }}.pkg
241234
asset_content_type: application/octet-stream
235+
236+
apt-sign:
237+
needs:
238+
- build-binaries
239+
runs-on:
240+
- self-hosted
241+
- Linux
242+
- X64
243+
steps:
244+
- name: Sign APT repository
245+
run: |
246+
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_APT }}
247+
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_KEY_APT }}
248+
export AWS_REGION=eu-north-1
249+
sudo apt update -y
250+
sudo apt install -y awscli curl jq
251+
252+
for DIST in trixie; do
253+
aws s3 cp s3://apt.defguard.net/dists/${DIST}/Release .
254+
255+
curl -X POST "${{ secrets.DEFGUARD_SIGNING_URL }}?signature_type=both" \
256+
-H "Authorization: Bearer ${{ secrets.DEFGUARD_SIGNING_API_KEY }}" \
257+
-F "file=@Release" \
258+
-o response.json
259+
260+
cat response.json | jq -r '.files["Release.gpg"].content' | base64 --decode > Release.gpg
261+
cat response.json | jq -r '.files.Release.content' | base64 --decode > InRelease
262+
263+
aws s3 cp Release.gpg s3://apt.defguard.net/dists/${DIST}/ --acl public-read
264+
aws s3 cp InRelease s3://apt.defguard.net/dists/${DIST}/ --acl public-read
265+
266+
done
267+
(aws s3 ls s3://apt.defguard.net/dists/ --recursive; aws s3 ls s3://apt.defguard.net/pool/ --recursive) | awk '{print "<a href=\""$4"\">"$4"</a><br>"}' > index.html
268+
aws s3 cp index.html s3://apt.defguard.net/ --acl public-read

.github/workflows/test-web.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- dev
6+
- "release/**"
7+
paths-ignore:
8+
- "*.md"
9+
- "LICENSE"
10+
pull_request:
11+
branches:
12+
- main
13+
- dev
14+
- "release/**"
15+
paths-ignore:
16+
- "*.md"
17+
- "LICENSE"
18+
19+
permissions:
20+
contents: read
21+
jobs:
22+
test-web:
23+
runs-on:
24+
- codebuild-defguard-core-runner-${{ github.run_id }}-${{ github.run_attempt }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
submodules: "recursive"
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 24
32+
- name: install deps
33+
working-directory: ./web
34+
run: |
35+
npm i -g npm pnpm
36+
pnpm i --frozen-lockfile
37+
- name: Run tests
38+
working-directory: ./web
39+
run: pnpm run test

.sqlx/query-5350e57595e044cea6976a73910210e5106af580e45647ae620850de0b77785b.json renamed to .sqlx/query-03710e2a3e96096e57f95a62543174a42e3447f9d2a949b6820e685ddab6561d.json

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

.sqlx/query-0fb053b3b00a1fe78f764d2d1d90375d5674fd59fe3018af120ae2ef5fd10f48.json renamed to .sqlx/query-0c237b235f0455c5f79f2ea4e8210b1ea9e8149f3bb760d2039b463ef262eb03.json

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

.sqlx/query-08dfc889eda4765110276bfa2f660c2db2a35045a66fff8d25aa3e5763733529.json renamed to .sqlx/query-11c5c9eaade29091b93d5d3e2fca6bea01b09ec20e7ff70e626488191509bcf4.json

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

.sqlx/query-9f98a138560451105b104fc7a4d3d29e22e58f33e902c06bbf6163ee48ae802a.json renamed to .sqlx/query-14302b1c6c7d72d6e6f38c80538040b9fa3479c919f1ace2a787470690be9de3.json

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

.sqlx/query-160d23b882d0465fbc8c5453b7dba68521649ba86985d45049487ae50d7dfde8.json

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

.sqlx/query-283e1c3d082f1388fc2b806bdcab715db1c1df67da573b0f132fea265e42b416.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)