Skip to content

Commit 4007fa6

Browse files
authored
build(netifyd): upgrade to v5 (#1290)
1 parent a156059 commit 4007fa6

Some content is hidden

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

66 files changed

+9963
-1323
lines changed

.github/workflows/build-image.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
env:
3636
USIGN_PUB_KEY: ${{ secrets.USIGN_PUB_KEY }}
3737
USIGN_PRIV_KEY: ${{ secrets.USIGN_PRIV_KEY }}
38-
NETIFYD_ACCESS_TOKEN: ${{ secrets.NETIFYD_ACCESS_TOKEN }}
3938
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4039
GH_REPO: ${{ github.repository }}
4140
steps:
@@ -52,13 +51,6 @@ jobs:
5251
# export NETHSECURITY_VERSION from build
5352
echo "NETHSECURITY_VERSION=$(grep -oP 'NETHSECURITY_VERSION=\K.*' build.conf.example)" >> $GITHUB_OUTPUT
5453
55-
# if NETIFYD_ACCESS_TOKEN is set, set NETIFYD_ENABLED to 1
56-
if [[ -n "${{ env.NETIFYD_ACCESS_TOKEN }}" ]]; then
57-
echo "NETIFYD_ENABLED=1" >> $GITHUB_OUTPUT
58-
else
59-
echo "NETIFYD_ENABLED=0" >> $GITHUB_OUTPUT
60-
fi
61-
6254
# When pushing a tag, set REPO_CHANNEL to stable
6355
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
6456
echo "REPO_CHANNEL=stable" >> $GITHUB_OUTPUT
@@ -82,7 +74,6 @@ jobs:
8274
OWRT_VERSION: ${{ steps.build_vars.outputs.OWRT_VERSION }}
8375
NETHSECURITY_VERSION: ${{ steps.build_vars.outputs.NETHSECURITY_VERSION }}
8476
REPO_CHANNEL: ${{ steps.build_vars.outputs.REPO_CHANNEL }}
85-
NETIFYD_ENABLED: ${{ steps.build_vars.outputs.NETIFYD_ENABLED }}
8677
TARGET: ${{ steps.build_vars.outputs.TARGET }}
8778
run: ./build-nethsec.sh
8879
- name: Update latest_release file

build-nethsec.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ OWRT_VERSION=${OWRT_VERSION:?Missing OWRT_VERSION environment variable}
2020
NETHSECURITY_VERSION=${NETHSECURITY_VERSION:?Missing NETHSECURITY_VERSION environment variable}
2121
REPO_CHANNEL=${REPO_CHANNEL:-dev}
2222
TARGET=${TARGET:-x86_64}
23-
NETIFYD_ENABLED=${NETIFYD_ENABLED:-0}
24-
NETIFYD_ACCESS_TOKEN=${NETIFYD_ACCESS_TOKEN}
2523

2624
if [ -f "./key-build" ] && [ -f "./key-build.pub" ]; then
2725
USIGN_PRIV_KEY="$(cat ./key-build)"
@@ -40,7 +38,6 @@ podman build \
4038
--build-arg REPO_CHANNEL="$REPO_CHANNEL" \
4139
--build-arg TARGET="$TARGET" \
4240
--build-arg NETHSECURITY_VERSION="$NETHSECURITY_VERSION" \
43-
--build-arg NETIFYD_ENABLED="$NETIFYD_ENABLED" \
4441
.
4542

4643
set +e
@@ -49,8 +46,6 @@ status=0
4946
podman run \
5047
--env USIGN_PRIV_KEY="$USIGN_PRIV_KEY" \
5148
--env USIGN_PUB_KEY="$USIGN_PUB_KEY" \
52-
--env NETIFYD_ENABLED="$NETIFYD_ENABLED" \
53-
--env NETIFYD_ACCESS_TOKEN="$NETIFYD_ACCESS_TOKEN" \
5449
--name nethsecurity-builder \
5550
--interactive \
5651
--tty \

build.conf.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ OWRT_VERSION=v24.10.3
22
NETHSECURITY_VERSION=8.7.1
33
TARGET=x86_64
44
REPO_CHANNEL=dev
5-
NETIFYD_ENABLED=0
6-
NETIFYD_ACCESS_TOKEN=

builder/Containerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ ARG REPO_CHANNEL
6464
ARG TARGET
6565
ARG NETHSECURITY_VERSION
6666
COPY --chmod=777 builder/configure-build.sh /usr/local/bin/configure-build
67-
ARG NETIFYD_ENABLED=0
6867
RUN /usr/local/bin/configure-build
6968
COPY --chmod=777 builder/entrypoint.sh /usr/local/bin/entrypoint.sh
7069
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

builder/configure-build.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,6 @@ CONFIG_VERSION_SUPPORT_URL="https://community.nethserver.org"
3939
EOF
4040
cat "config/targets/${target}.conf" >> .config
4141

42-
# Netifyd closed-sources plugin
43-
if [ "$NETIFYD_ENABLED" -eq "0" ]; then
44-
echo "Netifyd closed-sources plugin not enabled: skipping ns-dpi package"
45-
echo CONFIG_PACKAGE_ns-dpi=n >> .config
46-
else
47-
echo "Netifyd closed-sources plugin enabled: enabling ns-dpi package"
48-
cat << EOF >> .config
49-
CONFIG_PACKAGE_netify-flow-actions=y
50-
CONFIG_NETIFY_FLOW_ACTIONS_TARGET_LOG=y
51-
CONFIG_NETIFY_FLOW_ACTIONS_TARGET_CTLABEL=y
52-
CONFIG_NETIFY_FLOW_ACTIONS_TARGET_NFTSET=y
53-
CONFIG_PACKAGE_netify-plugin-stats=y
54-
EOF
55-
fi
56-
5742
# Write version information into a file
5843
echo "${repo_channel}" > files/etc/repo-channel
5944

builder/entrypoint.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77

88
set -e
99

10-
if [ ! "$NETIFYD_ENABLED" -eq "0" ]; then
11-
echo "Netifyd is enabled, downloading sources..."
12-
git clone "https://oauth2:$NETIFYD_ACCESS_TOKEN@gitlab.com/netify.ai/private/nethesis/netify-flow-actions.git"
13-
git clone "https://oauth2:$NETIFYD_ACCESS_TOKEN@gitlab.com/netify.ai/private/nethesis/netify-agent-stats-plugin.git"
14-
fi
15-
1610
if [ -n "$USIGN_PUB_KEY" ] && [ -n "$USIGN_PRIV_KEY" ]; then
1711
echo "$USIGN_PUB_KEY" > /home/buildbot/openwrt/key-build.pub
1812
echo "$USIGN_PRIV_KEY" > /home/buildbot/openwrt/key-build

docs/build/index.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,17 @@ The `build-nethsec.sh` script behavior can be changed by giving the following en
7171
- `NETHSECURITY_VERSION`: specify what to call the NethSecurity image; **required**
7272
- `TARGET`: specify the target to build; if not set default is `x86_64`
7373
- `REPO_CHANNEL`: specify the channel to publish the image to; if not set default is `dev`
74-
- `NETIFYD_ENABLED`: configure if netifyd plugins should be downloaded and compiled; if not set, default is `0` (disabled)
75-
- `NETIFYD_ACCESS_TOKEN`: token to download the netifyd plugins; if not set, default is empty, required if `NETIFYD_ENABLED` is set to `1`
7674
- `USIGN_PUB_KEY` and `USIGN_PRIV_KEY`: see [package signing section](#package-signing)
7775
with the given keys
7876

79-
The `USIGN_PUB_KEY`, `USIGN_PRIV_KEY` and `NETIFYD_ACCESS_TOKEN` variables are always set as secrets
80-
inside the CI pipeline, but for [security reasons](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#accessing-secrets)
77+
The `USIGN_PUB_KEY`, `USIGN_PRIV_KEY` variables are always set as secrets inside the CI pipeline, but
78+
for [security reasons](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#accessing-secrets)
8179
they are not accessible when building pull requests from forks.
8280

8381
### Build locally for a release
8482

8583
If you need to build some packages locally for a release, make sure the following environment variables are set:
8684
- `USIGN_PUB_KEY` and `USIGN_PRIV_KEY`: refer to the [package signing section](#package-signing) for more info
87-
- `NETIFYD_ENABLED` and `NETIFYD_ACCESS_TOKEN`: required to download and compile netifyd closed source plugins
8885

8986
Then execute the build as described in the [Build locally](#build-locally) section.
9087

@@ -282,20 +279,6 @@ Or you can have the keys as two files named `key-build` and `key-build.pub` in t
282279

283280
Builds executed inside CI will sign the packages with the correct key.
284281

285-
### Netifyd plugins
286-
287-
NethSecurity uses two [netifyd](https://gitlab.com/netify.ai/public/netify-agent) proprietary plugins from [Netify](https://www.netify.ai/):
288-
289-
- Netify Flow Actions Plugin (netify-flow-actions)
290-
- Netify Agent Stats Plugin (netify-plugin-stats)
291-
292-
The plugins should be used with the latest netifyd stable version (4.4.3 at the time of writing).
293-
To create the files for the build, follow the steps below. Such steps should be needed only after a netifyd/plugin version change.
294-
295-
Both plugins source code is hosted on a private repository at [GitLab](https://gitlab.com).
296-
To access it, you must set `NETIFYD_ENABLED=1` and provide a personal access token with read access to the private repositories. And then `NETIFYD_ACCESS_TOKEN` environment variable must be set to the token value.
297-
298-
299282
## Self-hosted runner
300283

301284
The build system uses a GitHub-hosted runner to build the images.

packages/netify-flow-actions/Config.in

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

packages/netify-flow-actions/Makefile

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

0 commit comments

Comments
 (0)