1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'test' into ipq60xx

This commit is contained in:
suyuan168 2022-06-03 16:15:48 +08:00
commit 123912e016
10 changed files with 49 additions and 29 deletions

41
.github/workflows/main.yml vendored Executable file → Normal file
View file

@ -2,13 +2,13 @@ name: openmptcprouter
on: [push]
env:
REPO_URL: 'https://github.com/suyuan168/3grouter'
REPO_URL: 'https://github.com/ysurac/openmptcprouter'
jobs:
build:
strategy:
matrix:
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, cm520-79f, x86_64, ubnt-erx, r4s, r7800, rutx, l1000, zbt4019]
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx]
OMR_KERNEL: [5.4, 5.15]
runs-on: ubuntu-latest
continue-on-error: true
@ -39,7 +39,7 @@ jobs:
- name: Clone source code
working-directory: ../../
env:
REPO_URL: https://github.com/suyuan168/3grouter
REPO_URL: https://github.com/ysurac/openmptcprouter
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
run: |
@ -58,7 +58,7 @@ jobs:
- name: Build toolchain
working-directory: ../../omr
env:
OMR_FEED_URL: https://github.com/suyuan168/openmptcprouter-feeds
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
OMR_TARGET: ${{ matrix.OMR_TARGET }}
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
@ -66,27 +66,27 @@ jobs:
OMR_PORT: ${{ secrets.OMR_PORT }}
run: |
OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j$(nproc) || OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j1 V=s
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/source/key-build
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/source/key-build.pub
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build.pub
- name: Build packages
working-directory: ../../omr
env:
OMR_TARGET: ${{ matrix.OMR_TARGET }}
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
run: |
cat "feeds/openmptcprouter/openmptcprouter/files/etc/init.d/getserveratboot"
sudo rm -rf "feeds/openmptcprouter/openmptcprouter/files/etc/init.d/getserveratboot" >/dev/null 2>&1 || true
make IGNORE_ERRORS=m -C $OMR_TARGET/source package/{compile,install,index} -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/source package/{compile,install,index} -j1 V=s
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index} -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index} -j1 V=s
- name: Build image
working-directory: ../../omr
env:
OMR_TARGET: ${{ matrix.OMR_TARGET }}
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
run: |
make IGNORE_ERRORS=m -C $OMR_TARGET/source target/install -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/source target/install -j1 V=s
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install -j1 V=s
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.OMR_TARGET }}
path: /home/runner/work/omr/${{ matrix.OMR_TARGET }}/source/bin
path: /home/runner/work/omr/${{ matrix.OMR_TARGET }}/${{ matrix.OMR_KERNEL }}/source/bin
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
name: Deploy - Create directory
uses: ysurac/ssh-action@master
@ -96,9 +96,9 @@ jobs:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
with:
command: |
mkdir -p /www/wwwroot/55860.com/bak/down/release/${{env.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
mkdir -p deploy/release/${{env.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
host: ${{ secrets.OMR_DEPLOY_HOST }}
user: root
user: deploy
port: ${{ secrets.OMR_DEPLOY_PORT }}
key: ${{ secrets.PRIVATE_KEY }}
args: -tt
@ -111,9 +111,9 @@ jobs:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
with:
command: |
mkdir -p /www/wwwroot/55860.com/bak/down/${{env.SOURCE_BRANCH}}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
mkdir -p deploy/${{env.SOURCE_BRANCH}}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
host: ${{ secrets.OMR_DEPLOY_HOST }}
user: root
user: deploy
port: ${{ secrets.OMR_DEPLOY_PORT }}
key: ${{ secrets.PRIVATE_KEY }}
args: -tt
@ -121,18 +121,19 @@ jobs:
working-directory: ../../omr
env:
OMR_TARGET: ${{ matrix.OMR_TARGET }}
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
run: |
mv ${OMR_TARGET}/source/bin ${GITHUB_WORKSPACE}/
mv ${OMR_TARGET}/${OMR_KERNEL}/source/bin ${GITHUB_WORKSPACE}/
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
name: Deploy - Upload via rsync
uses: ysurac/action-rsync@master
env:
ARGS: -av --delete-after
TARGET: /www/wwwroot/55860.com/bak/down/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
TARGET: deploy/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
SOURCE: ./bin/
KEY: ${{ secrets.PRIVATE_KEY }}
USER: root
USER: deploy
HOST: ${{ secrets.OMR_DEPLOY_HOST }}
PORT: ${{ secrets.OMR_DEPLOY_PORT }}
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
@ -144,10 +145,10 @@ jobs:
uses: ysurac/action-rsync@master
env:
ARGS: -av --delete-after
TARGET: /www/wwwroot/55860.com/bak/down/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
TARGET: deploy/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
SOURCE: ./bin/
KEY: ${{ secrets.PRIVATE_KEY }}
USER: root
USER: deploy
HOST: ${{ secrets.OMR_DEPLOY_HOST }}
PORT: ${{ secrets.OMR_DEPLOY_PORT }}
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}

View file

@ -167,6 +167,7 @@ function wizard_add()
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)
ucic:set("network","wan" .. i .. "_dev","txqueuelen","20")
end
ucic:set("network","wan" .. i,"ip4table","wan")
if multipath_master then
@ -282,6 +283,7 @@ function wizard_add()
local auth = luci.http.formvalue("cbid.network.%s.auth" % intf) or ""
local mode = luci.http.formvalue("cbid.network.%s.mode" % intf) or ""
local sqmenabled = luci.http.formvalue("cbid.sqm.%s.enabled" % intf) or "0"
local qosenabled = luci.http.formvalue("cbid.qos.%s.enabled" % intf) or "0"
local multipath = luci.http.formvalue("cbid.network.%s.multipath" % intf) or "on"
local lan = luci.http.formvalue("cbid.network.%s.lan" % intf) or "0"
local ttl = luci.http.formvalue("cbid.network.%s.ttl" % intf) or ""
@ -462,9 +464,12 @@ function wizard_add()
--ucic:set("sqm",intf,"iqdisc_opts","autorate-ingress dual-dsthost")
--ucic:set("sqm",intf,"eqdisc_opts","dual-srchost")
ucic:set("sqm",intf,"enabled","1")
ucic:set("qos",intf,"enabled","1")
else
ucic:set("sqm",intf,"enabled","0")
end
if qosenabled == "1" then
ucic:set("qos",intf,"enabled","1")
else
ucic:set("qos",intf,"enabled","0")
end
end

View file

@ -256,7 +256,7 @@
<input type="checkbox" name="disableserverhttptest" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disableserverhttptest") == "1" then %>checked<% end %>>
<br />
<div class="cbi-value-description">
<%:Disable HTTP test on Server API in status page%>
<%:Disable HTTP test on Server API%>
</div>
</div>
</div>

View file

@ -165,7 +165,7 @@ start_service() {
fi
if [ "$(uci -q get openmptcprouter.settings.sfe_enabled)" = "1" ]; then
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe fast_classifier 2>&1 >/dev/null
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe -q fast_classifier 2>&1 >/dev/null
if [ "$(uci -q get openmptcprouter.settings.sfe_bridge)" = "1" ]; then
echo 1 >/sys/fast_classifier/skip_to_bridge_ingress
else

View file

@ -134,6 +134,7 @@ else
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
IP=$(ifconfig $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
[ -z "$ID" ] && ID=$(ip mptcp endpoint show | grep "$IP" | awk '{print $3}')
RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }')
[ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null
case $TYPE in

View file

@ -478,6 +478,7 @@ set_server_all_routes() {
fi
fi
}
config_load openmptcprouter
config_list_foreach $server ip server_route
}
@ -525,6 +526,7 @@ set_server_all_routes6() {
fi
fi
}
config_load openmptcprouter
config_list_foreach $server ip server_route
}

View file

@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libell
DEPENDS:=+libell @LINUX_5_15
TITLE:=mptcpd
URL:=https://github.com/intel/mptcpd
endef

View file

@ -153,7 +153,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return
@ -166,7 +166,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return
@ -392,7 +392,7 @@ while true; do
config_load openmptcprouter
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
if [ "$serverip_ping" = false ]; then
OMR_TRACKER_STATUS="ERROR"
#OMR_TRACKER_STATUS="ERROR"
OMR_TRACKER_STATUS_MSG="No access to server API"
else
OMR_TRACKER_STATUS_MSG=""
@ -493,7 +493,7 @@ while true; do
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
if [ "$serverip_ping" = false ]; then
OMR_TRACKER_STATUS_MSG="No access to server API"
OMR_TRACKER_STATUS="ERROR"
#OMR_TRACKER_STATUS="ERROR"
else
OMR_TRACKER_STATUS_MSG=""
OMR_TRACKER_STATUS="OK"

View file

@ -82,6 +82,8 @@ _check_master() {
commit v2ray
set glorytun.vpn.host=$ip
commit glorytun
glorytun-udp.vpn.host=$ip
commit glorytun
set dsvpn.vpn.host=$ip
commit dsvpn
set mlvpn.general.host=$ip
@ -98,16 +100,20 @@ _check_master() {
/etc/init.d/openvpn restart >/dev/null 2>/dev/null
/etc/init.d/dsvpn restart >/dev/null 2>/dev/null
fi
else
logger -t "OMR-Tracker-Server" "Master server already up"
fi
config_load shadowsocks-libev
config_foreach _enable_redir ss_redir
count=$((count+1))
else
logger -t "OMR-Tracker-Server" "Master server down"
config_load shadowsocks-libev
config_foreach _disable_redir ss_redir
fi
countips=$((countips+1))
}
config_load openmptcprouter
config_list_foreach $1 ip set_ip
#if [ "$server_ping" = true ] && [ "$countips" = "1" ]; then
# uci -q batch <<-EOF >/dev/null
@ -149,6 +155,8 @@ _check_backup() {
commit v2ray
set glorytun.vpn.host=$ip
commit glorytun
glorytun-udp.vpn.host=$ip
commit glorytun
set dsvpn.vpn.host=$ip
commit dsvpn
set mlvpn.general.host=$ip
@ -176,6 +184,7 @@ _check_backup() {
fi
countips=$((countips+1))
}
config_load openmptcprouter
config_list_foreach $1 ip set_ip
#if [ "$server_ping" = true ] && [ "$countips" = "1" ]; then
# uci -q batch <<-EOF >/dev/null
@ -202,6 +211,7 @@ while true; do
config_load openmptcprouter
config_foreach _check_master server
[ "$server_ping" = false ] && {
config_load openmptcprouter
config_foreach _check_backup server
}
sleep "${interval}"

View file

@ -60,7 +60,8 @@ GO_PKG:=github.com/v2fly/v2ray-core/v4
GO_PKG_LDFLAGS:=-s -w
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
#include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
define Package/v2ray-core
TITLE:=A platform for building proxies