Compare commits
22 Commits
v70-202501
...
v70.202502
| Author | SHA1 | Date | |
|---|---|---|---|
| cded72542e | |||
| 31522f53d7 | |||
| 794f86a34c | |||
| 2529444929 | |||
| 8ef98e1bcd | |||
| 57cfc5af29 | |||
| 8e783c4bd6 | |||
| f7114167eb | |||
| adab5d93c5 | |||
| 41df444327 | |||
| c187d544e3 | |||
| c524434b43 | |||
| b73f7e93d6 | |||
| 4c224634c1 | |||
| 82fafaa6fe | |||
| 768ebb6241 | |||
| 0891e9d2fa | |||
| fbb1239606 | |||
| 88d82932c9 | |||
| d169c51a11 | |||
| 474baa09aa | |||
| b9621559c3 |
31
.github/FUNDING.yml
vendored
Normal file
31
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
github:
|
||||||
|
|
||||||
|
# Replace with a single Patreon username
|
||||||
|
patreon:
|
||||||
|
|
||||||
|
# Replace with a single Open Collective username
|
||||||
|
open_collective:
|
||||||
|
|
||||||
|
# Replace with a single Ko-fi username
|
||||||
|
ko_fi:
|
||||||
|
|
||||||
|
# Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
tidelift:
|
||||||
|
|
||||||
|
# Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
community_bridge:
|
||||||
|
|
||||||
|
# Replace with a single Liberapay username
|
||||||
|
liberapay:
|
||||||
|
|
||||||
|
# Replace with a single IssueHunt username
|
||||||
|
issuehunt:
|
||||||
|
|
||||||
|
# Replace with a single Otechie username
|
||||||
|
otechie:
|
||||||
|
|
||||||
|
# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
custom: ['https://github.com/remittor/donate']
|
||||||
207
.github/workflows/build.yml
vendored
207
.github/workflows/build.yml
vendored
@ -2,10 +2,48 @@ name: build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
test_build:
|
||||||
|
description: 'Test build'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
fake_build:
|
||||||
|
description: 'Fake build'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
max_speed:
|
||||||
|
description: 'Build with max speed'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- v[0-9]+*
|
- v[0-9]+*
|
||||||
|
|
||||||
|
env:
|
||||||
|
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
|
||||||
|
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
||||||
|
MAX_SPEED: ${{ github.event.inputs.max_speed != 'false' }}
|
||||||
|
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
||||||
|
REPO_URL: https://github.com/remittor/zapret-openwrt
|
||||||
|
REPO_LNK: remittor/zapret-openwrt
|
||||||
|
REPO_BRANCH: master
|
||||||
|
BUILD_ROOT: ${{ github.workspace }}/builder
|
||||||
|
BUILD_DATE: unknown
|
||||||
|
REPO_DATE: unknown
|
||||||
|
LUCI_ARCH: aarch64_cortex-a53
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -15,38 +53,45 @@ jobs:
|
|||||||
sha: ${{ steps.gh.outputs.sha }}
|
sha: ${{ steps.gh.outputs.sha }}
|
||||||
url: ${{ steps.gh.outputs.url }}
|
url: ${{ steps.gh.outputs.url }}
|
||||||
message: ${{ steps.gh.outputs.message }}
|
message: ${{ steps.gh.outputs.message }}
|
||||||
|
build_date: ${{ steps.gh.outputs.build_date }}
|
||||||
|
fw_date: ${{ steps.gh.outputs.fw_date }}
|
||||||
is_active: ${{ steps.activity.outputs.is_active }}
|
is_active: ${{ steps.activity.outputs.is_active }}
|
||||||
|
test_build: ${{ env.TEST_BUILD }}
|
||||||
|
fake_build: ${{ env.FAKE_BUILD }}
|
||||||
steps:
|
steps:
|
||||||
- name: Get repo data via GH API
|
- name: Get repo data via GH API
|
||||||
id: gh
|
id: gh
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
REPO: 'remittor/zapret-openwrt'
|
|
||||||
run: |
|
run: |
|
||||||
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
|
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
|
||||||
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
|
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
|
||||||
BRANCH=$(gh api repos/$REPO --jq '.default_branch')
|
BRANCH=$(gh api repos/$REPO_LNK --jq '.default_branch')
|
||||||
DATE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.committer.date')
|
REPO_DATE=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.commit.committer.date')
|
||||||
|
BUILD_DATE=$( date --utc +'%Y%m%d' )
|
||||||
|
FW_DATE=$( date --utc +'%Y-%m-%d' )
|
||||||
{
|
{
|
||||||
echo "tag=$GITHUB_REF_NAME"
|
echo "tag=$GITHUB_REF_NAME"
|
||||||
echo "date=$(date --utc -d $DATE +%Y%m%d)"
|
echo "date=$(date --utc -d $REPO_DATE +%Y%m%d)"
|
||||||
echo "sha=$(gh api repos/$REPO/commits/$BRANCH --jq '.sha[0:7]')"
|
echo "sha=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.sha[0:7]')"
|
||||||
echo "url=$(gh api repos/$REPO/commits/$BRANCH --jq '.html_url')"
|
echo "url=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.html_url')"
|
||||||
echo "message<<EOF"
|
echo "message<<EOF"
|
||||||
gh api repos/$REPO/commits/$BRANCH --jq '.commit.message'
|
gh api repos/$REPO_LNK/commits/$BRANCH --jq '.commit.message'
|
||||||
echo EOF
|
echo EOF
|
||||||
|
echo "build_date=$BUILD_DATE"
|
||||||
|
echo "fw_date=$FW_DATE"
|
||||||
} >> $GITHUB_OUTPUT
|
} >> $GITHUB_OUTPUT
|
||||||
echo "DATE=$DATE" >> $GITHUB_ENV
|
echo "REPO_DATE=$REPO_DATE" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check for repo activity
|
- name: Check for repo activity
|
||||||
id: activity
|
id: activity
|
||||||
env:
|
env:
|
||||||
DATE: ${{ env.DATE }}
|
REPO_DATE: ${{ env.REPO_DATE }}
|
||||||
URL: ${{ steps.gh.outputs.url }}
|
URL: ${{ steps.gh.outputs.url }}
|
||||||
run: |
|
run: |
|
||||||
TIMESTAMP=$(date --utc -d $DATE +%s)
|
TIMESTAMP=$(date --utc -d $REPO_DATE +%s)
|
||||||
DAYS=$(( ( $(date --utc +%s) - $TIMESTAMP ) / 86400 ))
|
DAYS=$(( ( $(date --utc +%s) - $TIMESTAMP ) / 86400 ))
|
||||||
echo "Repository activity: $(date --utc -d $DATE)"
|
echo "Repository activity: $(date --utc -d $REPO_DATE)"
|
||||||
echo "Commit: $URL"
|
echo "Commit: $URL"
|
||||||
if [ "${{ github.event_name }}" != "schedule" ]; then
|
if [ "${{ github.event_name }}" != "schedule" ]; then
|
||||||
is_active=true
|
is_active=true
|
||||||
@ -93,28 +138,39 @@ jobs:
|
|||||||
- mipsel_74kc
|
- mipsel_74kc
|
||||||
- mipsel_mips32
|
- mipsel_mips32
|
||||||
- x86_64
|
- x86_64
|
||||||
include:
|
isTestOrFake:
|
||||||
- branch: SNAPSHOT
|
- ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}
|
||||||
arch: aarch64_cortex-a76
|
|
||||||
#arch: riscv64_riscv64
|
|
||||||
exclude:
|
exclude:
|
||||||
- branch: SNAPSHOT
|
- branch: SNAPSHOT
|
||||||
arch: arm_mpcore
|
arch: arm_mpcore
|
||||||
- branch: SNAPSHOT
|
- branch: SNAPSHOT
|
||||||
arch: arm_cortex-a9_vfpv3-d16
|
arch: arm_cortex-a9_vfpv3-d16
|
||||||
|
- { isTestOrFake: true }
|
||||||
|
include:
|
||||||
|
- branch: openwrt-23.05
|
||||||
|
arch: x86_64
|
||||||
|
- branch: openwrt-23.05
|
||||||
|
arch: aarch64_cortex-a53
|
||||||
|
- branch: SNAPSHOT
|
||||||
|
arch: aarch64_cortex-a53
|
||||||
|
- branch: SNAPSHOT
|
||||||
|
arch: aarch64_cortex-a76
|
||||||
container:
|
container:
|
||||||
image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.branch }}
|
image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.branch }}
|
||||||
options: --user root
|
options: --user root
|
||||||
|
outputs:
|
||||||
|
pkgver: ${{ steps.build.outputs.pkgver }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'remittor/zapret-openwrt'
|
repository: ${{ env.REPO_LNK }}
|
||||||
path: zapret-openwrt
|
path: zapret-openwrt
|
||||||
|
|
||||||
- name: Setup OpenWrt SDK
|
- name: Setup OpenWrt SDK
|
||||||
if: ${{ matrix.branch == 'openwrt-23.05' || matrix.branch == 'SNAPSHOT' }}
|
|
||||||
working-directory: /builder
|
working-directory: /builder
|
||||||
|
env:
|
||||||
|
BRANCH: ${{ matrix.branch }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# gpg --verbose --recv-keys 0x1D53D1877742E911
|
# gpg --verbose --recv-keys 0x1D53D1877742E911
|
||||||
@ -125,46 +181,90 @@ jobs:
|
|||||||
sed -r -i 's/^rm.+//' setup.sh
|
sed -r -i 's/^rm.+//' setup.sh
|
||||||
./setup.sh
|
./setup.sh
|
||||||
ls -lh
|
ls -lh
|
||||||
|
if [ "$BRANCH" = "openwrt-23.05" ]; then
|
||||||
|
echo "PKGTYPE=ipk" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "PKGTYPE=apk" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup ccache
|
- name: Setup ccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.branch == 'openwrt-19.07' && '/home/build/openwrt/.ccache' || '/builder/.ccache' }}
|
path: '/builder/.ccache'
|
||||||
key: ccache-${{ matrix.arch }}-${{ matrix.branch }}-${{ github.run_id }}
|
key: ccache-${{ matrix.arch }}-${{ matrix.branch }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
ccache-${{ matrix.arch }}-${{ matrix.branch }}-
|
ccache-${{ matrix.arch }}-${{ matrix.branch }}-
|
||||||
|
|
||||||
- name: Build packages
|
- name: Init packages
|
||||||
id: build
|
id: init
|
||||||
working-directory: ${{ matrix.branch == 'openwrt-19.07' && '/home/build/openwrt' || '/builder' }}
|
working-directory: '/builder'
|
||||||
env:
|
env:
|
||||||
DATE: ${{ needs.check.outputs.date }}
|
FAKE_BUILD: ${{ env.FAKE_BUILD == 'true' || ( env.TEST_BUILD == 'true' && matrix.branch == 'SNAPSHOT' ) }}
|
||||||
SHA: ${{ needs.check.outputs.sha }}
|
BUILD_DATE: ${{ needs.check.outputs.build_date }}
|
||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
BRANCH: ${{ matrix.branch }}
|
BRANCH: ${{ matrix.branch }}
|
||||||
SIGN_KEY: ${{ secrets.SIGN_PRIVATE_KEY }}
|
SIGN_KEY: ${{ secrets.SIGN_PRIVATE_KEY }}
|
||||||
CCACHE_DIR: ${{ matrix.branch == 'openwrt-19.07' && '/home/build/openwrt/.ccache' || '/builder/.ccache' }}
|
CCACHE_DIR: '/builder/.ccache'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
#export PKG_VERSION=$(date --utc -d $DATE +%Y%m%d)
|
PKGDIR=$GITHUB_WORKSPACE/zapret-openwrt
|
||||||
#find $GITHUB_WORKSPACE/zapret-openwrt -type d -path '*/package/zapret' -exec cp -vr {} ./package \;
|
MKFN=$PKGDIR/luci-app-zapret/Makefile
|
||||||
cp -vr $GITHUB_WORKSPACE/zapret-openwrt ./package/zapret-openwrt/
|
PKGVER=$( grep -s '^PKG_VERSION:=.*' $MKFN | cut -d'=' -f2 )
|
||||||
|
echo "PKG_VERSION = $PKGVER"
|
||||||
|
cp -vr $PKGDIR ./package/zapret-openwrt/
|
||||||
|
|
||||||
mv feeds.conf.default feeds.conf
|
mv feeds.conf.default feeds.conf
|
||||||
sed -i -e 's|base.*\.git|base https://github.com/openwrt/openwrt.git|' feeds.conf
|
sed -i -e 's|base.*\.git|base https://github.com/openwrt/openwrt.git|' feeds.conf
|
||||||
sed -i -e 's|packages.*\.git|packages https://github.com/openwrt/packages.git|' feeds.conf
|
sed -i -e 's|packages.*\.git|packages https://github.com/openwrt/packages.git|' feeds.conf
|
||||||
sed -i -e 's|luci.*\.git|luci https://github.com/openwrt/luci.git|' feeds.conf
|
sed -i -e 's|luci.*\.git|luci https://github.com/openwrt/luci.git|' feeds.conf
|
||||||
|
mkdir -p ./logs
|
||||||
|
|
||||||
|
if [ "$FAKE_BUILD" = "false" ]; then
|
||||||
./scripts/feeds update base packages luci
|
./scripts/feeds update base packages luci
|
||||||
./scripts/feeds install -a
|
./scripts/feeds install -a
|
||||||
|
fi
|
||||||
|
echo "FAKE_BUILD=$FAKE_BUILD" >> $GITHUB_ENV
|
||||||
|
echo "PKGVER=$PKGVER" >> $GITHUB_ENV
|
||||||
|
echo "pkgver=$PKGVER" >> $GITHUB_OUTPUT
|
||||||
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build packages
|
||||||
|
id: build
|
||||||
|
if: steps.init.outputs.status == 'success'
|
||||||
|
working-directory: '/builder'
|
||||||
|
env:
|
||||||
|
BUILD_DATE: ${{ needs.check.outputs.build_date }}
|
||||||
|
ARCH: ${{ matrix.arch }}
|
||||||
|
BRANCH: ${{ matrix.branch }}
|
||||||
|
SIGN_KEY: ${{ secrets.SIGN_PRIVATE_KEY }}
|
||||||
|
CCACHE_DIR: '/builder/.ccache'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
MAKE_JOBS=$(($(nproc)+1))
|
||||||
|
echo "$MAKE_JOBS thread compile"
|
||||||
|
|
||||||
|
if [ "$FAKE_BUILD" = "false" ]; then
|
||||||
make defconfig
|
make defconfig
|
||||||
|
sed -i 's/CONFIG_LUCI_JSMIN=y/CONFIG_LUCI_JSMIN=n/g' .config
|
||||||
echo "------------- .config BEG -------------------"
|
echo "------------- .config BEG -------------------"
|
||||||
cat .config
|
cat .config
|
||||||
echo "------------- .config END -------------------"
|
echo "------------- .config END -------------------"
|
||||||
|
if [ "$ARCH" = "$LUCI_ARCH" ]; then
|
||||||
PKGLIST=`echo package/zapret-openwrt/{zapret,zapret-tpws,zapret-mdig,zapret-ip2net,luci-app-zapret}/compile`
|
PKGLIST=`echo package/zapret-openwrt/{zapret,zapret-tpws,zapret-mdig,zapret-ip2net,luci-app-zapret}/compile`
|
||||||
|
else
|
||||||
|
PKGLIST=`echo package/zapret-openwrt/{zapret,zapret-tpws,zapret-mdig,zapret-ip2net}/compile`
|
||||||
|
fi
|
||||||
|
if [ "$MAX_SPEED" = "false" ]; then
|
||||||
make $PKGLIST V=s CONFIG_CCACHE=1 BUILD_LOG=1
|
make $PKGLIST V=s CONFIG_CCACHE=1 BUILD_LOG=1
|
||||||
|
else
|
||||||
|
make -j$MAKE_JOBS $PKGLIST CONFIG_CCACHE=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
OUT_DIR=./bin/packages/dev_x/base
|
||||||
|
mkdir -p $OUT_DIR
|
||||||
|
touch $OUT_DIR/zapret_$PKGVER-$ARCH.$PKGTYPE
|
||||||
|
touch $OUT_DIR/luci-app-zapret_$PKGVER-all.$PKGTYPE
|
||||||
|
fi
|
||||||
|
|
||||||
find ./bin/packages/*/base -type f ! -regex ".*\(zapret\).*\.[ai]pk$" -delete
|
find ./bin/packages/*/base -type f ! -regex ".*\(zapret\).*\.[ai]pk$" -delete
|
||||||
|
|
||||||
@ -173,69 +273,82 @@ jobs:
|
|||||||
#echo "$SIGN_KEY" | base64 -d > key-build
|
#echo "$SIGN_KEY" | base64 -d > key-build
|
||||||
#make package/index
|
#make package/index
|
||||||
|
|
||||||
tar -C ./bin/packages/*/base -cvf $GITHUB_WORKSPACE/pkg-$BRANCH-$ARCH.tar --transform "s|^\./|${BRANCH/openwrt-}/$ARCH/|" --show-transformed-names .
|
OUTDIR=$GITHUB_WORKSPACE/$PKGTYPE-$ARCH
|
||||||
|
mkdir -p $OUTDIR
|
||||||
|
cp -R ./bin/packages/*/base/. $OUTDIR/
|
||||||
./staging_dir/host/bin/ccache --max-size=10M --show-stats
|
./staging_dir/host/bin/ccache --max-size=10M --show-stats
|
||||||
|
|
||||||
|
echo "OUTDIR=$OUTDIR" >> $GITHUB_ENV
|
||||||
|
echo "pkgver=$PKGVER" >> $GITHUB_OUTPUT
|
||||||
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Compress build logs
|
- name: Compress build logs
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
BRANCH: ${{ matrix.branch }}
|
BRANCH: ${{ matrix.branch }}
|
||||||
LOGS_DIR: ${{ matrix.branch == 'openwrt-19.07' && '/home/build/openwrt/logs' || '/builder/logs' }}
|
LOGS_DIR: '/builder/logs'
|
||||||
run: |
|
run: |
|
||||||
tar -cJvf logs-$BRANCH-$ARCH.tar.xz $LOGS_DIR
|
tar -cJvf logs-$BRANCH-$ARCH.tar.xz $LOGS_DIR
|
||||||
|
|
||||||
- name: Upload packages
|
- name: Upload packages
|
||||||
if: steps.build.outcome == 'success'
|
if: steps.build.outcome == 'success'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: pkg-${{ matrix.branch }}-${{ matrix.arch }}
|
path: ${{ env.OUTDIR }}
|
||||||
path: pkg-*.tar
|
name: zapret,${{ env.PKGTYPE }},${{ matrix.arch }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload build logs
|
- name: Upload build logs
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: logs-${{ matrix.branch }}-${{ matrix.arch }}
|
|
||||||
path: logs-*.tar.xz
|
path: logs-*.tar.xz
|
||||||
|
name: logs-${{ matrix.branch }}-${{ matrix.arch }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [ check, build ]
|
needs: [ check, build ]
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
max-parallel: 1
|
|
||||||
matrix:
|
|
||||||
branch: [ 'SNAPSHOT', '23.05' ]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: pkg-*
|
pattern: zapret,*
|
||||||
|
|
||||||
- name: Put packages into zip
|
- name: Put packages into zip
|
||||||
env:
|
env:
|
||||||
BRANCH: ${{ matrix.branch }}
|
|
||||||
TAG: ${{ needs.check.outputs.tag }}
|
TAG: ${{ needs.check.outputs.tag }}
|
||||||
DATE: ${{ needs.check.outputs.date }}
|
DATE: ${{ needs.check.outputs.date }}
|
||||||
|
BUILD_DATE: ${{ needs.check.outputs.build_date }}
|
||||||
|
PKGVER: ${{ needs.build.outputs.pkgver }}
|
||||||
run: |
|
run: |
|
||||||
|
echo "------------- DIR BEG -------------------"
|
||||||
|
ls -la
|
||||||
|
echo "------------- DIR END -------------------"
|
||||||
|
mkdir -p sorted
|
||||||
|
find . -maxdepth 1 -type d -name "zapret,ipk,*" -exec sh -c 'mkdir -p sorted/$(basename "{}" | cut -d, -f3)' \;
|
||||||
|
find . -maxdepth 1 -type d -name "zapret,apk,*" -exec sh -c 'mkdir -p sorted/$(basename "{}" | cut -d, -f3)/apk' \;
|
||||||
|
find . -maxdepth 1 -type d -name "zapret,ipk,*" -exec sh -c 'cp -R "{}/." sorted/$(basename "{}" | cut -d, -f3)' \;
|
||||||
|
find . -maxdepth 1 -type d -name "zapret,apk,*" -exec sh -c 'cp -R "{}/." sorted/$(basename "{}" | cut -d, -f3)/apk' \;
|
||||||
|
LUCI_IPK=$( find . -type f -path "*/zapret,ipk,*/luci-app-zapret*.ipk" -print | head -n 1 )
|
||||||
|
LUCI_APK=$( find . -type f -path "*/zapret,apk,*/luci-app-zapret*.apk" -print | head -n 1 )
|
||||||
|
find ./sorted -mindepth 1 -maxdepth 1 -type d -exec cp -f "$LUCI_IPK" "{}/" \;
|
||||||
|
find ./sorted -mindepth 2 -maxdepth 2 -type d -name "apk" -exec cp -f "$LUCI_APK" "{}/" \;
|
||||||
mkdir -p public
|
mkdir -p public
|
||||||
find . -name "*-$BRANCH-*.tar" -exec tar -xvf {} --wildcards '*.*pk' \;
|
find ./sorted -mindepth 1 -maxdepth 1 -type d -exec sh -c '7z a ./public/zapret_v${PKGVER}_$(basename "{}" | cut -d, -f3).zip {}/*' \;
|
||||||
find $BRANCH -mindepth 1 -type d -exec sh -c 'zip -0 ./public/zapret_${TAG}_$(basename {}).zip -j {} {}/*' \;
|
|
||||||
ls -lh ./public/*.zip
|
ls -lh ./public/*.zip
|
||||||
|
|
||||||
- name: Upload assets
|
- name: Upload assets
|
||||||
uses: andelf/nightly-release@main
|
uses: andelf/nightly-release@main
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BRANCH: ${{ matrix.branch }}
|
|
||||||
TAG: ${{ needs.check.outputs.tag }}
|
TAG: ${{ needs.check.outputs.tag }}
|
||||||
with:
|
with:
|
||||||
prerelease: false
|
prerelease: ${{ env.TEST_BUILD == 'true' || env.FAKE_BUILD == 'true' }}
|
||||||
tag_name: ${{ needs.check.outputs.tag }}-${{ matrix.branch }}
|
tag_name: v${{ needs.build.outputs.pkgver }}${{ env.TAG_SUFFIX }}
|
||||||
name: '${{ needs.check.outputs.tag }} for OpenWrt ${{ matrix.branch }}'
|
name: zapret v${{ needs.build.outputs.pkgver }}
|
||||||
body: |
|
body: |
|
||||||
${{ needs.check.outputs.url }}: ${{ needs.check.outputs.message }}
|
zapret v${{ needs.build.outputs.pkgver }} for OpenWrt
|
||||||
files: ./public/*.zip
|
files: ./public/*.zip
|
||||||
|
|||||||
12
README.md
12
README.md
@ -1,4 +1,9 @@
|
|||||||
[](https://github.com/remittor/zapret-openwrt/actions/workflows/build.yml)
|
[](https://github.com/remittor/zapret-openwrt/releases)
|
||||||
|
[](https://github.com/remittor/zapret-openwrt/releases)
|
||||||
|
[](https://github.com/remittor/zapret-openwrt/releases)
|
||||||
|
[](https://github.com/remittor/zapret-openwrt)
|
||||||
|
[](https://github.com/remittor/zapret-openwrt/releases)
|
||||||
|
[](https://github.com/remittor/donate)
|
||||||
# zapret-openwrt
|
# zapret-openwrt
|
||||||
|
|
||||||
Zapret is not a VPN! Zapret is an Anti-DPI utility!
|
Zapret is not a VPN! Zapret is an Anti-DPI utility!
|
||||||
@ -13,7 +18,4 @@ Zapret is not a VPN! Zapret is an Anti-DPI utility!
|
|||||||
|
|
||||||
## Donations
|
## Donations
|
||||||
|
|
||||||
<img src=https://cdn-icons-png.flaticon.com/16/14446/14446252.png alt="USDT" style="vertical-align: middle;"/> USDT (ethereum network)
|
[](https://github.com/remittor/donate)
|
||||||
```
|
|
||||||
0x840E78D3E47A7ed4987bc36b4A4f0C5240bd7DE8
|
|
||||||
```
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-zapret
|
PKG_NAME:=luci-app-zapret
|
||||||
PKG_VERSION:=70.20250109
|
PKG_VERSION:=70.20250210
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
PKG_MAINTAINER:=remittor <https://github.com/remittor>
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,183 @@
|
|||||||
|
'use strict';
|
||||||
|
'require view';
|
||||||
|
'require fs';
|
||||||
|
'require form';
|
||||||
|
'require poll';
|
||||||
|
'require uci';
|
||||||
|
'require ui';
|
||||||
|
'require view.zapret.tools as tools';
|
||||||
|
|
||||||
|
return view.extend({
|
||||||
|
retrieveLog: async function() {
|
||||||
|
return Promise.all([
|
||||||
|
L.resolveDefault(fs.stat('/bin/cat'), null),
|
||||||
|
fs.exec('/usr/bin/find', [ '/tmp', '-maxdepth', '1', '-type', 'f', '-name', 'zapret+*.log' ]),
|
||||||
|
]).then(function(status_array) {
|
||||||
|
var filereader = status_array[0] ? status_array[0].path : null;
|
||||||
|
var log_data = status_array[1]; // stdout: multiline text
|
||||||
|
if (log_data.code != 0) {
|
||||||
|
ui.addNotification(null, E('p', _('Unable to get log files') + '(code = ' + log_data.code + ') : retrieveLog()'));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (typeof(log_data.stdout) !== 'string') {
|
||||||
|
ui.addNotification(null, E('p', _('Unable to get log files') + '(undefined stdout) : retrieveLog()'));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var log_list = log_data.stdout.trim().split('\n');
|
||||||
|
if (log_list.length <= 0) {
|
||||||
|
ui.addNotification(null, E('p', _('Unable to get log files') + '(not found) : retrieveLog()'));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < log_list.length; i++) {
|
||||||
|
let logfn = log_list[i].trim();
|
||||||
|
if (logfn.startsWith('/tmp/') && logfn.endsWith('+main.log')) {
|
||||||
|
log_list.splice(i, 1);
|
||||||
|
log_list.unshift(logfn);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var tasks = [ ];
|
||||||
|
var logdata = [ ];
|
||||||
|
for (let i = 0; i < log_list.length; i++) {
|
||||||
|
let logfn = log_list[i].trim();
|
||||||
|
if (logfn.startsWith('/tmp/')) {
|
||||||
|
//console.log('LOG: ' + logfn);
|
||||||
|
logdata.push( { filename: logfn, data: null, rows: 0 } );
|
||||||
|
tasks.push( fs.read_direct(logfn) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.all(tasks).then(function(log_array) {
|
||||||
|
for (let i = 0; i < log_array.length; i++) {
|
||||||
|
if (log_array[i]) {
|
||||||
|
logdata[i].data = log_array[i];
|
||||||
|
logdata[i].rows = tools.getLineCount(log_array[i]) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return logdata;
|
||||||
|
}).catch(function(e) {
|
||||||
|
ui.addNotification(null, E('p', _('Unable to execute or read contents')
|
||||||
|
+ ': %s [ %s | %s | %s | %s ]'.format(
|
||||||
|
e.message, tools.execPath, 'retrieveLogData', 'uci.zapret'
|
||||||
|
)));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}).catch(function(e) {
|
||||||
|
ui.addNotification(null, E('p', _('Unable to execute or read contents')
|
||||||
|
+ ': %s [ %s | %s | %s | %s ]'.format(
|
||||||
|
e.message, tools.execPath, 'retrieveLog', 'uci.zapret'
|
||||||
|
)));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
pollLog: async function() {
|
||||||
|
let logdate_len = -2;
|
||||||
|
let logdata;
|
||||||
|
for (let txt_id = 0; txt_id < 10; txt_id++) {
|
||||||
|
let elem = document.getElementById('dmnlog_' + txt_id);
|
||||||
|
if (!elem)
|
||||||
|
break;
|
||||||
|
if (logdate_len == -2) {
|
||||||
|
logdata = await this.retrieveLog();
|
||||||
|
logdate_len = (logdata) ? logdata.length : -1;
|
||||||
|
}
|
||||||
|
let elem_name = elem.getAttribute("name");
|
||||||
|
let founded = false;
|
||||||
|
if (logdate_len > 0) {
|
||||||
|
for (let log_num = 0; log_num < logdate_len; log_num++) {
|
||||||
|
if (logdata[log_num].filename == elem_name) {
|
||||||
|
if (logdata[log_num].data) {
|
||||||
|
elem.value = logdata[log_num].data;
|
||||||
|
elem.rows = logdata[log_num].rows;
|
||||||
|
founded = true;
|
||||||
|
//console.log('POLL: updated ' + elem_name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!founded) {
|
||||||
|
elem.value = '';
|
||||||
|
elem.rows = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
load: async function() {
|
||||||
|
poll.add(this.pollLog.bind(this));
|
||||||
|
return await this.retrieveLog();
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function(logdata) {
|
||||||
|
if (!logdata) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var h2 = E('div', {'class' : 'cbi-title-section'}, [
|
||||||
|
E('h2', {'class': 'cbi-title-field'}, [ _('Zapret') + ' - ' + _('Log Viewer') ]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
var tabs = E('div', {}, E('div'));
|
||||||
|
|
||||||
|
for (let log_num = 0; log_num < logdata.length; log_num++) {
|
||||||
|
//console.log('REN: ' + logdata[log_num].filename + ' : ' + logdata[log_num].data.length);
|
||||||
|
var logfn = logdata[log_num].filename;
|
||||||
|
let filename = logfn.replace(/.*\//, '');
|
||||||
|
let fname = filename.split('.')[0];
|
||||||
|
fname = fname.replace(/^(zapret\+)/, '');
|
||||||
|
let fn = fname.split('+');
|
||||||
|
|
||||||
|
let tabNameText = fname.replace(/\+/g, ' ');
|
||||||
|
let tabname = 'tablog_' + log_num;
|
||||||
|
|
||||||
|
var scrollDownButton = null;
|
||||||
|
var scrollUpButton = null;
|
||||||
|
|
||||||
|
scrollDownButton = E('button', {
|
||||||
|
'id': 'scrollDownButton_' + log_num,
|
||||||
|
'class': 'cbi-button cbi-button-neutral'
|
||||||
|
}, _('Scroll to tail', 'scroll to bottom (the tail) of the log file')
|
||||||
|
);
|
||||||
|
scrollDownButton.addEventListener('click', function() {
|
||||||
|
scrollUpButton.focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
scrollUpButton = E('button', {
|
||||||
|
'id' : 'scrollUpButton_' + log_num,
|
||||||
|
'class': 'cbi-button cbi-button-neutral'
|
||||||
|
}, _('Scroll to head', 'scroll to top (the head) of the log file')
|
||||||
|
);
|
||||||
|
scrollUpButton.addEventListener('click', function() {
|
||||||
|
scrollDownButton.focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
let log_id = 'dmnlog_' + log_num;
|
||||||
|
let log_name = logdata[log_num].filename;
|
||||||
|
let log_text = (logdata[log_num].data) ? logdata[log_num].data : '';
|
||||||
|
|
||||||
|
let tab = E('div', { 'data-tab': tabname, 'data-tab-title': tabNameText }, [
|
||||||
|
E('div', { 'id': 'content_dmnlog_' + log_num }, [
|
||||||
|
E('div', {'style': 'padding-bottom: 20px'}, [ scrollDownButton ]),
|
||||||
|
E('textarea', {
|
||||||
|
'id': log_id,
|
||||||
|
'name': log_name,
|
||||||
|
'style': 'font-size:12px',
|
||||||
|
'readonly': 'readonly',
|
||||||
|
'wrap': 'off',
|
||||||
|
'rows': logdata[log_num].rows,
|
||||||
|
}, [ log_text ]),
|
||||||
|
E('div', {'style': 'padding-bottom: 20px'}, [ scrollUpButton ]),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
tabs.firstElementChild.appendChild(tab);
|
||||||
|
}
|
||||||
|
ui.tabs.initTabGroup(tabs.firstElementChild.childNodes);
|
||||||
|
//this.pollFn = L.bind(this.handleScanRefresh, this);
|
||||||
|
//poll.add(this.pollFn);
|
||||||
|
return E('div', { }, [ h2, tabs ]);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSaveApply: null,
|
||||||
|
handleSave: null,
|
||||||
|
handleReset: null
|
||||||
|
});
|
||||||
@ -92,6 +92,14 @@ return view.extend({
|
|||||||
o.value('hostlist', 'hostlist');
|
o.value('hostlist', 'hostlist');
|
||||||
o.value('autohostlist', 'autohostlist');
|
o.value('autohostlist', 'autohostlist');
|
||||||
|
|
||||||
|
o = s.taboption(tabname, form.Value, 'WS_USER', _('WS_USER'));
|
||||||
|
o.rmempty = false;
|
||||||
|
o.datatype = 'string';
|
||||||
|
|
||||||
|
o = s.taboption(tabname, form.Flag, 'DAEMON_LOG_ENABLE', _('DAEMON_LOG_ENABLE'));
|
||||||
|
o.rmempty = false;
|
||||||
|
o.default = 0;
|
||||||
|
|
||||||
/* NFQWS_OPT_DESYNC tab */
|
/* NFQWS_OPT_DESYNC tab */
|
||||||
|
|
||||||
tabname = 'nfqws_params';
|
tabname = 'nfqws_params';
|
||||||
@ -320,6 +328,29 @@ return view.extend({
|
|||||||
o.onclick = () => new tools.fileEditDialog(fn, name, '', '', 15).show();
|
o.onclick = () => new tools.fileEditDialog(fn, name, '', '', 15).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* custom.d files */
|
||||||
|
|
||||||
|
tabname = 'custom_d_tab';
|
||||||
|
s.tab(tabname, 'custom.d');
|
||||||
|
|
||||||
|
o = s.taboption(tabname, form.Flag, 'DISABLE_CUSTOM', _('DISABLE_CUSTOM'));
|
||||||
|
o.rmempty = false;
|
||||||
|
o.default = 0;
|
||||||
|
|
||||||
|
add_delim(s);
|
||||||
|
|
||||||
|
for (let i = 0; i < tools.customdPrefixList.length; i++) {
|
||||||
|
let num = tools.customdPrefixList[i];
|
||||||
|
let fn = tools.customdFileFormat.format(num.toString());
|
||||||
|
let name = _('custom.d script #' + num);
|
||||||
|
o = s.taboption(tabname, form.Button, '_customd_file%d_btn'.format(num), name);
|
||||||
|
o.inputtitle = _('Edit');
|
||||||
|
o.inputstyle = 'edit btn';
|
||||||
|
o.description = fn;
|
||||||
|
let desc = (num == tools.discord_num) ? _('Example') + ': <a href=%s>%s</a>'.format(tools.discord_url) : '';
|
||||||
|
o.onclick = () => new tools.fileEditDialog(fn, name, desc, '', 15).show();
|
||||||
|
}
|
||||||
|
|
||||||
let map_promise = m.render();
|
let map_promise = m.render();
|
||||||
map_promise.then(node => node.classList.add('fade-in'));
|
map_promise.then(node => node.classList.add('fade-in'));
|
||||||
return map_promise;
|
return map_promise;
|
||||||
|
|||||||
@ -49,6 +49,10 @@ return baseclass.extend({
|
|||||||
iplstUserExcludeFN: '/opt/zapret/ipset/zapret-ip-user-exclude.txt',
|
iplstUserExcludeFN: '/opt/zapret/ipset/zapret-ip-user-exclude.txt',
|
||||||
custFileMax : 4,
|
custFileMax : 4,
|
||||||
custFileTemplate : '/opt/zapret/ipset/cust%s.txt',
|
custFileTemplate : '/opt/zapret/ipset/cust%s.txt',
|
||||||
|
customdPrefixList : [ 10, 20, 50, 60, 90 ] ,
|
||||||
|
customdFileFormat : '/opt/zapret/init.d/openwrt/custom.d/%s-script.sh',
|
||||||
|
discord_num : 50,
|
||||||
|
discord_url : 'https://github.com/bol-van/zapret/blob/master/init.d/custom.d.examples.linux/50-discord',
|
||||||
|
|
||||||
autoHostListFN : '/opt/zapret/ipset/zapret-hosts-auto.txt',
|
autoHostListFN : '/opt/zapret/ipset/zapret-hosts-auto.txt',
|
||||||
autoHostListDbgFN : '/opt/zapret/ipset/zapret-hosts-auto-debug.log',
|
autoHostListDbgFN : '/opt/zapret/ipset/zapret-hosts-auto-debug.log',
|
||||||
@ -305,6 +309,17 @@ return baseclass.extend({
|
|||||||
return out;
|
return out;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getLineCount: function(mstr) {
|
||||||
|
let count = 0;
|
||||||
|
let c = '\n'.charAt(0);
|
||||||
|
for (let i = 0; i < mstr.length; ++i) {
|
||||||
|
if (c === mstr.charAt(i)) {
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
},
|
||||||
|
|
||||||
fileEditDialog: baseclass.extend({
|
fileEditDialog: baseclass.extend({
|
||||||
__init__: function(file, title, desc, aux = null, rows = 10, callback, file_exists = false) {
|
__init__: function(file, title, desc, aux = null, rows = 10, callback, file_exists = false) {
|
||||||
this.file = file;
|
this.file = file;
|
||||||
|
|||||||
@ -33,5 +33,14 @@
|
|||||||
"type": "view",
|
"type": "view",
|
||||||
"path": "zapret/settings"
|
"path": "zapret/settings"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"admin/services/zapret/dmnlog": {
|
||||||
|
"title": "Log Viewer",
|
||||||
|
"order": 30,
|
||||||
|
"action": {
|
||||||
|
"type": "view",
|
||||||
|
"path": "zapret/dmnlog"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,10 +7,14 @@
|
|||||||
"/opt/zapret/config": [ "read" ],
|
"/opt/zapret/config": [ "read" ],
|
||||||
"/opt/zapret/ipset/*": [ "read" ],
|
"/opt/zapret/ipset/*": [ "read" ],
|
||||||
"/etc/crontabs/root": [ "read" ],
|
"/etc/crontabs/root": [ "read" ],
|
||||||
|
"/tmp/zapret*": [ "read" ],
|
||||||
"/etc/init.d/zapret*": [ "exec" ],
|
"/etc/init.d/zapret*": [ "exec" ],
|
||||||
|
"/bin/ps*": [ "exec" ],
|
||||||
|
"/bin/cat*": [ "exec" ],
|
||||||
"/bin/busybox*": [ "exec" ],
|
"/bin/busybox*": [ "exec" ],
|
||||||
"/bin/opkg*": [ "exec" ],
|
"/bin/opkg*": [ "exec" ],
|
||||||
"/usr/bin/apk*": [ "exec" ],
|
"/usr/bin/apk*": [ "exec" ],
|
||||||
|
"/usr/bin/find*": [ "exec" ],
|
||||||
"/opt/zapret/restore-def-cfg.sh*": [ "exec" ],
|
"/opt/zapret/restore-def-cfg.sh*": [ "exec" ],
|
||||||
"/opt/zapret/sync_config.sh*": [ "exec" ]
|
"/opt/zapret/sync_config.sh*": [ "exec" ]
|
||||||
},
|
},
|
||||||
@ -22,7 +26,8 @@
|
|||||||
"write": {
|
"write": {
|
||||||
"file": {
|
"file": {
|
||||||
"/opt/zapret/config": [ "write" ],
|
"/opt/zapret/config": [ "write" ],
|
||||||
"/opt/zapret/ipset/*.txt": [ "write" ],
|
"/opt/zapret/ipset/*": [ "write" ],
|
||||||
|
"/opt/zapret/init.d/openwrt/custom.d/*": [ "write" ],
|
||||||
"/etc/crontabs/root": [ "write" ]
|
"/etc/crontabs/root": [ "write" ]
|
||||||
},
|
},
|
||||||
"uci": [ "zapret" ]
|
"uci": [ "zapret" ]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret-ip2net
|
PKG_NAME:=zapret-ip2net
|
||||||
PKG_VERSION:=70.20250109
|
PKG_VERSION:=70.20250210
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=f21bd0c63c4997cad7d792c29053a2a7556663e8
|
PKG_SOURCE_VERSION:=f62b289cb5e0566633aa51f163651c656f9e1cc1
|
||||||
PKG_SOURCE_DATE:=2025-01-09
|
PKG_SOURCE_DATE:=2025-02-10
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret-mdig
|
PKG_NAME:=zapret-mdig
|
||||||
PKG_VERSION:=70.20250109
|
PKG_VERSION:=70.20250210
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=f21bd0c63c4997cad7d792c29053a2a7556663e8
|
PKG_SOURCE_VERSION:=f62b289cb5e0566633aa51f163651c656f9e1cc1
|
||||||
PKG_SOURCE_DATE:=2025-01-09
|
PKG_SOURCE_DATE:=2025-02-10
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret-tpws
|
PKG_NAME:=zapret-tpws
|
||||||
PKG_VERSION:=70.20250109
|
PKG_VERSION:=70.20250210
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
@ -9,8 +9,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=f21bd0c63c4997cad7d792c29053a2a7556663e8
|
PKG_SOURCE_VERSION:=f62b289cb5e0566633aa51f163651c656f9e1cc1
|
||||||
PKG_SOURCE_DATE:=2025-01-09
|
PKG_SOURCE_DATE:=2025-02-10
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=zapret
|
PKG_NAME:=zapret
|
||||||
PKG_VERSION:=70.20250109
|
PKG_VERSION:=70.20250210
|
||||||
|
|
||||||
PKG_MAINTAINER:=bol-van
|
PKG_MAINTAINER:=bol-van
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
@ -13,8 +13,8 @@ PKG_LICENSE_FILES:=docs/LICENSE.txt
|
|||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
PKG_SOURCE_URL:=https://github.com/bol-van/zapret.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_VERSION:=f21bd0c63c4997cad7d792c29053a2a7556663e8
|
PKG_SOURCE_VERSION:=f62b289cb5e0566633aa51f163651c656f9e1cc1
|
||||||
PKG_SOURCE_DATE:=2025-01-09
|
PKG_SOURCE_DATE:=2025-02-10
|
||||||
|
|
||||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
#PKG_SOURCE_URL:=https://github.com/bol-van/zapret/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
@ -69,7 +69,7 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_DIR) $(1)/opt/zapret/ipset
|
$(INSTALL_DIR) $(1)/opt/zapret/ipset
|
||||||
$(CP) $(PKG_BUILD_DIR)/ipset/* $(1)/opt/zapret/ipset/
|
$(CP) $(PKG_BUILD_DIR)/ipset/* $(1)/opt/zapret/ipset/
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/blockcheck.sh $(1)/opt/zapret/blockcheck.sh
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/blockcheck.sh $(1)/opt/zapret/blockcheck.sh
|
||||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config.default $(1)/opt/zapret/config.default
|
#$(INSTALL_DATA) $(PKG_BUILD_DIR)/config.default $(1)/opt/zapret/config.default
|
||||||
$(INSTALL_DIR) $(1)/opt/zapret/tmp
|
$(INSTALL_DIR) $(1)/opt/zapret/tmp
|
||||||
$(INSTALL_DIR) $(1)/opt/zapret/init.d/openwrt
|
$(INSTALL_DIR) $(1)/opt/zapret/init.d/openwrt
|
||||||
$(CP) $(PKG_BUILD_DIR)/init.d/openwrt/* $(1)/opt/zapret/init.d/openwrt/
|
$(CP) $(PKG_BUILD_DIR)/init.d/openwrt/* $(1)/opt/zapret/init.d/openwrt/
|
||||||
@ -77,10 +77,10 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/openwrt/90-zapret $(1)/etc/hotplug.d/iface/90-zapret
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/openwrt/90-zapret $(1)/etc/hotplug.d/iface/90-zapret
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./init.d.sh $(1)/etc/init.d/zapret
|
$(INSTALL_BIN) ./init.d.sh $(1)/etc/init.d/zapret
|
||||||
$(INSTALL_CONF) ./config.default $(1)/opt/zapret/config.default
|
$(INSTALL_DATA) ./config.default $(1)/opt/zapret/config.default
|
||||||
$(INSTALL_CONF) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt
|
$(INSTALL_DATA) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
$(INSTALL_DATA) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-ip-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-exclude.txt
|
$(INSTALL_DATA) ./ipset/zapret-ip-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-exclude.txt
|
||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/etc/uci-defaults/zapret-uci-def-cfg.sh
|
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/etc/uci-defaults/zapret-uci-def-cfg.sh
|
||||||
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/opt/zapret/uci-def-cfg.sh
|
$(INSTALL_BIN) ./uci-def-cfg.sh $(1)/opt/zapret/uci-def-cfg.sh
|
||||||
@ -89,6 +89,10 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_BIN) ./renew-cfg.sh $(1)/opt/zapret/renew-cfg.sh
|
$(INSTALL_BIN) ./renew-cfg.sh $(1)/opt/zapret/renew-cfg.sh
|
||||||
$(INSTALL_BIN) ./restore-def-cfg.sh $(1)/opt/zapret/restore-def-cfg.sh
|
$(INSTALL_BIN) ./restore-def-cfg.sh $(1)/opt/zapret/restore-def-cfg.sh
|
||||||
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
||||||
|
# Fix permisions
|
||||||
|
chmod 644 $(1)/opt/zapret/ipset/*.txt
|
||||||
|
chmod 644 $(1)/opt/zapret/config.default
|
||||||
|
chmod 755 $(1)/opt/zapret/*.sh
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/preinst
|
define Package/$(PKG_NAME)/preinst
|
||||||
|
|||||||
@ -4,6 +4,9 @@
|
|||||||
# can help in case /tmp has not enough space
|
# can help in case /tmp has not enough space
|
||||||
#TMPDIR=/opt/zapret/tmp
|
#TMPDIR=/opt/zapret/tmp
|
||||||
|
|
||||||
|
# redefine user for zapret daemons. required on Keenetic
|
||||||
|
WS_USER="daemon"
|
||||||
|
|
||||||
# override firewall type : iptables,nftables,ipfw
|
# override firewall type : iptables,nftables,ipfw
|
||||||
FWTYPE=nftables
|
FWTYPE=nftables
|
||||||
|
|
||||||
@ -96,6 +99,8 @@ NFQWS_PORTS_UDP_KEEPALIVE=0
|
|||||||
NFQWS_OPT="--filter-tcp=80 <HOSTLIST> --dpi-desync=fake,fakedsplit --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig --new --filter-tcp=443 --hostlist=/opt/zapret/ipset/zapret-hosts-google.txt --dpi-desync=fake,multidisorder --dpi-desync-split-pos=1,midsld --dpi-desync-repeats=11 --dpi-desync-fooling=md5sig --dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin --new --filter-udp=443 --hostlist=/opt/zapret/ipset/zapret-hosts-google.txt --dpi-desync=fake --dpi-desync-repeats=11 --dpi-desync-fake-quic=/opt/zapret/files/fake/quic_initial_www_google_com.bin --new --filter-udp=443 <HOSTLIST_NOAUTO> --dpi-desync=fake --dpi-desync-repeats=11 --new --filter-tcp=443 <HOSTLIST> --dpi-desync=fake,multidisorder --dpi-desync-split-pos=midsld --dpi-desync-repeats=6 --dpi-desync-fooling=badseq,md5sig"
|
NFQWS_OPT="--filter-tcp=80 <HOSTLIST> --dpi-desync=fake,fakedsplit --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig --new --filter-tcp=443 --hostlist=/opt/zapret/ipset/zapret-hosts-google.txt --dpi-desync=fake,multidisorder --dpi-desync-split-pos=1,midsld --dpi-desync-repeats=11 --dpi-desync-fooling=md5sig --dpi-desync-fake-tls=/opt/zapret/files/fake/tls_clienthello_www_google_com.bin --new --filter-udp=443 --hostlist=/opt/zapret/ipset/zapret-hosts-google.txt --dpi-desync=fake --dpi-desync-repeats=11 --dpi-desync-fake-quic=/opt/zapret/files/fake/quic_initial_www_google_com.bin --new --filter-udp=443 <HOSTLIST_NOAUTO> --dpi-desync=fake --dpi-desync-repeats=11 --new --filter-tcp=443 <HOSTLIST> --dpi-desync=fake,multidisorder --dpi-desync-split-pos=midsld --dpi-desync-repeats=6 --dpi-desync-fooling=badseq,md5sig"
|
||||||
|
|
||||||
|
|
||||||
|
DISABLE_CUSTOM=0
|
||||||
|
|
||||||
# FlowOffload mode : donttouch,none,software,hardware
|
# FlowOffload mode : donttouch,none,software,hardware
|
||||||
FLOWOFFLOAD=none
|
FLOWOFFLOAD=none
|
||||||
|
|
||||||
@ -135,3 +140,8 @@ DISABLE_IPV6=1
|
|||||||
# possible values : get_user.sh get_antizapret.sh get_combined.sh get_reestr.sh get_hostlist.sh
|
# possible values : get_user.sh get_antizapret.sh get_combined.sh get_reestr.sh get_hostlist.sh
|
||||||
# comment if not required
|
# comment if not required
|
||||||
#GETLIST=get_antizapret_domains.sh
|
#GETLIST=get_antizapret_domains.sh
|
||||||
|
|
||||||
|
|
||||||
|
DAEMON_LOG_ENABLE=0
|
||||||
|
|
||||||
|
DAEMON_LOG_FILE="/tmp/zapret+<DAEMON_NAME>+<DAEMON_IDNUM>+<DAEMON_CFGNAME>.log"
|
||||||
|
|||||||
@ -15,6 +15,10 @@ function set_cfg_default_values
|
|||||||
set $cfgname.config.DISABLE_IPV4='0'
|
set $cfgname.config.DISABLE_IPV4='0'
|
||||||
set $cfgname.config.DISABLE_IPV6='1'
|
set $cfgname.config.DISABLE_IPV6='1'
|
||||||
set $cfgname.config.MODE_FILTER='hostlist'
|
set $cfgname.config.MODE_FILTER='hostlist'
|
||||||
|
set $cfgname.config.DISABLE_CUSTOM='0'
|
||||||
|
set $cfgname.config.WS_USER='daemon'
|
||||||
|
set $cfgname.config.DAEMON_LOG_ENABLE='0'
|
||||||
|
set $cfgname.config.DAEMON_LOG_FILE='/tmp/zapret+<DAEMON_NAME>+<DAEMON_IDNUM>+<DAEMON_CFGNAME>.log'
|
||||||
# autohostlist options
|
# autohostlist options
|
||||||
set $cfgname.config.AUTOHOSTLIST_RETRANS_THRESHOLD='3'
|
set $cfgname.config.AUTOHOSTLIST_RETRANS_THRESHOLD='3'
|
||||||
set $cfgname.config.AUTOHOSTLIST_FAIL_THRESHOLD='3'
|
set $cfgname.config.AUTOHOSTLIST_FAIL_THRESHOLD='3'
|
||||||
|
|||||||
@ -71,3 +71,8 @@ function boot
|
|||||||
/bin/sh /etc/rc.common $ZAPRET_ORIG_INITD start "$@"
|
/bin/sh /etc/rc.common $ZAPRET_ORIG_INITD start "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function restart
|
||||||
|
{
|
||||||
|
rm -f /tmp/zapret*.log
|
||||||
|
/bin/sh /etc/rc.common $ZAPRET_ORIG_INITD restart "$@"
|
||||||
|
}
|
||||||
|
|||||||
@ -0,0 +1,65 @@
|
|||||||
|
From 069fb25032d1b85ea57615ca234752e3969b777b Mon Sep 17 00:00:00 2001
|
||||||
|
From: remittor <remittor@gmail.com>
|
||||||
|
Date: Sat, 8 Feb 2025 22:04:51 +0300
|
||||||
|
Subject: [PATCH] Add support log file for each daemons
|
||||||
|
|
||||||
|
---
|
||||||
|
diff --git a/common/custom.sh b/common/custom.sh
|
||||||
|
index 0af19c0..41c0967 100644
|
||||||
|
--- a/common/custom.sh
|
||||||
|
+++ b/common/custom.sh
|
||||||
|
@@ -13,9 +13,16 @@ custom_runner()
|
||||||
|
dir_is_not_empty "$CUSTOM_DIR/custom.d" && {
|
||||||
|
for script in "$CUSTOM_DIR/custom.d/"*; do
|
||||||
|
[ -f "$script" ] || continue
|
||||||
|
+ DAEMON_CFGNAME_SAVED="$DAEMON_CFGNAME"
|
||||||
|
+ unset DAEMON_CFGNAME
|
||||||
|
unset -f $FUNC
|
||||||
|
. "$script"
|
||||||
|
+ if [ -z "$DAEMON_CFGNAME" ]; then
|
||||||
|
+ DAEMON_CFGNAME="$(basename "$script")"
|
||||||
|
+ DAEMON_CFGNAME="${DAEMON_CFGNAME%%.*}"
|
||||||
|
+ fi
|
||||||
|
existf $FUNC && $FUNC "$@"
|
||||||
|
+ DAEMON_CFGNAME="$DAEMON_CFGNAME_SAVED"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/init.d/openwrt/zapret b/init.d/openwrt/zapret
|
||||||
|
index 8d6d3a9..fcb1e91 100755
|
||||||
|
--- a/init.d/openwrt/zapret
|
||||||
|
+++ b/init.d/openwrt/zapret
|
||||||
|
@@ -58,12 +58,29 @@ run_daemon()
|
||||||
|
# use $PIDDIR/$DAEMONBASE$1.pid as pidfile
|
||||||
|
local DAEMONBASE="$(basename "$2")"
|
||||||
|
echo "Starting daemon $1: $2 $3"
|
||||||
|
+ local DAEMON_NAME="$DAEMONBASE"
|
||||||
|
+ local DAEMON_IDNUM=$1
|
||||||
|
+ local DAEMON_PATH="$2"
|
||||||
|
+ local DAEMON_ARGS="$3"
|
||||||
|
+ local DAEMON_LOG=
|
||||||
|
+ if [ -n "$DAEMON_LOG_FILE" ]; then
|
||||||
|
+ DAEMON_LOG="$DAEMON_LOG_FILE"
|
||||||
|
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_NAME>/$DAEMON_NAME}
|
||||||
|
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_IDNUM>/$DAEMON_IDNUM}
|
||||||
|
+ DAEMON_LOG=${DAEMON_LOG/<DAEMON_CFGNAME>/$DAEMON_CFGNAME}
|
||||||
|
+ [ -f "$DAEMON_LOG" ] && rm -f "$DAEMON_LOG"
|
||||||
|
+ if [ "$DAEMON_LOG_ENABLE" = "1" ]; then
|
||||||
|
+ DAEMON_ARGS="--debug=@$DAEMON_LOG $DAEMON_ARGS"
|
||||||
|
+ fi
|
||||||
|
+ fi
|
||||||
|
procd_open_instance
|
||||||
|
- procd_set_param command $2 $3
|
||||||
|
+ procd_set_param command $DAEMON_PATH $DAEMON_ARGS
|
||||||
|
procd_set_param pidfile $PIDDIR/$DAEMONBASE$1.pid
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
+DAEMON_CFGNAME="main"
|
||||||
|
+
|
||||||
|
run_tpws()
|
||||||
|
{
|
||||||
|
[ "$DISABLE_IPV4" = "1" ] && [ "$DISABLE_IPV6" = "1" ] && return 0
|
||||||
|
--
|
||||||
|
2.41.0.windows.3
|
||||||
|
|
||||||
@ -75,6 +75,10 @@ sync_param INIT_APPLY_FW
|
|||||||
sync_param DISABLE_IPV4
|
sync_param DISABLE_IPV4
|
||||||
sync_param DISABLE_IPV6
|
sync_param DISABLE_IPV6
|
||||||
sync_param MODE_FILTER
|
sync_param MODE_FILTER
|
||||||
|
sync_param DISABLE_CUSTOM
|
||||||
|
sync_param WS_USER str
|
||||||
|
sync_param DAEMON_LOG_ENABLE
|
||||||
|
sync_param DAEMON_LOG_FILE str
|
||||||
|
|
||||||
sync_param AUTOHOSTLIST_RETRANS_THRESHOLD
|
sync_param AUTOHOSTLIST_RETRANS_THRESHOLD
|
||||||
sync_param AUTOHOSTLIST_FAIL_THRESHOLD
|
sync_param AUTOHOSTLIST_FAIL_THRESHOLD
|
||||||
|
|||||||
Reference in New Issue
Block a user