From 825f04dc57fbcee491d8a464b5c24c783a6a8a32 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 18 Jun 2021 20:13:59 +0200 Subject: [PATCH 01/33] Fix block lan fw --- .../share/omr/post-tracking.d/post-tracking | 1 + openmptcprouter/files/bin/blocklanfw | 35 ++++++++++++------- openmptcprouter/files/etc/firewall.omr-server | 1 + 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index aee2c6473..c764e794d 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -1470,5 +1470,6 @@ if [ "$(pgrep openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprouter #/etc/init.d/v2ray rules_up >/dev/null 2>&1 #/etc/init.d/omr-bypass reload_rules >/dev/null 2>&1 #sh /etc/firewall.gre-tunnel >/dev/null 2>&1 + /bin/blocklanfw >/dev/null 2>&1 sleep 5 fi \ No newline at end of file diff --git a/openmptcprouter/files/bin/blocklanfw b/openmptcprouter/files/bin/blocklanfw index 0f4a85367..cf507eba4 100755 --- a/openmptcprouter/files/bin/blocklanfw +++ b/openmptcprouter/files/bin/blocklanfw @@ -5,13 +5,15 @@ ss_rules_fw_drop() { fwrule=$(echo "$c" | sed 's/reject/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then eval "iptables -w -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done - fw3 -4 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j drop/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | + fw3 -4 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j DROP/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | while IFS=$"\n" read -r c; do - fwrule=$(echo "$c" | sed 's/drop/REDIRECT --to-ports 65535/') + fwrule=$(echo "$c" | sed 's/DROP/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then eval "iptables -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done } @@ -22,13 +24,15 @@ ss_rules6_fw_drop() { fwrule=$(echo "$c" | sed 's/reject/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then eval "ip6tables -w -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done - fw3 -6 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j drop/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | + fw3 -6 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j DROP/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | while IFS=$"\n" read -r c; do - fwrule=$(echo "$c" | sed 's/drop/REDIRECT --to-ports 65535/') + fwrule=$(echo "$c" | sed 's/DROP/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then eval "ip6tables -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done } @@ -38,14 +42,16 @@ v2r_rules_fw_drop() { while IFS=$"\n" read -r c; do fwrule=$(echo "$c" | sed 's/reject/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then - eval "iptables -w -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + eval "iptables -w -t nat -I zone_lan_prerouting 1 ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done - fw3 -4 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j drop/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | + fw3 -4 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j DROP/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | while IFS=$"\n" read -r c; do - fwrule=$(echo "$c" | sed 's/drop/REDIRECT --to-ports 65535/') + fwrule=$(echo "$c" | sed 's/DROP/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then - eval "iptables -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + eval "iptables -t nat -I zone_lan_prerouting 1 ${fwrule} 2>&1 >/dev/null" + fw=$((fw+1)) fi done } @@ -55,18 +61,19 @@ v2ray_rules6_fw_drop() { while IFS=$"\n" read -r c; do fwrule=$(echo "$c" | sed 's/reject/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then - eval "ip6tables -w -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + eval "ip6tables -w -t nat -I zone_lan_prerouting 1 ${fwrule} 2>&1 >/dev/null" fi done - fw3 -6 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j drop/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | + fw3 -6 print 2>/dev/null | awk '/iptables/&&/zone_lan_forward/&&/tcp/&&/-t filter/&&/-j DROP/ {for(i=6; i<=NF; i++) { printf "%s ",$i } print "\n" }' | while IFS=$"\n" read -r c; do - fwrule=$(echo "$c" | sed 's/drop/REDIRECT --to-ports 65535/') + fwrule=$(echo "$c" | sed 's/DROP/REDIRECT --to-ports 65535/') if [ -n "$fwrule" ] && [ -z "$(iptables-save | grep zone_lan_prerouting | grep '${fwrule}')" ]; then - eval "ip6tables -t nat -A zone_lan_prerouting ${fwrule} 2>&1 >/dev/null" + eval "ip6tables -t nat -I zone_lan_prerouting 1 ${fwrule} 2>&1 >/dev/null" fi done } +fw=0 if [ "$(uci -q get openmptcprouter.settings.proxy)" = "shadowsocks" ]; then ss_rules6_fw_drop ss_rules_fw_drop @@ -74,3 +81,7 @@ elif [ "$(uci -q get openmptcprouter.settings.proxy)" = "v2ray" ]; then v2r_rules_fw_drop v2ray_rules6_fw_drop fi +rule=$(fw3 -4 print | grep 'A PREROUTING' | grep zone_lan_prerouting | sed 's/-A PREROUTING/-D PREROUTING/') +eval "$rule 2>&1 >/dev/null" +newrule=$(echo "$rule" | sed 's/-D PREROUTING/-I PREROUTING 1/') +eval "$newrule 2>&1 >/dev/null" diff --git a/openmptcprouter/files/etc/firewall.omr-server b/openmptcprouter/files/etc/firewall.omr-server index 4f5a33809..a3aaccd16 100644 --- a/openmptcprouter/files/etc/firewall.omr-server +++ b/openmptcprouter/files/etc/firewall.omr-server @@ -13,3 +13,4 @@ config_load openmptcprouter config_foreach _enable_firewall_check server uci -q commit firewall #/etc/init.d/openmptcprouter-vps set_vps_firewall & +/bin/blocklanfw 2>&1 >/dev/null From 189aaa9d30cc7cd54f7a4357deb17945913ca4e4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sun, 20 Jun 2021 07:17:33 +0200 Subject: [PATCH 02/33] Fix firewall issue when source IP specified --- .../files/etc/init.d/openmptcprouter-vps | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 7e2f4c4e1..73eb6d623 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -909,7 +909,7 @@ _vps_firewall_redirect_port() { if [ "$v2ray" = "0" ]; then checkfw="" if [ "$family" = "ipv4" ]; then - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username redirect router $src_dport port $protoi") else comment="" @@ -921,7 +921,7 @@ _vps_firewall_redirect_port() { checkfw=$(echo "$vpsfwlist" | grep "# OMR $username redirect router $src_dport port $protoi${comment}") fi else - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username redirect router $src_dport port $protoi") else comment="" @@ -935,7 +935,7 @@ _vps_firewall_redirect_port() { _set_json "shorewallopen" "$settings" fi if [ "$family" = "ipv4" ]; then - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi") [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi") else @@ -946,7 +946,7 @@ _vps_firewall_redirect_port() { [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR redirect router $src_dport port $protoi${comment}") fi else - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi") [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi") else @@ -959,7 +959,7 @@ _vps_firewall_redirect_port() { else checkfw="" if [ "$family" = "ipv4" ]; then - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username open router $src_dport port $protoi") else comment="" @@ -971,7 +971,7 @@ _vps_firewall_redirect_port() { checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port $protoi${comment}") fi else - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port $protoi") else comment="" @@ -987,7 +987,7 @@ _vps_firewall_redirect_port() { _set_json "v2rayredirect" "$settings" fi if [ "$family" = "ipv4" ]; then - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port $protoi") [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port $protoi") else @@ -998,7 +998,7 @@ _vps_firewall_redirect_port() { [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port $protoi${comment}") fi else - if [ "$src_dip" = "" ]; then + if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port $protoi") [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port $protoi") else From 580dcd596cddc5ac3ebe1835f60b24e356adc363 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 23 Jun 2021 10:57:09 +0800 Subject: [PATCH 03/33] fix --- .circleci/config.yml | 751 +++++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 7 +- README.md | 20 +- 3 files changed, 764 insertions(+), 14 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..f72307d01 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,751 @@ +version: 2 +jobs: + prepare: + machine: + image: ubuntu-1604:201903-01 + + working_directory: ~/ + + steps: + - run: + name: Prepare + command: | + sudo rm -rf /var/lib/apt/lists/lock + sudo apt-get update + sudo rm -rf /var/lib/apt/lists/lock + sudo apt-get install -yq build-essential git unzip ncurses-dev libz-dev libssl-dev python subversion gettext gawk wget curl rsync perl libelf-dev python3.5 libpython3.5-stdlib liblzma-dev + pyenv global 3.5.2 + + build_x86_64: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: x86_64 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 50m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + sudo apt-get update + sudo apt-get install -yq libelf-dev + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 50m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_x86: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: x86 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_rpi3: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: rpi3 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_espressobin: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: espressobin + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_r2s: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: r2s + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_rpi4: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: rpi4 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_rpi2: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: rpi2 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile package/compile target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_bpi-r2: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: bpi-r2 + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: | + sudo apt-get update + sudo apt-get -yq install swig2.0 + make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_wrt3200acm: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_TARGET: wrt3200acm + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + build_wrt32: + machine: + image: ubuntu-1604:201903-01 + + environment: + - OMR_VERSION: $CIRCLE_TAG + - OMR_KERNEL: 5.4 + + working_directory: ~/ + + steps: + - run: + name: cache + command: | + echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + + - restore_cache: + keys: + - cache-{{ checksum "/tmp/cache-version" }} + - cache-{{ checksum "/tmp/cache-target" }} + + - run: + name: Build toolchain wrt3200acm + no_output_timeout: 40m + command: | + git clone https://github.com/suyuan168/3grouter || true + cd openmptcprouter + git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true + git pull || true + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_TARGET="wrt3200acm" + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt3200acm/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt3200acm/source/key-build.pub + + - save_cache: + key: cache-{{ checksum "/tmp/cache-target" }} + paths: + - openmptcprouter + + - run: + name: Build wrt3200acm + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt3200acm/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy wrt3200acm + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/wrt3200acm/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt3200acm + rm -rf ~/openmptcprouter/wrt3200acm/source/bin + + - save_cache: + key: cache-{{ checksum "/tmp/cache-version" }} + paths: + - openmptcprouter + + - run: + name: Build toolchain wrt32x + no_output_timeout: 40m + command: | + cd ~/openmptcprouter/ + export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" + export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" + export OMR_TARGET="wrt32x" + ln -s wrt3200acm wrt32x + pyenv global 3.5.2 + sh build.sh prepare {tools,toolchain}/install -j2 + echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt32x/source/key-build + echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt32x/source/key-build.pub + + - run: + name: Build wrt32x + no_output_timeout: 40m + command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt32x/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 + + - run: + name: Deploy wrt32x + command: | + ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET + rsync -av --delete-after ~/openmptcprouter/wrt32x/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt32x + +workflows: + version: 2 + main: + jobs: + - prepare: + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_x86_64: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_x86: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_rpi4: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_rpi3: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_espressobin: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_r2s: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_rpi2: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_bpi-r2: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop + - build_wrt32: + requires: + - prepare + filters: + tags: + only: /.*/ + branches: + only: + - develop diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a75f5720c..6658b8dde 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build antrouter +name: openmptcprouter on: [push] env: @@ -129,7 +129,7 @@ jobs: TARGET: /www/wwwroot/55860.com/bak/down/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}} SOURCE: ./bin/ KEY: ${{ secrets.PRIVATE_KEY }} - user: root + USER: root HOST: ${{ secrets.OMR_DEPLOY_HOST }} PORT: ${{ secrets.OMR_DEPLOY_PORT }} SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} @@ -144,11 +144,10 @@ jobs: TARGET: /www/wwwroot/55860.com/bak/down/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{env.OMR_KERNEL}}/${{matrix.OMR_TARGET}} SOURCE: ./bin/ KEY: ${{ secrets.PRIVATE_KEY }} - user: root + USER: root HOST: ${{ secrets.OMR_DEPLOY_HOST }} PORT: ${{ secrets.OMR_DEPLOY_PORT }} SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} - diff --git a/README.md b/README.md index e92835abd..e9edfcd2c 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is the OpenWrt OpenMPTCProuter feed containing all modified and necessary packages to build the OpenMPTCProuter image. -For More information, see [https://github.com/ysurac/openmptcprouter](https://github.com/ysurac/openmptcprouter) and [https://www.openmptcprouter.com](https://www.openmptcprouter.com/). +For More information, see [https://github.com/suyuan168/3grouter](https://github.com/suyuan168/3grouter) and [https://www.openmptcprouter.com](https://www.openmptcprouter.com/). ## Glorytun @@ -66,7 +66,7 @@ Added support to gateway set by user for 6in4. Used for IPv6 over the glorytun I ## luci-omr-bypass -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-bypass](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-bypass) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-omr-bypass](https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-omr-bypass) *Description:* Luci interface to bypass domains, IPs and networks with shadowsocks @@ -74,7 +74,7 @@ Domains, IPs, networks and protocol (using DPI) added are bypassed when shadowso ## omr-tracker -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-tracker](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-tracker) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/omr-tracker](https://github.com/suyuan168/3grouter-feeds/tree/master/omr-tracker) *Description:* Track connection status. This check if gateway is up then check if the connection work. If it's not working this execute scripts. This also detect if ShadowSocks is up or not. @@ -82,7 +82,7 @@ This is used for OpenMPTCProuter failover. ## luci-omr-tracker -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-omr-tracker](https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-omr-tracker) *Description:* Luci interface to omr-tracker @@ -90,37 +90,37 @@ Interface to omr-tracker. ## luci-app-iperf -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-iperf](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-iperf) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-iperf](https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-iperf) *Description:* Luci interface to iPerf ## omr-6in4 -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-6in4](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-6in4) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/omr-6in4](https://github.com/suyuan168/3grouter-feeds/tree/master/omr-6in4) *Description:* Set tunnel configuration by tracking tunnel configuration. ## omr-update -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-update](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-update) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/omr-update](https://github.com/suyuan168/3grouter-feeds/tree/master/omr-update) *Description:* Update old config with new settings. ## luci-app-mptcp -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-mptcp](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-mptcp) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-mptcp](https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-mptcp) *Description:* Luci interface for all MPTCP settings ## luci-app-openmptcprouter -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-openmptcprouter](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-openmptcprouter) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-openmptcprouter](https://github.com/suyuan168/3grouter-feeds/tree/master/luci-app-openmptcprouter) *Description:* Wizard for OpenMPTCProuter settings and status page ## mptcp -*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/mptcp](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/mptcp) +*Source:* [https://github.com/suyuan168/3grouter-feeds/tree/master/mptcp](https://github.com/suyuan168/3grouter-feeds/tree/master/mptcp) *Description:* This package set all MPTCP settings From f7c5b7330cc72f77932025799c85aa2f40e3c1e7 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 23 Jun 2021 11:29:09 +0800 Subject: [PATCH 04/33] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e9edfcd2c..4f61bad85 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # OpenWrt OpenMPTCProuter feed +1 This is the OpenWrt OpenMPTCProuter feed containing all modified and necessary packages to build the OpenMPTCProuter image. From 01b1f23ad97fa52452de2926dc7ff2be76962cf7 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 23 Jun 2021 11:29:20 +0800 Subject: [PATCH 05/33] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 4f61bad85..e9edfcd2c 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # OpenWrt OpenMPTCProuter feed -1 This is the OpenWrt OpenMPTCProuter feed containing all modified and necessary packages to build the OpenMPTCProuter image. From c804cd3b8f021ece14e010380fb03c997204bf1e Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 24 Jun 2021 17:10:35 +0200 Subject: [PATCH 06/33] Update https-dns-proxy --- https-dns-proxy/Makefile | 10 +-- https-dns-proxy/files/README.md | 96 +--------------------- https-dns-proxy/files/https-dns-proxy.init | 51 ++++++++---- https-dns-proxy/test.sh | 3 + 4 files changed, 44 insertions(+), 116 deletions(-) create mode 100644 https-dns-proxy/test.sh diff --git a/https-dns-proxy/Makefile b/https-dns-proxy/Makefile index 331318402..73d0a07cf 100644 --- a/https-dns-proxy/Makefile +++ b/https-dns-proxy/Makefile @@ -1,14 +1,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=https-dns-proxy -PKG_VERSION:=2021-01-17 -PKG_RELEASE=2 +PKG_VERSION:=2021-06-03 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy -PKG_SOURCE_DATE:=2021-01-17 -PKG_SOURCE_VERSION:=37511cc08712d7548978a4f6f1cc457b7594fb96 -PKG_MIRROR_HASH:=4e6a7dcb69e350d1df9f17570439b589e031e249da7f91f2ec7600a955e0aaa3 +PKG_SOURCE_DATE:=2021-06-03 +PKG_SOURCE_VERSION:=5651b984f770a8bcecb14aeffc224703f8f82586 +PKG_MIRROR_HASH:=b65161936269aa3117debad0fcfce157024726b78d7e7da77c226f7aa8da5b4d PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/https-dns-proxy/files/README.md b/https-dns-proxy/files/README.md index 87e548462..7ebf479e6 100644 --- a/https-dns-proxy/files/README.md +++ b/https-dns-proxy/files/README.md @@ -1,95 +1,3 @@ -# DNS Over HTTPS Proxy (https-dns-proxy) +# README -A lean RFC8484-compatible (no JSON API support) DNS-over-HTTPS (DoH) proxy service which supports DoH servers ran by AdGuard, CleanBrowsing, Cloudflare, Google, ODVR (nic.cz) and Quad9. Please see the [README](https://github.com/stangri/openwrt_packages/blob/master/https-dns-proxy/files/README.md) for further information. Based on [@aarond10](https://github.com/aarond10)'s [https-dns-proxy](https://github.com/aarond10/https_dns_proxy). - -## Features - -- [RFC8484](https://tools.ietf.org/html/rfc8484)-compatible DoH Proxy. -- Compact size. -- Web UI (```luci-app-https-dns-proxy```) available. -- (By default) automatically updates DNSMASQ settings to use DoH proxy when it's started and reverts to old DNSMASQ resolvers when DoH proxy is stopped. - -## Screenshots (luci-app-https-dns-proxy) - -![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/https-dns-proxy/screenshot01.png "https-dns-proxy screenshot") - -## Requirements - -This proxy requires the following packages to be installed on your router: ```libc```, ```libcares```, ```libcurl```, ```libev```, ```ca-bundle```. They will be automatically installed when you're installing ```https-dns-proxy```. - -## Unmet Dependencies - -If you are running a development (trunk/snapshot) build of OpenWrt/LEDE Project on your router and your build is outdated (meaning that packages of the same revision/commit hash are no longer available and when you try to satisfy the [requirements](#requirements) you get errors), please flash either current LEDE release image or current development/snapshot image. - -## How To Install - -Install ```https-dns-proxy``` and ```luci-app-https-dns-proxy``` packages from Web UI or run the following in the command line: - -```sh -opkg update; opkg install https-dns-proxy luci-app-https-dns-proxy; -``` - -## Default Settings - -Default configuration has service enabled and starts the service with Google and Cloudflare DoH servers. In most configurations, you will keep the default ```DNSMASQ``` service installed to handle requests from devices in your local network and point ```DNSMASQ``` to use ```https-dns-proxy``` for name resolution. - -By default, the service will intelligently override existing ```DNSMASQ``` servers settings on start to use the DoH servers and restores original ```DNSMASQ``` servers on stop. See the [Configuration Settings](#configuration-settings) section below for more information and how to disable this behavior. - -## Configuration Settings - -Configuration contains the (named) "main" config section where you can configure which ```DNSMASQ``` settings the service will automatically affect and the typed (unnamed) https-dns-proxy instance settings. The original config file is included below: - -```text -config main 'config' - option update_dnsmasq_config '*' - -config https-dns-proxy - option bootstrap_dns '8.8.8.8,8.8.4.4' - option resolver_url 'https://dns.google/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5053' - option user 'nobody' - option group 'nogroup' - -config https-dns-proxy - option bootstrap_dns '1.1.1.1,1.0.0.1' - option resolver_url 'https://cloudflare-dns.com/dns-query' - option listen_addr '127.0.0.1' - option listen_port '5054' - option user 'nobody' - option group 'nogroup' -``` - -The ```update_dnsmasq_config``` option can be set to dash (set to ```'-'``` to not change ```DNSMASQ``` server settings on start/stop), can be set to ```'*'``` to affect all ```DNSMASQ``` instance server settings or have a space-separated list of ```DNSMASQ``` instances to affect (like ```'0 4 5'```). If this option is omitted, the default setting is ```'*'```. - -Starting with ```https-dns-proxy``` version ```2019-12-03-3``` and higher, when the service is set to update the DNSMASQ servers setting on start/stop, it does not override entries which contain either ```#``` or ```/```, so the entries like listed below will be kept in use: - -```test - list server '/onion/127.0.0.1#65453' - list server '/openwrt.org/8.8.8.8' - list server '/pool.ntp.org/8.8.8.8' - list server '127.0.0.1#15353' - list server '127.0.0.1#55353' - list server '127.0.0.1#65353' -``` - -The https-dns-proxy instance settings are: - -|Parameter|Type|Default|Description| -| --- | --- | --- | --- | -|bootstrap_dns|IP Address||The non-encrypted DNS servers to be used to resolve the DoH server name on start.| -|edns_subnet|Subnet||EDNS Subnet address can be supplied to supported DoH servers to provide local resolution results.| -|listen_addr|IP Address|127.0.0.1|The local IP address to listen to requests.| -|listen_port|port|5053 and up|If this setting is omitted, the service will start the first https-dns-proxy instance on port 5053, second on 5054 and so on.| -|logfile|Full filepath||Full filepath to the file to log the instance events to.| -|resolver_url|URL||The https URL to the RFC8484-compatible resolver.| -|proxy_server|URL||Local proxy server to use when accessing resolvers.| -|user|String|nobody|Local user to run instance under.| -|group|String|nogroup|Local group to run instance under.| -|use_http1|Boolean|0|If set to 1, use HTTP/1 on installations with broken/outdated ```curl``` package. Included for posterity reasons, you will most likely not ever need it on OpenWrt.| -|verbosity|Integer|0|logging verbosity level. fatal = 0, error = 1, warning = 2, info = 3, debug = 4| -|use_ipv6_resolvers_only|Boolean|0|If set to 1, Forces IPv6 DNS resolvers instead of IPv4| - -## Thanks - -This OpenWrt package wouldn't have been possible without [@aarond10](https://github.com/aarond10)'s [https-dns-proxy](https://github.com/aarond10/https_dns_proxy) and his active participation in the OpenWrt package itself. Special thanks to [@jow-](https://github.com/jow-) for general package/luci guidance. +README has been moved to [https://docs.openwrt.melmac.net/https-dns-proxy/](https://docs.openwrt.melmac.net/https-dns-proxy/). diff --git a/https-dns-proxy/files/https-dns-proxy.init b/https-dns-proxy/files/https-dns-proxy.init index 64bf7eccf..8b8680763 100755 --- a/https-dns-proxy/files/https-dns-proxy.init +++ b/https-dns-proxy/files/https-dns-proxy.init @@ -1,6 +1,6 @@ #!/bin/sh /etc/rc.common # Copyright 2019-2020 Stan Grishin (stangri@melmac.net) -# shellcheck disable=SC2039 +# shellcheck disable=SC2039,SC3043,SC3060 PKG_VERSION='dev-test' # shellcheck disable=SC2034 @@ -16,8 +16,7 @@ else fi readonly PROG=/usr/sbin/https-dns-proxy -dnsmasqConfig='' -forceDNS='1' +dnsmasqConfig=''; forceDNS=''; forceDNSPorts=''; version() { echo "$PKG_VERSION"; } @@ -95,10 +94,11 @@ start_instance() { is_force_dns_active() { iptables-save | grep -q -w -- '--dport 53'; } start_service() { - local p=5053 + local p=5053 c config_load 'https-dns-proxy' config_get dnsmasqConfig 'config' 'update_dnsmasq_config' '*' config_get_bool forceDNS 'config' 'force_dns' '1' + config_get forceDNSPorts 'config' 'force_dns_port' '53 853' dhcp_backup 'create' config_load 'https-dns-proxy' config_foreach start_instance 'https-dns-proxy' @@ -109,16 +109,28 @@ start_service() { procd_set_param stderr 1 procd_open_data json_add_array firewall - json_add_object '' - json_add_string type redirect - json_add_string name https_dns_proxy_dns_redirect - json_add_string target DNAT - json_add_string src lan - json_add_string proto tcpudp - json_add_string src_dport 53 - json_add_string dest_port 53 - json_add_string reflection 0 - json_close_object + for c in $forceDNSPorts; do + if netstat -tuln | grep 'LISTEN' | grep ":${c}" >/dev/null 2>&1 || [ "$c" = "53" ]; then + json_add_object "" + json_add_string type redirect + json_add_string target DNAT + json_add_string src lan + json_add_string proto "tcp udp" + json_add_string src_dport "$c" + json_add_string dest_port "$c" + json_add_boolean reflection 0 + json_close_object + else + json_add_object "" + json_add_string type rule + json_add_string src lan + json_add_string dest "*" + json_add_string proto "tcp udp" + json_add_string dest_port "$c" + json_add_string target REJECT + json_close_object + fi + done json_close_array procd_close_data procd_close_instance @@ -159,7 +171,7 @@ dnsmasq_add_doh_server() { dnsmasq_create_server_backup() { local cfg="$1" local i - uci -q get "dhcp.${cfg}" >/dev/null || return 0 + uci -q get "dhcp.${cfg}" >/dev/null || return 1 if ! uci -q get "dhcp.${cfg}.doh_backup_noresolv" >/dev/null; then if [ -z "$(uci -q get "dhcp.${cfg}.noresolv")" ]; then uci -q set "dhcp.${cfg}.noresolv=1" @@ -170,13 +182,17 @@ dnsmasq_create_server_backup() { fi fi if ! uci -q get "dhcp.${cfg}.doh_backup_server" >/dev/null; then + if [ -z "$(uci -q get "dhcp.${cfg}.server")" ]; then + uci -q add_list "dhcp.${cfg}.doh_backup_server=" + fi for i in $(uci -q get "dhcp.${cfg}.server"); do uci -q add_list "dhcp.${cfg}.doh_backup_server=$i" - if [ "$i" = "${i//127.0.0.1}" ] && [ "$i" = "$(echo "$i" | tr -d /)" ]; then + if [ "$i" = "$(echo "$i" | tr -d /\#)" ]; then uci -q del_list "dhcp.${cfg}.server=$i" fi done fi + return 0 } dnsmasq_restore_server_backup() { @@ -209,7 +225,8 @@ dhcp_backup() { config_foreach dnsmasq_create_server_backup 'dnsmasq' elif [ -n "$dnsmasqConfig" ]; then for i in $dnsmasqConfig; do - dnsmasq_create_server_backup "@dnsmasq[${i}]" + dnsmasq_create_server_backup "@dnsmasq[${i}]" || \ + dnsmasq_create_server_backup "$i" done fi ;; diff --git a/https-dns-proxy/test.sh b/https-dns-proxy/test.sh new file mode 100644 index 000000000..45469ed96 --- /dev/null +++ b/https-dns-proxy/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/etc/init.d/"$1" version 2>&1 | grep "$2" From 1afd6496522f517c4fa8f636d85f270f5cc05749 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 24 Jun 2021 17:11:08 +0200 Subject: [PATCH 07/33] Add parameter to help with cache --- .../root/www/luci-static/resources/sysupgrade.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-sysupgrade/root/www/luci-static/resources/sysupgrade.js b/luci-app-sysupgrade/root/www/luci-static/resources/sysupgrade.js index 8cbbced97..5750ad0b5 100644 --- a/luci-app-sysupgrade/root/www/luci-static/resources/sysupgrade.js +++ b/luci-app-sysupgrade/root/www/luci-static/resources/sysupgrade.js @@ -164,7 +164,7 @@ function upgrade_check() { hide("#status_box"); hide("#server_div"); set_status("info", _("Searching for upgrades"), true); - fetch(data.url + "/api/versions") + fetch(data.url + "/api/versions?v=" + Date.now()) .then(response => response.json()) .then(response => { var branches = response["branches"] @@ -348,7 +348,7 @@ function download_image() { } function server_request() { - fetch(data.url + "/api/build", { + fetch(data.url + "/api/build?v=" + Date.now(), { method: 'POST', headers: { 'Content-Type': 'application/json' From 78334e33855f673b6f29173361065694862f4291 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 24 Jun 2021 17:11:41 +0200 Subject: [PATCH 08/33] Fix shadowsocks dependencie --- shadowsocks-libev/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks-libev/Makefile b/shadowsocks-libev/Makefile index 4f09cf2ba..00c12c7f5 100644 --- a/shadowsocks-libev/Makefile +++ b/shadowsocks-libev/Makefile @@ -57,7 +57,7 @@ define Package/shadowsocks-libev/Default SUBMENU:=Web Servers/Proxies TITLE:=shadowsocks-libev $(1) URL:=https://github.com/shadowsocks/shadowsocks-libev - DEPENDS:=+libcares +libev +libmbedtls +libpcre +libpthread +libsodium +shadowsocks-libev-config +zlib +libpcap +libcap +libstdcpp +libelf1 + DEPENDS:=+libcares +libev +libmbedtls +libpcre +libpthread +libsodium +shadowsocks-libev-config +zlib +libpcap +libcap +libstdcpp +libelf endef define Package/shadowsocks-libev-$(1)/install From dd16ae03f596269851652a24ccc3a58545af6b39 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 24 Jun 2021 17:12:12 +0200 Subject: [PATCH 09/33] Add iperf3 with patch to fix compilation issue --- iperf3/Makefile | 83 +++++++++++++++++++ iperf3/patches/remove-in6_flowlabel_req.patch | 24 ++++++ 2 files changed, 107 insertions(+) create mode 100644 iperf3/Makefile create mode 100644 iperf3/patches/remove-in6_flowlabel_req.patch diff --git a/iperf3/Makefile b/iperf3/Makefile new file mode 100644 index 000000000..1d0d891ef --- /dev/null +++ b/iperf3/Makefile @@ -0,0 +1,83 @@ +# +# Copyright (C) 2007-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=iperf +PKG_VERSION:=3.10.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf +PKG_HASH:=03bc9760cc54a245191d46bfc8edaf8a4750f0e87abca6764486972044d6715a + +PKG_MAINTAINER:=Felix Fietkau +PKG_LICENSE:=BSD-3-Clause + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +DISABLE_NLS:= + +define Package/iperf3/default + SECTION:=net + CATEGORY:=Network + TITLE:=Internet Protocol bandwidth measuring tool + URL:=https://github.com/esnet/iperf +endef + +define Package/iperf3 +$(call Package/iperf3/default) + VARIANT:=nossl +endef + +define Package/iperf3-ssl +$(call Package/iperf3/default) + TITLE+= with iperf_auth support + VARIANT:=ssl + DEPENDS:= +libopenssl +endef + +TARGET_CFLAGS += -D_GNU_SOURCE +CONFIGURE_ARGS += --disable-shared + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS += --without-openssl +endif + +MAKE_FLAGS += noinst_PROGRAMS= + +define Package/iperf3/description + Iperf is a modern alternative for measuring TCP and UDP bandwidth + performance, allowing the tuning of various parameters and + characteristics. +endef + +# autoreconf fails if the README file isn't present +define Build/Prepare + $(call Build/Prepare/Default) + touch $(PKG_BUILD_DIR)/README +endef + +define Package/iperf3/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ +endef + +define Package/iperf3-ssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,iperf3)) +$(eval $(call BuildPackage,iperf3-ssl)) diff --git a/iperf3/patches/remove-in6_flowlabel_req.patch b/iperf3/patches/remove-in6_flowlabel_req.patch new file mode 100644 index 000000000..3d2be694f --- /dev/null +++ b/iperf3/patches/remove-in6_flowlabel_req.patch @@ -0,0 +1,24 @@ +--- a/src/flowlabel.h 2021-06-24 13:26:33.142463630 +0200 ++++ b/src/flowlabel.h 2021-06-24 13:27:45.669235179 +0200 +@@ -37,21 +37,6 @@ + conflicts with "netinet/in.h" . + */ + +-#ifndef __ANDROID__ +-struct in6_flowlabel_req +-{ +- struct in6_addr flr_dst; +- __u32 flr_label; +- __u8 flr_action; +- __u8 flr_share; +- __u16 flr_flags; +- __u16 flr_expires; +- __u16 flr_linger; +- __u32 __flr_pad; +- /* Options in format of IPV6_PKTOPTIONS */ +-}; +-#endif +- + #define IPV6_FL_A_GET 0 + #define IPV6_FL_A_PUT 1 + #define IPV6_FL_A_RENEW 2 From ff0060d8b2b22d90b37da6d2afc18d5256e923a4 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Fri, 25 Jun 2021 14:01:10 +0800 Subject: [PATCH 10/33] update modem --- libmbim/Makefile | 2 +- libqmi/Makefile | 2 +- modemmanager/Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmbim/Makefile b/libmbim/Makefile index b9563219e..44a666cc6 100644 --- a/libmbim/Makefile +++ b/libmbim/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git -PKG_SOURCE_VERSION:=c90c7c5b877de6e413b4833aaf1a42d2d128b051 +PKG_SOURCE_VERSION:=c1aef5ca1f03ca108fb279de1a1d68ac021745c8 PKG_NAME:=libmbim PKG_VERSION:=1.25.3-$(PKG_SOURCE_VERSION) diff --git a/libqmi/Makefile b/libqmi/Makefile index a10ea0121..c83ac5bc5 100644 --- a/libqmi/Makefile +++ b/libqmi/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git -PKG_SOURCE_VERSION:=29fab8a1d4496ca5a1d32bb486013b1868a718ba +PKG_SOURCE_VERSION:=e3664bfdea485a94ee3e75114111e1c332cadc43 PKG_NAME:=libqmi PKG_VERSION:=1.29.3-$(PKG_SOURCE_VERSION) PKG_RELEASE:=10 diff --git a/modemmanager/Makefile b/modemmanager/Makefile index d16b72d12..de889b5bb 100644 --- a/modemmanager/Makefile +++ b/modemmanager/Makefile @@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git -PKG_SOURCE_VERSION:=d77d8dff420dc70d6191b67e172e1df5c4e009bf +PKG_SOURCE_VERSION:=b0f40cf966e546a4173fdd4f8deb0f24eb7eb179 PKG_NAME:=modemmanager -PKG_VERSION:=1.16.3-$(PKG_SOURCE_VERSION) +PKG_VERSION:=1.16.6-$(PKG_SOURCE_VERSION) PKG_RELEASE:=10 #PKG_BUILD_DIR:=$(BUILD_DIR)/modemamanager-$ From 1f15378d567ae410702de87a6d496f62ef2aca5e Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 25 Jun 2021 19:39:19 +0200 Subject: [PATCH 11/33] Change VPN to use device instead of ifname --- dsvpn/files/init | 2 +- glorytun-udp/init | 2 +- glorytun/init | 2 +- mlvpn/files/etc/init.d/mlvpn | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dsvpn/files/init b/dsvpn/files/init index 250c409df..1d78ed4be 100755 --- a/dsvpn/files/init +++ b/dsvpn/files/init @@ -49,7 +49,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ] && [ "$(uci -q get network.omrvpn)" != "$dev" ]; then - uci -q set network.omrvpn.ifname=$dev + uci -q set network.omrvpn.device=$dev uci -q commit fi diff --git a/glorytun-udp/init b/glorytun-udp/init index e9f7caf7c..f5086024f 100755 --- a/glorytun-udp/init +++ b/glorytun-udp/init @@ -50,7 +50,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ]; then - uci -q set network.omrvpn.ifname=$dev + uci -q set network.omrvpn.device=$dev uci -q commit fi diff --git a/glorytun/init b/glorytun/init index f5b868323..3d549f0aa 100755 --- a/glorytun/init +++ b/glorytun/init @@ -59,7 +59,7 @@ start_instance() { key="" if [ "$(uci -q get network.omrvpn)" != "" ]; then - uci -q set network.omrvpn.ifname=${dev} + uci -q set network.omrvpn.device=${dev} uci -q commit network fi _log "starting ${PROG_NAME} ${1} instance $*" diff --git a/mlvpn/files/etc/init.d/mlvpn b/mlvpn/files/etc/init.d/mlvpn index 6ef4bfdc6..33f6e75a9 100755 --- a/mlvpn/files/etc/init.d/mlvpn +++ b/mlvpn/files/etc/init.d/mlvpn @@ -13,7 +13,8 @@ interface_multipath_settings() { mode="$(uci -q get openmptcprouter.$config.multipath)" } [ "$mode" = "off" ] || [ "$mode" = "" ] && return 1 - config_get ifname "$config" ifname + config_get ifname "$config" device + [ -z "$ifname" ] && config_get ifname "$config" ifname [ -z "$ifname" ] && ifname=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]') [ -n "$(echo $ifname | grep '@')" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["device"]') [ -z "$ifname" ] && return 1 @@ -46,7 +47,7 @@ start() { firstport="$(uci -q get mlvpn.general.firstport)" if [ "$(uci -q get network.omrvpn)" != "${interface_name}" ]; then - uci -q set network.omrvpn.ifname=${interface_name} + uci -q set network.omrvpn.device=${interface_name} uci -q commit fi From 04b15901fa627b77c46756e3289166f07e480c88 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 25 Jun 2021 19:40:55 +0200 Subject: [PATCH 12/33] Change luci glorytun interface to use device instead of ifname uci setting --- luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun | 2 +- .../root/etc/uci-defaults/1201-luci-glorytun-udp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun b/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun index 9d0f93d85..a15f491be 100644 --- a/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun +++ b/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun @@ -15,7 +15,7 @@ if [ "$(uci -q get network.glorytun)" = "" ] && [ "$(uci -q get network.omrvpn)" uci -q batch <<-EOF >/dev/null delete network.glorytun set network.glorytun=interface - set network.glorytun.ifname=tun0 + set network.glorytun.device=tun0 set network.glorytun.proto=dhcp set network.glorytun.ip4table=vpn set network.glorytun.multipath=off diff --git a/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp index dbecf5b5b..ebe335318 100644 --- a/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp +++ b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp @@ -11,7 +11,7 @@ if [ "$(uci -q get network.glorytun-udp)" = "" ] && [ "$(uci -q get network.omrv uci -q batch <<-EOF >/dev/null delete network.glorytun-udp set network.glorytun-udp=interface - set network.glorytun-udp.ifname=tun0 + set network.glorytun-udp.device=tun0 set network.glorytun-udp.proto=dhcp set network.glorytun-udp.ip4table=vpn set network.glorytun-udp.multipath=off From 72f5756eb5949de5c838b7948c97652225f2f37c Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 25 Jun 2021 19:42:03 +0200 Subject: [PATCH 13/33] Change in luci-app-openmptcprouter to use device setting --- .../luasrc/controller/openmptcprouter.lua | 46 +++++++++++++++---- .../luasrc/view/openmptcprouter/wizard.htm | 8 ++-- .../root/etc/init.d/openmptcprouter | 6 ++- .../root/usr/libexec/rpcd/openmptcprouter | 21 +++++---- 4 files changed, 58 insertions(+), 23 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 3d243b210..cca82d950 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -26,7 +26,11 @@ end function interface_from_device(dev) for _, iface in ipairs(net:get_networks()) do local ifacen = iface:name() - local ifacename = ucic:get("network",ifacen,"ifname") + local ifacename = "" + ifacename = ucic:get("network",ifacen,"device") + if ifacename == "" then + ifacename = ucic:get("network",ifacen,"ifname") + end if ifacename == dev then return ifacen end @@ -113,7 +117,10 @@ function wizard_add() end) local defif = "eth0" if add_interface_ifname == "" then - local defif1 = ucic:get("network","wan1_dev","ifname") or "" + local defif1 = ucic:get("network","wan1_dev","device") or "" + if defif1 == "" then + defif1 = ucic:get("network","wan1_dev","ifname") or "" + end if defif1 ~= "" then defif = defif1 end @@ -126,17 +133,29 @@ function wizard_add() if ointf ~= "" then if ucic:get("network",ointf,"type") == "" then ucic:set("network",ointf,"type","macvlan") + ucic:set("network",ointf,"device",ointf) + ucic:set("network",ointf .. "_dev","device") + ucic:set("network",ointf .. "_dev","type","macvlan") + ucic:set("network",ointf .. "_dev","mode","vepa") + ucic:set("network",ointf .. "_dev","ifname",defif) + ucic:set("network",ointf .. "_dev","name",ointf) end wanif = "wan" .. i end ucic:set("network","wan" .. i,"interface") - ucic:set("network","wan" .. i,"ifname",defif) + ucic:set("network","wan" .. i,"device",defif) ucic:set("network","wan" .. i,"proto","static") ucic:set("openmptcprouter","wan" .. i,"interface") if ointf ~= "" then ucic:set("network","wan" .. i,"type","macvlan") + ucic:set("network","wan" .. i,"device","wan" .. i) ucic:set("network","wan" .. i,"masterintf",defif) + ucic:set("network","wan" .. i .. "_dev","device") + ucic:set("network","wan" .. i .. "_dev","type","macvlan") + ucic:set("network","wan" .. i .. "_dev","mode","vepa") + ucic:set("network","wan" .. i .. "_dev","ifname",defif) + ucic:set("network","wan" .. i .. "_dev","name","wan" .. i) end ucic:set("network","wan" .. i,"ip4table","wan") if multipath_master then @@ -197,7 +216,10 @@ function wizard_add() local delete_intf = luci.http.formvaluetable("delete") or "" if delete_intf ~= "" then for intf, _ in pairs(delete_intf) do - local defif = ucic:get("network",intf,"ifname") + local defif = ucic:get("network",intf,"ifname") or "" + if defif == "" then + defif = ucic:get("network",intf,"ifname") + end ucic:delete("network",intf) if ucic:get("network",intf .. "_dev") ~= "" then ucic:delete("network",intf .. "_dev") @@ -262,9 +284,14 @@ function wizard_add() end if typeintf == "macvlan" and masterintf ~= "" then ucic:set("network",intf,"type","macvlan") + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","type","macvlan") + ucic:set("network",intf .. "_dev","ifname",masterinf) + ucic:set("network",intf .. "_dev","mode","vepa") + ucic:set("network",intf .. "_dev","name",intf) ucic:set("network",intf,"masterintf",masterintf) elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" or proto == "dhcpv6") then - ucic:set("network",intf,"ifname",ifname) + ucic:set("network",intf,"device",ifname) elseif typeintf == "" and device ~= "" and proto == "ncm" then ucic:set("network",intf,"device",device_ncm) elseif typeintf == "" and device ~= "" and proto == "qmi" then @@ -342,7 +369,10 @@ function wizard_add() if not ucic:get("sqm",intf) ~= "" then local defif = get_device(intf) if defif == "" then - defif = ucic:get("network",intf,"ifname") or "" + defif = ucic:get("network",intf,"device") or "" + if defif == "" then + defif = ucic:get("network",intf,"ifname") or "" + end end ucic:set("sqm",intf,"queue") ucic:set("sqm",intf,"interface",defif) @@ -442,7 +472,7 @@ function wizard_add() ucic:set("network","omrvpn","proto","bonding") end if vpn_intf ~= "" then - ucic:set("network","omrvpn","ifname",vpn_intf) + ucic:set("network","omrvpn","device",vpn_intf) ucic:set("sqm","omrvpn","interface",vpn_intf) ucic:save("network") ucic:commit("network") @@ -894,7 +924,7 @@ function wizard_add() -- Restart all menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter" if gostatus == true then - luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null") + --luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null") luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null") luci.sys.call("ip addr flush dev tun0 >/dev/null 2>/dev/null") luci.sys.call("/etc/init.d/omr-tracker stop >/dev/null 2>/dev/null") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 2c33cfa2d..13cbffcf2 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -473,7 +473,7 @@ if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*") or ifacea:match("^bond.*")) and device_notvirtual(ifacea) then if uci:get("network",ifname,"proto") ~= "macvlan" then %> - + <% else %> @@ -483,9 +483,9 @@ end end if uci:get("network",ifname,"proto") ~= "macvlan" then - if iffind == 0 and uci:get("network",ifname,"ifname") ~= nil then + if iffind == 0 and uci:get("network",ifname,"device") ~= nil then %> - + <% end else @@ -616,7 +616,7 @@