Compare commits
25 Commits
tech/updat
...
v24.10.2_R
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2c1dbf7d5 | ||
|
|
caf1df999a | ||
|
|
6210c73b30 | ||
|
|
ded94df0c1 | ||
|
|
e6a3cbc9e8 | ||
|
|
d9d002aab3 | ||
|
|
e4d1486760 | ||
|
|
8032870129 | ||
|
|
2b72867ef1 | ||
|
|
7d68c0754d | ||
|
|
2b90e70f4e | ||
|
|
ac697888ac | ||
|
|
fb008b93c8 | ||
|
|
1607241233 | ||
|
|
09256b1cc5 | ||
|
|
2c4fe317b3 | ||
|
|
676c821362 | ||
|
|
aa17c7a25c | ||
|
|
46f0cba90b | ||
|
|
ad4c3e27c0 | ||
|
|
d64ea7b53e | ||
|
|
e075dcb43f | ||
|
|
449988b8e6 | ||
|
|
9591ffdebe | ||
|
|
3498354348 |
118
.drone.yml
Normal file
118
.drone.yml
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: awg-openwrt-full-build
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
host:
|
||||||
|
path: /cache
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: debian:12
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
path: /cache
|
||||||
|
environment:
|
||||||
|
OPENWRT_GIT_REF: "v24.10.2"
|
||||||
|
OPENWRT_TARGET: "rockchip"
|
||||||
|
OPENWRT_SUBTARGET: "armv8"
|
||||||
|
OPENWRT_ARCH: "aarch64_generic"
|
||||||
|
OPENWRT_KERNEL_DEP: "kernel (=6.6.93~0d90324e4fb76fa1183dcb1f1b600b7a-r1)"
|
||||||
|
commands:
|
||||||
|
- apt-get update
|
||||||
|
- |
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
|
build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \
|
||||||
|
gettext git libncurses-dev libssl-dev python3 python3-dev python3-setuptools \
|
||||||
|
python3-distutils python3-pyelftools rsync swig unzip zlib1g-dev file wget \
|
||||||
|
curl xz-utils zstd subversion patch tar cpio jq ca-certificates
|
||||||
|
|
||||||
|
- echo "DRONE_TAG=$DRONE_TAG"
|
||||||
|
- echo "OPENWRT_GIT_REF=$OPENWRT_GIT_REF"
|
||||||
|
- echo "OPENWRT_TARGET=$OPENWRT_TARGET"
|
||||||
|
- echo "OPENWRT_SUBTARGET=$OPENWRT_SUBTARGET"
|
||||||
|
- echo "OPENWRT_ARCH=$OPENWRT_ARCH"
|
||||||
|
- echo "OPENWRT_KERNEL_DEP=$OPENWRT_KERNEL_DEP"
|
||||||
|
|
||||||
|
- rm -rf /work
|
||||||
|
- mkdir -p /work
|
||||||
|
- cd /work
|
||||||
|
- git clone --depth 1 --branch "$OPENWRT_GIT_REF" https://github.com/openwrt/openwrt.git
|
||||||
|
- cd /work/openwrt
|
||||||
|
|
||||||
|
- ./scripts/feeds update -a
|
||||||
|
- ./scripts/feeds install -a
|
||||||
|
|
||||||
|
- rm -rf package/kmod-amneziawg package/amneziawg-tools package/luci-proto-amneziawg
|
||||||
|
- cp -r "$DRONE_WORKSPACE/kmod-amneziawg" package/
|
||||||
|
- cp -r "$DRONE_WORKSPACE/amneziawg-tools" package/
|
||||||
|
- cp -r "$DRONE_WORKSPACE/luci-proto-amneziawg" package/
|
||||||
|
|
||||||
|
- |
|
||||||
|
cat > .config <<'EOF'
|
||||||
|
CONFIG_TARGET_rockchip=y
|
||||||
|
CONFIG_TARGET_rockchip_armv8=y
|
||||||
|
CONFIG_PACKAGE_kmod-amneziawg=m
|
||||||
|
CONFIG_PACKAGE_amneziawg-tools=y
|
||||||
|
CONFIG_PACKAGE_luci-proto-amneziawg=y
|
||||||
|
CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- make defconfig
|
||||||
|
- make download -j"$(nproc)" || make download -j1 V=s
|
||||||
|
|
||||||
|
- make package/kmod-amneziawg/compile -j"$(nproc)" V=s
|
||||||
|
- make package/amneziawg-tools/compile -j"$(nproc)" V=s
|
||||||
|
- make package/luci-proto-amneziawg/compile -j"$(nproc)" V=s
|
||||||
|
- make package/luci-i18n-amneziawg-ru/compile -j"$(nproc)" V=s || true
|
||||||
|
|
||||||
|
- rm -rf "$DRONE_WORKSPACE/awgrelease"
|
||||||
|
- mkdir -p "$DRONE_WORKSPACE/awgrelease"
|
||||||
|
- mkdir -p "/cache/awg-openwrt/$DRONE_TAG"
|
||||||
|
- find "/cache/awg-openwrt/$DRONE_TAG" -type f -delete || true
|
||||||
|
|
||||||
|
- KMOD_FILE=$(find bin/targets -type f -name 'kmod-amneziawg*.ipk' | sort | tail -n1)
|
||||||
|
- TOOLS_FILE=$(find bin/packages -type f -name 'amneziawg-tools*.ipk' | sort | tail -n1)
|
||||||
|
- LUCI_FILE=$(find bin/packages -type f -name 'luci-proto-amneziawg*.ipk' | sort | tail -n1)
|
||||||
|
- I18N_FILE=$(find bin/packages -type f -name 'luci-i18n-amneziawg-ru*.ipk' | sort | tail -n1 || true)
|
||||||
|
|
||||||
|
- test -n "$KMOD_FILE"
|
||||||
|
- test -n "$TOOLS_FILE"
|
||||||
|
- test -n "$LUCI_FILE"
|
||||||
|
|
||||||
|
- cp "$KMOD_FILE" "$DRONE_WORKSPACE/awgrelease/"
|
||||||
|
- cp "$TOOLS_FILE" "$DRONE_WORKSPACE/awgrelease/"
|
||||||
|
- cp "$LUCI_FILE" "$DRONE_WORKSPACE/awgrelease/"
|
||||||
|
- if [ -n "$I18N_FILE" ]; then cp "$I18N_FILE" "$DRONE_WORKSPACE/awgrelease/"; fi
|
||||||
|
|
||||||
|
- rm -rf /tmp/kmodcheck
|
||||||
|
- mkdir -p /tmp/kmodcheck/pkg /tmp/kmodcheck/control
|
||||||
|
- tar -xzf "$KMOD_FILE" -C /tmp/kmodcheck/pkg
|
||||||
|
- tar -xzf /tmp/kmodcheck/pkg/control.tar.gz -C /tmp/kmodcheck/control
|
||||||
|
- echo "===== kmod control ====="
|
||||||
|
- cat /tmp/kmodcheck/control/control
|
||||||
|
- grep -F "$OPENWRT_KERNEL_DEP" /tmp/kmodcheck/control/control
|
||||||
|
|
||||||
|
- ls -lah "$DRONE_WORKSPACE/awgrelease"
|
||||||
|
- cp -a "$DRONE_WORKSPACE/awgrelease/." "/cache/awg-openwrt/$DRONE_TAG/"
|
||||||
|
- ls -lah "/cache/awg-openwrt/$DRONE_TAG/"
|
||||||
|
|
||||||
|
- name: publish-release
|
||||||
|
image: plugins/gitea-release
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
path: /cache
|
||||||
|
settings:
|
||||||
|
base_url: https://git.mzavitaev.ru
|
||||||
|
api_key:
|
||||||
|
from_secret: gitea_token
|
||||||
|
files:
|
||||||
|
- /cache/awg-openwrt/${DRONE_TAG}/*.ipk
|
||||||
|
checksum: sha256
|
||||||
|
file_exists: overwrite
|
||||||
|
title: AWG for OpenWrt 24.10.2
|
||||||
45
.github/workflows/build-module.yml
vendored
45
.github/workflows/build-module.yml
vendored
@@ -12,18 +12,19 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'OpenWRT version (e.g., 24.10.3)'
|
description: 'OpenWRT version (e.g., 24.10.5)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
targets:
|
targets:
|
||||||
description: 'Targets (comma-separated, e.g., "stm32,ramips")'
|
description: 'Targets (comma-separated, optional)'
|
||||||
required: true
|
required: false
|
||||||
type: string
|
type: string
|
||||||
subtargets:
|
subtargets:
|
||||||
description: 'Subtargets (comma-separated, e.g., "stm32mp1,mt7621")'
|
description: 'Subtargets (comma-separated, optional)'
|
||||||
required: true
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-config:
|
generate-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -38,16 +39,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '20.16.0'
|
node-version: '20.16.0'
|
||||||
|
|
||||||
- name: Get OpenWRT version from tag
|
- name: Get OpenWRT version from inputs or tag
|
||||||
id: get_version
|
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||||
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
|
|
||||||
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
|
if [ -n "${{ inputs.targets }}" ]; then
|
||||||
elif [ "${{ github.event_name }}" == "workflow_call" ]; then
|
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
|
||||||
VERSION="${{ inputs.tag_name }}"
|
fi
|
||||||
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
|
|
||||||
|
if [ -n "${{ inputs.subtargets }}" ]; then
|
||||||
|
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "${{ github.event_name }}" = "workflow_call" ]; then
|
||||||
|
echo "VERSION=${{ inputs.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
@@ -174,7 +181,7 @@ jobs:
|
|||||||
make package/amneziawg-tools/compile V=s
|
make package/amneziawg-tools/compile V=s
|
||||||
|
|
||||||
echo "Build completed. Checking for built packages..."
|
echo "Build completed. Checking for built packages..."
|
||||||
find bin/ -name "*.ipk" | grep -E "(amneziawg|luci-proto-amneziawg|luci-i18n-amneziawg)" | head -10
|
find bin/ -name "*.?pk" | grep -E "(amneziawg|luci-proto-amneziawg|luci-i18n-amneziawg)" | head -10
|
||||||
|
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
run: |
|
run: |
|
||||||
@@ -185,10 +192,10 @@ jobs:
|
|||||||
postfix="v${{ matrix.build_env.tag }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
|
postfix="v${{ matrix.build_env.tag }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
|
||||||
|
|
||||||
# Copy built packages
|
# Copy built packages
|
||||||
find "$SDK_DIR/bin/packages" -name "amneziawg-tools_*.ipk" -exec cp {} awgrelease/amneziawg-tools_${postfix}.ipk \; || echo "amneziawg-tools package not found"
|
find "$SDK_DIR/bin/packages" -name "amneziawg-tools*.?pk" -exec sh -c 'file="$1"; postfix="$2"; ext="${file##*.}"; cp "$file" "awgrelease/amneziawg-tools_${postfix}.${ext}"' _ {} "${postfix}" \; || echo "amneziawg-tools package not found"
|
||||||
find "$SDK_DIR/bin/packages" -name "luci-proto-amneziawg_*.ipk" -exec cp {} awgrelease/luci-proto-amneziawg_${postfix}.ipk \; || echo "luci-proto-amneziawg package not found"
|
find "$SDK_DIR/bin/packages" -name "luci-proto-amneziawg*.?pk" -exec sh -c 'file="$1"; postfix="$2"; ext="${file##*.}"; cp "$file" "awgrelease/luci-proto-amneziawg_${postfix}.${ext}"' _ {} "${postfix}" \; || echo "luci-proto-amneziawg package not found"
|
||||||
find "$SDK_DIR/bin/packages" -name "luci-i18n-amneziawg-ru_*.ipk" -exec cp {} awgrelease/luci-i18n-amneziawg-ru_${postfix}.ipk \; || echo "luci-i18n-amneziawg-ru package not found"
|
find "$SDK_DIR/bin/packages" -name "luci-i18n-amneziawg-ru*.?pk" -exec sh -c 'file="$1"; postfix="$2"; ext="${file##*.}"; cp "$file" "awgrelease/luci-i18n-amneziawg-ru_${postfix}.${ext}"' _ {} "${postfix}" \; || echo "luci-i18n-amneziawg-ru package not found"
|
||||||
find "$SDK_DIR/bin/targets" -name "kmod-amneziawg_*.ipk" -exec cp {} awgrelease/kmod-amneziawg_${postfix}.ipk \; || echo "kmod-amneziawg package not found"
|
find "$SDK_DIR/bin/targets" -name "kmod-amneziawg*.?pk" -exec sh -c 'file="$1"; postfix="$2"; ext="${file##*.}"; cp "$file" "awgrelease/kmod-amneziawg_${postfix}.${ext}"' _ {} "${postfix}" \; || echo "kmod-amneziawg package not found"
|
||||||
|
|
||||||
echo "Built packages:"
|
echo "Built packages:"
|
||||||
ls -la awgrelease/
|
ls -la awgrelease/
|
||||||
@@ -196,5 +203,5 @@ jobs:
|
|||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: awgrelease/*.ipk
|
files: awgrelease/*.?pk
|
||||||
tag_name: v${{ matrix.build_env.tag }}
|
tag_name: v${{ matrix.build_env.tag }}
|
||||||
|
|||||||
66
.github/workflows/run-release.yml
vendored
66
.github/workflows/run-release.yml
vendored
@@ -1,66 +0,0 @@
|
|||||||
name: Sync OpenWRT Releases
|
|
||||||
|
|
||||||
on:
|
|
||||||
# schedule:
|
|
||||||
# - cron: '0 0 */3 * *' # Проверка новых релизов раз в три дня
|
|
||||||
# workflow_dispatch: # Возможность вручную запустить Action
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync-releases:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
release_exists: ${{ steps.check_release.outputs.release_exists }}
|
|
||||||
release_tag: ${{ steps.get_release.outputs.release_tag }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout your repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get the latest release from OpenWRT
|
|
||||||
id: get_release
|
|
||||||
run: |
|
|
||||||
curl -s https://api.github.com/repos/openwrt/openwrt/releases/latest > latest_release.json
|
|
||||||
RELEASE_TAG=$(jq -r .tag_name latest_release.json)
|
|
||||||
RELEASE_NAME=$(jq -r .name latest_release.json)
|
|
||||||
echo "::set-output name=release_tag::$RELEASE_TAG"
|
|
||||||
echo "::set-output name=release_name::$RELEASE_NAME"
|
|
||||||
|
|
||||||
- name: Check if release exists in your repo
|
|
||||||
id: check_release
|
|
||||||
run: |
|
|
||||||
RELEASE_EXISTS=$(curl -s https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases/tags/${{ steps.get_release.outputs.release_tag }} | jq -r .tag_name)
|
|
||||||
if [ "$RELEASE_EXISTS" == "null" ]; then
|
|
||||||
echo "::set-output name=release_exists::false"
|
|
||||||
else
|
|
||||||
echo "::set-output name=release_exists::true"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create release in your repo
|
|
||||||
if: steps.check_release.outputs.release_exists == 'false'
|
|
||||||
run: |
|
|
||||||
ART="
|
|
||||||
\`\`\`
|
|
||||||
_______ ________ __
|
|
||||||
| |.-----.-----.-----.| | | |.----.| |_
|
|
||||||
| - || _ | -__| || | | || _|| _|
|
|
||||||
|_______|| __|_____|__|__||________||__| |____|
|
|
||||||
|__| A M N E Z I A W I R E G U A R D
|
|
||||||
-----------------------------------------------------
|
|
||||||
OpenWrt ${{ steps.get_release.outputs.release_tag }}
|
|
||||||
-----------------------------------------------------
|
|
||||||
\`\`\`"
|
|
||||||
|
|
||||||
curl -X POST https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases \
|
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$(jq -n --arg tag "${{ steps.get_release.outputs.release_tag }}" \
|
|
||||||
--arg name "Build amnezia wg for all devices with openwrt ${{ steps.get_release.outputs.release_tag }}" \
|
|
||||||
--arg body "$ART" \
|
|
||||||
'{ tag_name: $tag, name: $name, body: $body }')"
|
|
||||||
|
|
||||||
run-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: sync-releases
|
|
||||||
if: needs.sync-releases.outputs.release_exists == 'false'
|
|
||||||
uses: Slava-Shchipunov/awg-openwrt/.github/workflows/build-module.yml@master
|
|
||||||
with:
|
|
||||||
tag_name: ${{ needs.sync-releases.outputs.release_tag }}
|
|
||||||
27
README.md
27
README.md
@@ -23,17 +23,19 @@ sh <(wget -O - https://raw.githubusercontent.com/Slava-Shchipunov/awg-openwrt/re
|
|||||||
5) [23.05.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.4)
|
5) [23.05.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.4)
|
||||||
6) [23.05.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.5)
|
6) [23.05.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.5)
|
||||||
7) AWG-2.0 [23.05.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.6)
|
7) AWG-2.0 [23.05.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.6)
|
||||||
8) [24.10.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.0)
|
8) [24.10.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.0) ([AWG-2.0 для 24.10.0](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.0) из форка, если кому-то понадобится)
|
||||||
9) [24.10.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.1)
|
9) [24.10.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.1) ([AWG-2.0 для 24.10.1](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.1) из форка)
|
||||||
10) [24.10.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.2)
|
10) [24.10.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.2) ([AWG-2.0 для 24.10.2](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.2) из форка)
|
||||||
11) AWG-2.0 [24.10.3](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.3)
|
11) AWG-2.0 [24.10.3](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.3)
|
||||||
12) AWG-2.0 [24.10.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.4)
|
12) AWG-2.0 [24.10.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.4)
|
||||||
13) AWG-2.0 [24.10.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.5)
|
13) AWG-2.0 [24.10.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.5)
|
||||||
|
14) AWG-2.0 [24.10.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.6)
|
||||||
|
15) AWG-2.0 [25.12.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.0)
|
||||||
|
16) AWG-2.0 [25.12.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.1)
|
||||||
|
17) AWG-2.0 [25.12.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.2)
|
||||||
|
|
||||||
Также запускал сборку для версии [22.03.7](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v22.03.7), но там для двух платформ сборка завершилась ошибкой. Так как это достаточно старая версия OpenWRT, я не стал разбираться, в чем проблема.
|
Также запускал сборку для версии [22.03.7](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v22.03.7), но там для двух платформ сборка завершилась ошибкой. Так как это достаточно старая версия OpenWRT, я не стал разбираться, в чем проблема.
|
||||||
|
|
||||||
В дальнейшем при выходе новых релизов OpenWRT будут автоматически создаваться релизы с пакетами AmneziaWG и запускаться сборка пакетов под все устройства, поддерживаемые новой версией. Github action для проверки появления нового релиза запускается автоматически раз в 3 дня, а также может быть запущен вручную.
|
|
||||||
|
|
||||||
## Выбор пакетов для своего устройства
|
## Выбор пакетов для своего устройства
|
||||||
В соответствии с пунктом [Указываем переменные для сборки](https://github.com/itdoginfo/domain-routing-openwrt/wiki/Amnezia-WG-Build#%D1%83%D0%BA%D0%B0%D0%B7%D1%8B%D0%B2%D0%B0%D0%B5%D0%BC-%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B4%D0%BB%D1%8F-%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B8)
|
В соответствии с пунктом [Указываем переменные для сборки](https://github.com/itdoginfo/domain-routing-openwrt/wiki/Amnezia-WG-Build#%D1%83%D0%BA%D0%B0%D0%B7%D1%8B%D0%B2%D0%B0%D0%B5%D0%BC-%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B4%D0%BB%D1%8F-%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B8)
|
||||||
определить `target` и `subtarget` вашего устройства. Далее перейти на страницу релиза, соответствующего вашей версии OpenWRT, затем поиском по странице (Ctrl+F) найти 3 пакета, название которых оканчивается на `target_subtarget.ipk`, соответствующие вашему устройству. Для версии AWG 2.0 также доступен пакет русификации luci-i18n-amneziawg-ru
|
определить `target` и `subtarget` вашего устройства. Далее перейти на страницу релиза, соответствующего вашей версии OpenWRT, затем поиском по странице (Ctrl+F) найти 3 пакета, название которых оканчивается на `target_subtarget.ipk`, соответствующие вашему устройству. Для версии AWG 2.0 также доступен пакет русификации luci-i18n-amneziawg-ru
|
||||||
@@ -91,20 +93,19 @@ At the moment I have collected packages for all devices for OpenWRT versions:
|
|||||||
5) [23.05.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.4)
|
5) [23.05.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.4)
|
||||||
6) [23.05.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.5)
|
6) [23.05.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.5)
|
||||||
7) AWG-2.0 [23.05.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.6)
|
7) AWG-2.0 [23.05.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v23.05.6)
|
||||||
8) [24.10.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.0)
|
8) [24.10.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.0) ([AWG-2.0 for 24.10.0](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.0) from fork)
|
||||||
9) [24.10.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.1)
|
9) [24.10.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.1) ([AWG-2.0 for 24.10.1](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.1) from fork)
|
||||||
10) [24.10.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.2)
|
10) [24.10.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.2) ([AWG-2.0 for 24.10.2](https://github.com/yanjore/awg-openwrt/releases/tag/v24.10.2) from fork)
|
||||||
11) AWG-2.0 [24.10.3](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.3)
|
11) AWG-2.0 [24.10.3](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.3)
|
||||||
12) AWG-2.0 [24.10.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.4)
|
12) AWG-2.0 [24.10.4](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.4)
|
||||||
13) AWG-2.0 [24.10.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.5)
|
13) AWG-2.0 [24.10.5](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.5)
|
||||||
|
14) AWG-2.0 [24.10.6](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v24.10.6)
|
||||||
|
15) AWG-2.0 [25.12.0](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.0)
|
||||||
|
16) AWG-2.0 [25.12.1](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.1)
|
||||||
|
17) AWG-2.0 [25.12.2](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v25.12.2)
|
||||||
|
|
||||||
I also ran the build for version [22.03.7](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v22.03.7), but the build ended with an error for two platforms. Since this is a fairly old version of OpenWRT, I did not bother to figure out what the problem was.
|
I also ran the build for version [22.03.7](https://github.com/Slava-Shchipunov/awg-openwrt/releases/tag/v22.03.7), but the build ended with an error for two platforms. Since this is a fairly old version of OpenWRT, I did not bother to figure out what the problem was.
|
||||||
|
|
||||||
In the future, when new OpenWRT releases are released, releases with AmneziaWG packages will be automatically created and the package build will be launched for all devices supported by the new version. Github action for checking for a new release is launched automatically every 3 days, and can also be launched manually.
|
|
||||||
|
|
||||||
## Automatic package build for SNAPSHOT version
|
|
||||||
A github action is configured in the repository, which runs every 4 hours and checks the [snapshots page](https://downloads.openwrt.org/snapshots/targets/) of the OpenWRT website. At the same time, if a snapshot with a newer kernel version is found for some platform, the package build for this platform is launched, and the new files replace the old ones. In order to save resources and speed up the build process, packages are built only for popular platforms, which are specified in the `SNAPSHOT_SUBTARGETS_TO_BUILD` array in the index.js file.
|
|
||||||
|
|
||||||
## Selecting packages for your device
|
## Selecting packages for your device
|
||||||
In accordance with the paragraph [Specify variables for builds](https://github.com/itdoginfo/domain-routing-openwrt/wiki/Amnezia-WG-Build#%D1%83%D0%BA%D0%B0%D0%B7%D1%8B%D0%B2%D0%B0%D0%B5%D0%BC-%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B4%D0%BB%D1%8F-%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B8) (instructions in Russian) determine `target` and `subtarget` of your device. Then go to the release page corresponding to your OpenWRT version, then search the page (Ctrl+F) to find 3 packages whose names end in `target_subtarget.ipk` corresponding to your device. For AWG 2.0 version, Russian localization package luci-i18n-amneziawg-ru is also available
|
In accordance with the paragraph [Specify variables for builds](https://github.com/itdoginfo/domain-routing-openwrt/wiki/Amnezia-WG-Build#%D1%83%D0%BA%D0%B0%D0%B7%D1%8B%D0%B2%D0%B0%D0%B5%D0%BC-%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B4%D0%BB%D1%8F-%D1%81%D0%B1%D0%BE%D1%80%D0%BA%D0%B8) (instructions in Russian) determine `target` and `subtarget` of your device. Then go to the release page corresponding to your OpenWRT version, then search the page (Ctrl+F) to find 3 packages whose names end in `target_subtarget.ipk` corresponding to your device. For AWG 2.0 version, Russian localization package luci-i18n-amneziawg-ru is also available
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,127 @@
|
|||||||
|
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
|
PKG_MANAGER=""
|
||||||
|
PKG_EXT=""
|
||||||
|
|
||||||
|
detect_package_manager() {
|
||||||
|
if command -v apk >/dev/null 2>&1; then
|
||||||
|
PKG_MANAGER="apk"
|
||||||
|
PKG_EXT="apk"
|
||||||
|
elif command -v opkg >/dev/null 2>&1; then
|
||||||
|
PKG_MANAGER="opkg"
|
||||||
|
PKG_EXT="ipk"
|
||||||
|
else
|
||||||
|
printf "\033[32;1mNo supported package manager found (apk/opkg).\033[0m\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_update() {
|
||||||
|
if [ "$PKG_MANAGER" = "apk" ]; then
|
||||||
|
apk update
|
||||||
|
else
|
||||||
|
opkg update
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_pkg_installed() {
|
||||||
|
pkg_name="$1"
|
||||||
|
if [ "$PKG_MANAGER" = "apk" ]; then
|
||||||
|
apk info -e "$pkg_name" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
opkg list-installed 2>/dev/null | grep -q "^${pkg_name} "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_local_pkg() {
|
||||||
|
pkg_file="$1"
|
||||||
|
if [ "$PKG_MANAGER" = "apk" ]; then
|
||||||
|
apk add --allow-untrusted "$pkg_file"
|
||||||
|
else
|
||||||
|
opkg install "$pkg_file"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_pkgarch() {
|
||||||
|
PKGARCH_UBUS=$(ubus call system board 2>/dev/null | jsonfilter -e '@.release.arch' 2>/dev/null)
|
||||||
|
if [ -n "$PKGARCH_UBUS" ]; then
|
||||||
|
echo "$PKGARCH_UBUS"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v opkg >/dev/null 2>&1; then
|
||||||
|
opkg print-architecture | awk 'BEGIN {max=0} {if ($3 > max) {max = $3; arch = $2}} END {print arch}'
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/openwrt_release ]; then
|
||||||
|
PKGARCH_RELEASE=$(grep "^DISTRIB_ARCH='" /etc/openwrt_release | cut -d"'" -f2)
|
||||||
|
if [ -n "$PKGARCH_RELEASE" ]; then
|
||||||
|
echo "$PKGARCH_RELEASE"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v apk >/dev/null 2>&1; then
|
||||||
|
apk --print-arch
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
uname -m
|
||||||
|
}
|
||||||
|
|
||||||
|
download_package() {
|
||||||
|
pkg_base_name="$1"
|
||||||
|
pkg_postfix_base="$2"
|
||||||
|
awg_dir="$3"
|
||||||
|
base_url="$4"
|
||||||
|
|
||||||
|
preferred_file="${pkg_base_name}${pkg_postfix_base}.${PKG_EXT}"
|
||||||
|
preferred_url="${base_url}${preferred_file}"
|
||||||
|
if wget -q -O "$awg_dir/$preferred_file" "$preferred_url" && [ -s "$awg_dir/$preferred_file" ]; then
|
||||||
|
echo "$preferred_file"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
rm -f "$awg_dir/$preferred_file"
|
||||||
|
|
||||||
|
if [ "$PKG_EXT" = "apk" ]; then
|
||||||
|
fallback_ext="ipk"
|
||||||
|
else
|
||||||
|
fallback_ext="apk"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fallback_file="${pkg_base_name}${pkg_postfix_base}.${fallback_ext}"
|
||||||
|
fallback_url="${base_url}${fallback_file}"
|
||||||
|
if wget -q -O "$awg_dir/$fallback_file" "$fallback_url" && [ -s "$awg_dir/$fallback_file" ]; then
|
||||||
|
echo "$fallback_file"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
rm -f "$awg_dir/$fallback_file"
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
#Репозиторий OpenWRT должен быть доступен для установки зависимостей пакета kmod-amneziawg
|
#Репозиторий OpenWRT должен быть доступен для установки зависимостей пакета kmod-amneziawg
|
||||||
check_repo() {
|
check_repo() {
|
||||||
printf "\033[32;1mChecking OpenWrt repo availability...\033[0m\n"
|
printf "\033[32;1mChecking OpenWrt repo availability...\033[0m\n"
|
||||||
opkg update | grep -q "Failed to download" && printf "\033[32;1mopkg failed. Check internet or date. Command for force ntp sync: ntpd -p ptbtime1.ptb.de\033[0m\n" && exit 1
|
if [ "$PKG_MANAGER" = "apk" ]; then
|
||||||
|
pkg_update >/dev/null 2>&1 || \
|
||||||
|
{ printf "\033[32;1mapk failed. Check internet or date. Command for force ntp sync: ntpd -p ptbtime1.ptb.de\033[0m\n"; exit 1; }
|
||||||
|
else
|
||||||
|
pkg_update | grep -q "Failed to download" && \
|
||||||
|
printf "\033[32;1mopkg failed. Check internet or date. Command for force ntp sync: ntpd -p ptbtime1.ptb.de\033[0m\n" && exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_awg_packages() {
|
install_awg_packages() {
|
||||||
# Получение pkgarch с наибольшим приоритетом
|
# Получение pkgarch с наибольшим приоритетом
|
||||||
PKGARCH=$(opkg print-architecture | awk 'BEGIN {max=0} {if ($3 > max) {max = $3; arch = $2}} END {print arch}')
|
PKGARCH=$(get_pkgarch)
|
||||||
|
|
||||||
TARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 1)
|
TARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 1)
|
||||||
SUBTARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 2)
|
SUBTARGET=$(ubus call system board | jsonfilter -e '@.release.target' | cut -d '/' -f 2)
|
||||||
VERSION=$(ubus call system board | jsonfilter -e '@.release.version')
|
VERSION=$(ubus call system board | jsonfilter -e '@.release.version')
|
||||||
PKGPOSTFIX="_v${VERSION}_${PKGARCH}_${TARGET}_${SUBTARGET}.ipk"
|
PKGPOSTFIX_BASE="_v${VERSION}_${PKGARCH}_${TARGET}_${SUBTARGET}"
|
||||||
BASE_URL="https://github.com/Slava-Shchipunov/awg-openwrt/releases/download/"
|
BASE_URL="https://github.com/Slava-Shchipunov/awg-openwrt/releases/download/"
|
||||||
|
|
||||||
# Определяем версию AWG протокола (2.0 для OpenWRT >= 23.05.6 и >= 24.10.3)
|
# Определяем версию AWG протокола (2.0 для OpenWRT >= 23.05.6 и >= 24.10.3)
|
||||||
@@ -23,7 +130,7 @@ install_awg_packages() {
|
|||||||
MAJOR_VERSION=$(echo "$VERSION" | cut -d '.' -f 1)
|
MAJOR_VERSION=$(echo "$VERSION" | cut -d '.' -f 1)
|
||||||
MINOR_VERSION=$(echo "$VERSION" | cut -d '.' -f 2)
|
MINOR_VERSION=$(echo "$VERSION" | cut -d '.' -f 2)
|
||||||
PATCH_VERSION=$(echo "$VERSION" | cut -d '.' -f 3)
|
PATCH_VERSION=$(echo "$VERSION" | cut -d '.' -f 3)
|
||||||
|
|
||||||
if [ "$MAJOR_VERSION" -gt 24 ] || \
|
if [ "$MAJOR_VERSION" -gt 24 ] || \
|
||||||
[ "$MAJOR_VERSION" -eq 24 -a "$MINOR_VERSION" -gt 10 ] || \
|
[ "$MAJOR_VERSION" -eq 24 -a "$MINOR_VERSION" -gt 10 ] || \
|
||||||
[ "$MAJOR_VERSION" -eq 24 -a "$MINOR_VERSION" -eq 10 -a "$PATCH_VERSION" -ge 3 ] || \
|
[ "$MAJOR_VERSION" -eq 24 -a "$MINOR_VERSION" -eq 10 -a "$PATCH_VERSION" -ge 3 ] || \
|
||||||
@@ -38,22 +145,19 @@ install_awg_packages() {
|
|||||||
|
|
||||||
AWG_DIR="/tmp/amneziawg"
|
AWG_DIR="/tmp/amneziawg"
|
||||||
mkdir -p "$AWG_DIR"
|
mkdir -p "$AWG_DIR"
|
||||||
|
|
||||||
if opkg list-installed | grep -q kmod-amneziawg; then
|
if is_pkg_installed "kmod-amneziawg"; then
|
||||||
echo "kmod-amneziawg already installed"
|
echo "kmod-amneziawg already installed"
|
||||||
else
|
else
|
||||||
KMOD_AMNEZIAWG_FILENAME="kmod-amneziawg${PKGPOSTFIX}"
|
KMOD_AMNEZIAWG_FILENAME=$(download_package "kmod-amneziawg" "$PKGPOSTFIX_BASE" "$AWG_DIR" "${BASE_URL}v${VERSION}/")
|
||||||
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${KMOD_AMNEZIAWG_FILENAME}"
|
|
||||||
wget -O "$AWG_DIR/$KMOD_AMNEZIAWG_FILENAME" "$DOWNLOAD_URL"
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "kmod-amneziawg file downloaded successfully"
|
echo "kmod-amneziawg file downloaded successfully"
|
||||||
else
|
else
|
||||||
echo "Error downloading kmod-amneziawg. Please, install kmod-amneziawg manually and run the script again"
|
echo "Error downloading kmod-amneziawg. Please, install kmod-amneziawg manually and run the script again"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
opkg install "$AWG_DIR/$KMOD_AMNEZIAWG_FILENAME"
|
install_local_pkg "$AWG_DIR/$KMOD_AMNEZIAWG_FILENAME"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "kmod-amneziawg installed successfully"
|
echo "kmod-amneziawg installed successfully"
|
||||||
@@ -63,13 +167,10 @@ install_awg_packages() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if opkg list-installed | grep -q amneziawg-tools; then
|
if is_pkg_installed "amneziawg-tools"; then
|
||||||
echo "amneziawg-tools already installed"
|
echo "amneziawg-tools already installed"
|
||||||
else
|
else
|
||||||
AMNEZIAWG_TOOLS_FILENAME="amneziawg-tools${PKGPOSTFIX}"
|
AMNEZIAWG_TOOLS_FILENAME=$(download_package "amneziawg-tools" "$PKGPOSTFIX_BASE" "$AWG_DIR" "${BASE_URL}v${VERSION}/")
|
||||||
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${AMNEZIAWG_TOOLS_FILENAME}"
|
|
||||||
wget -O "$AWG_DIR/$AMNEZIAWG_TOOLS_FILENAME" "$DOWNLOAD_URL"
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "amneziawg-tools file downloaded successfully"
|
echo "amneziawg-tools file downloaded successfully"
|
||||||
else
|
else
|
||||||
@@ -77,7 +178,7 @@ install_awg_packages() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
opkg install "$AWG_DIR/$AMNEZIAWG_TOOLS_FILENAME"
|
install_local_pkg "$AWG_DIR/$AMNEZIAWG_TOOLS_FILENAME"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "amneziawg-tools installed successfully"
|
echo "amneziawg-tools installed successfully"
|
||||||
@@ -86,15 +187,12 @@ install_awg_packages() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Проверяем оба возможных названия пакета
|
# Проверяем оба возможных названия пакета
|
||||||
if opkg list-installed | grep -q "luci-proto-amneziawg\|luci-app-amneziawg"; then
|
if is_pkg_installed "luci-proto-amneziawg" || is_pkg_installed "luci-app-amneziawg"; then
|
||||||
echo "$LUCI_PACKAGE_NAME already installed"
|
echo "$LUCI_PACKAGE_NAME already installed"
|
||||||
else
|
else
|
||||||
LUCI_AMNEZIAWG_FILENAME="${LUCI_PACKAGE_NAME}${PKGPOSTFIX}"
|
LUCI_AMNEZIAWG_FILENAME=$(download_package "$LUCI_PACKAGE_NAME" "$PKGPOSTFIX_BASE" "$AWG_DIR" "${BASE_URL}v${VERSION}/")
|
||||||
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${LUCI_AMNEZIAWG_FILENAME}"
|
|
||||||
wget -O "$AWG_DIR/$LUCI_AMNEZIAWG_FILENAME" "$DOWNLOAD_URL"
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "$LUCI_PACKAGE_NAME file downloaded successfully"
|
echo "$LUCI_PACKAGE_NAME file downloaded successfully"
|
||||||
else
|
else
|
||||||
@@ -102,7 +200,7 @@ install_awg_packages() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
opkg install "$AWG_DIR/$LUCI_AMNEZIAWG_FILENAME"
|
install_local_pkg "$AWG_DIR/$LUCI_AMNEZIAWG_FILENAME"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "$LUCI_PACKAGE_NAME installed successfully"
|
echo "$LUCI_PACKAGE_NAME installed successfully"
|
||||||
@@ -119,16 +217,13 @@ install_awg_packages() {
|
|||||||
INSTALL_RU_LANG=${INSTALL_RU_LANG:-n}
|
INSTALL_RU_LANG=${INSTALL_RU_LANG:-n}
|
||||||
|
|
||||||
if [ "$INSTALL_RU_LANG" = "y" ] || [ "$INSTALL_RU_LANG" = "Y" ]; then
|
if [ "$INSTALL_RU_LANG" = "y" ] || [ "$INSTALL_RU_LANG" = "Y" ]; then
|
||||||
if opkg list-installed | grep -q luci-i18n-amneziawg-ru; then
|
if is_pkg_installed "luci-i18n-amneziawg-ru"; then
|
||||||
echo "luci-i18n-amneziawg-ru already installed"
|
echo "luci-i18n-amneziawg-ru already installed"
|
||||||
else
|
else
|
||||||
LUCI_I18N_AMNEZIAWG_RU_FILENAME="luci-i18n-amneziawg-ru${PKGPOSTFIX}"
|
LUCI_I18N_AMNEZIAWG_RU_FILENAME=$(download_package "luci-i18n-amneziawg-ru" "$PKGPOSTFIX_BASE" "$AWG_DIR" "${BASE_URL}v${VERSION}/")
|
||||||
DOWNLOAD_URL="${BASE_URL}v${VERSION}/${LUCI_I18N_AMNEZIAWG_RU_FILENAME}"
|
|
||||||
wget -O "$AWG_DIR/$LUCI_I18N_AMNEZIAWG_RU_FILENAME" "$DOWNLOAD_URL"
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "luci-i18n-amneziawg-ru file downloaded successfully"
|
echo "luci-i18n-amneziawg-ru file downloaded successfully"
|
||||||
opkg install "$AWG_DIR/$LUCI_I18N_AMNEZIAWG_RU_FILENAME"
|
install_local_pkg "$AWG_DIR/$LUCI_I18N_AMNEZIAWG_RU_FILENAME"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "luci-i18n-amneziawg-ru installed successfully"
|
echo "luci-i18n-amneziawg-ru installed successfully"
|
||||||
else
|
else
|
||||||
@@ -182,7 +277,7 @@ configure_amneziawg_interface() {
|
|||||||
read -r -p "Enter H2 value (from [Interface]):"$'\n' AWG_H2
|
read -r -p "Enter H2 value (from [Interface]):"$'\n' AWG_H2
|
||||||
read -r -p "Enter H3 value (from [Interface]):"$'\n' AWG_H3
|
read -r -p "Enter H3 value (from [Interface]):"$'\n' AWG_H3
|
||||||
read -r -p "Enter H4 value (from [Interface]):"$'\n' AWG_H4
|
read -r -p "Enter H4 value (from [Interface]):"$'\n' AWG_H4
|
||||||
|
|
||||||
# AWG 2.0 новые параметры
|
# AWG 2.0 новые параметры
|
||||||
if [ "$AWG_VERSION" = "2.0" ]; then
|
if [ "$AWG_VERSION" = "2.0" ]; then
|
||||||
read -r -p "Enter S3 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_S3
|
read -r -p "Enter S3 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_S3
|
||||||
@@ -193,7 +288,7 @@ configure_amneziawg_interface() {
|
|||||||
read -r -p "Enter I4 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_I4
|
read -r -p "Enter I4 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_I4
|
||||||
read -r -p "Enter I5 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_I5
|
read -r -p "Enter I5 value (from [Interface]) [optional, leave blank to skip]:"$'\n' AWG_I5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uci set network.${INTERFACE_NAME}=interface
|
uci set network.${INTERFACE_NAME}=interface
|
||||||
uci set network.${INTERFACE_NAME}.proto=$PROTO
|
uci set network.${INTERFACE_NAME}.proto=$PROTO
|
||||||
uci set network.${INTERFACE_NAME}.private_key=$AWG_PRIVATE_KEY_INT
|
uci set network.${INTERFACE_NAME}.private_key=$AWG_PRIVATE_KEY_INT
|
||||||
@@ -261,8 +356,11 @@ configure_amneziawg_interface() {
|
|||||||
uci set firewall.@forwarding[-1].family='ipv4'
|
uci set firewall.@forwarding[-1].family='ipv4'
|
||||||
uci commit firewall
|
uci commit firewall
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
service network restart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
detect_package_manager
|
||||||
check_repo
|
check_repo
|
||||||
|
|
||||||
install_awg_packages
|
install_awg_packages
|
||||||
@@ -275,5 +373,3 @@ if [ "$IS_SHOULD_CONFIGURE_AWG_INTERFACE" = "y" ] || [ "$IS_SHOULD_CONFIGURE_AWG
|
|||||||
else
|
else
|
||||||
printf "\033[32;1mSkipping amneziawg interface configuration.\033[0m\n"
|
printf "\033[32;1mSkipping amneziawg interface configuration.\033[0m\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
service network restart
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=amneziawg-tools
|
PKG_NAME:=amneziawg-tools
|
||||||
PKG_VERSION:=1.0.20250903
|
PKG_VERSION:=1.0.20260223
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|||||||
30
index.js
30
index.js
@@ -52,19 +52,27 @@ async function getSubtargets(target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getDetails(target, subtarget) {
|
async function getDetails(target, subtarget) {
|
||||||
const packagesUrl = `${url}${target}/${subtarget}/packages/`;
|
// pkgarch from packages/index.json
|
||||||
const $ = await fetchHTML(packagesUrl);
|
// for apk-based is required change (should work also for ipk-based)
|
||||||
let vermagic = '';
|
const indexUrl = `${url}${target}/${subtarget}/packages/index.json`;
|
||||||
let pkgarch = '';
|
let pkgarch = '';
|
||||||
|
try {
|
||||||
|
const { data } = await axios.get(indexUrl, { responseType: 'json' });
|
||||||
|
pkgarch = data.architecture || '';
|
||||||
|
} catch (e) {
|
||||||
|
// keep pkgarch empty
|
||||||
|
}
|
||||||
|
|
||||||
$('a').each((index, element) => {
|
// vermagic from kmods directory name (more reliable than parsing kernel filename)
|
||||||
const name = $(element).attr('href');
|
const kmodsUrl = `${url}${target}/${subtarget}/kmods/`;
|
||||||
if (name && name.startsWith('kernel_')) {
|
const $ = await fetchHTML(kmodsUrl);
|
||||||
const vermagicMatch = name.match(/kernel_\d+\.\d+\.\d+(?:-\d+)?[-~]([a-f0-9]+)(?:-r\d+)?_([a-zA-Z0-9_-]+)\.ipk$/);
|
let vermagic = '';
|
||||||
if (vermagicMatch) {
|
|
||||||
vermagic = vermagicMatch[1];
|
$('table tr td.n a').each((_, el) => {
|
||||||
pkgarch = vermagicMatch[2];
|
const name = $(el).attr('href');
|
||||||
}
|
if (name && name.endsWith('/')) {
|
||||||
|
vermagic = name.slice(0, -1);
|
||||||
|
return false; // break
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=kmod-amneziawg
|
PKG_NAME:=kmod-amneziawg
|
||||||
PKG_VERSION:=1.0.20251104
|
PKG_VERSION:=1.0.20260210
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|||||||
@@ -66,15 +66,31 @@ function generateDescription(name, texts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildSVGQRCode(data, code) {
|
function buildSVGQRCode(data, code) {
|
||||||
// pixel size larger than 4 clips right and bottom edges of complex configs
|
// pixel size 3 for mobile browser
|
||||||
const options = {
|
const options = {
|
||||||
pixelSize: 4,
|
pixelSize: 3,
|
||||||
whiteColor: 'white',
|
whiteColor: 'white',
|
||||||
blackColor: 'black'
|
blackColor: 'black'
|
||||||
};
|
};
|
||||||
const svg = uqr.renderSVG(data, options);
|
|
||||||
code.style.opacity = '';
|
try {
|
||||||
dom.content(code, Object.assign(E(svg), { style: 'width:100%;height:auto' }));
|
const svg = uqr.renderSVG(data, options);
|
||||||
|
code.style.opacity = '';
|
||||||
|
dom.content(code, Object.assign(E(svg), {
|
||||||
|
style: 'width:100%;height:auto'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.warn('QR generation failed:', e);
|
||||||
|
|
||||||
|
code.style.opacity = '';
|
||||||
|
dom.content(code, E('div', {
|
||||||
|
'class': 'alert-message warning',
|
||||||
|
'style': 'margin:0;text-align:center'
|
||||||
|
}, [
|
||||||
|
_('QR code generation failed. The configuration may be too large.')
|
||||||
|
]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var cbiKeyPairGenerate = form.DummyValue.extend({
|
var cbiKeyPairGenerate = form.DummyValue.extend({
|
||||||
@@ -934,7 +950,7 @@ return network.registerProtocol('amneziawg', {
|
|||||||
}, [
|
}, [
|
||||||
E('div', {
|
E('div', {
|
||||||
'class': 'qr-code',
|
'class': 'qr-code',
|
||||||
'style': 'width:320px;flex:0 1 320px;text-align:center'
|
'style': 'text-align:center'
|
||||||
}, [
|
}, [
|
||||||
E('em', { 'class': 'spinning' }, [ _('Generating QR code…') ])
|
E('em', { 'class': 'spinning' }, [ _('Generating QR code…') ])
|
||||||
]),
|
]),
|
||||||
|
|||||||
Reference in New Issue
Block a user