mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-04-29 05:53:54 +00:00
Compare commits
66 Commits
test-20200
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
858026dce5 | ||
|
|
c8b8073613 | ||
|
|
4594246d1c | ||
|
|
f370563c8d | ||
|
|
4c56e56e10 | ||
|
|
f61eb3528d | ||
|
|
a72748e721 | ||
|
|
9f55f7a80a | ||
|
|
67c67c8151 | ||
|
|
5303288d1f | ||
|
|
5bdc75ac56 | ||
|
|
20bc614a0d | ||
|
|
34383b4822 | ||
|
|
d2900f10af | ||
|
|
d596fc1459 | ||
|
|
6a9775ec7e | ||
|
|
cd2e72b39f | ||
|
|
bad4399228 | ||
|
|
7507e83f00 | ||
|
|
2368ae18ed | ||
|
|
afd444a45f | ||
|
|
8721073e15 | ||
|
|
38e6e5beec | ||
|
|
9c1a15900c | ||
|
|
44765ef57c | ||
|
|
79a64bf3c0 | ||
|
|
5609506ab1 | ||
|
|
41b60f9401 | ||
|
|
361de1ac89 | ||
|
|
9dcedac61f | ||
|
|
9ec8d389f8 | ||
|
|
9047504b18 | ||
|
|
e4f5c1acee | ||
|
|
408a2f7b96 | ||
|
|
a2c692f420 | ||
|
|
07dd0a23f3 | ||
|
|
db9def4c51 | ||
|
|
30fe9ea66a | ||
|
|
75fe844804 | ||
|
|
f27035c014 | ||
|
|
12e0abf478 | ||
|
|
32e17d5472 | ||
|
|
29b6c598ad | ||
|
|
7c5840c767 | ||
|
|
308681c76f | ||
|
|
54d115a1bf | ||
|
|
7d193990d0 | ||
|
|
d54c894dc0 | ||
|
|
76f69f247e | ||
|
|
cc2d631c80 | ||
|
|
90f37162ab | ||
|
|
312db7f2f5 | ||
|
|
6e6f315ae0 | ||
|
|
fdc855596a | ||
|
|
cf77dee5c7 | ||
|
|
11b53e09e4 | ||
|
|
d502bcb37f | ||
|
|
b4171b97dc | ||
|
|
6a5292033b | ||
|
|
552744aead | ||
|
|
fd58755c7e | ||
|
|
7d1da6b1bf | ||
|
|
ec6576f0d7 | ||
|
|
b988da9396 | ||
|
|
691a5d34ff | ||
|
|
b06c2cf086 |
@@ -20,6 +20,7 @@ jobs:
|
||||
env:
|
||||
BRANCH_NAME: master
|
||||
run: |
|
||||
git fetch origin ${BRANCH_NAME}
|
||||
git checkout ${BRANCH_NAME}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF}
|
||||
@@ -20,6 +20,7 @@ jobs:
|
||||
env:
|
||||
BRANCH_NAME: test
|
||||
run: |
|
||||
git fetch origin ${BRANCH_NAME}
|
||||
git checkout ${BRANCH_NAME}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF}
|
||||
10
.github/workflows/deploy.yaml
vendored
10
.github/workflows/deploy.yaml
vendored
@@ -20,9 +20,10 @@ jobs:
|
||||
env:
|
||||
BRANCH_NAME: master
|
||||
run: |
|
||||
git fetch origin ${BRANCH_NAME}
|
||||
git checkout ${BRANCH_NAME}
|
||||
git clone -b ${BRANCH_NAME} ${CO_REF}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF}
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF}
|
||||
|
||||
test-job:
|
||||
@@ -35,9 +36,10 @@ jobs:
|
||||
env:
|
||||
BRANCH_NAME: test
|
||||
run: |
|
||||
git fetch origin ${BRANCH_NAME}
|
||||
git checkout ${BRANCH_NAME}
|
||||
git clone -b ${BRANCH_NAME} ${CO_REF}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF}
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF}
|
||||
|
||||
dev-job:
|
||||
@@ -50,7 +52,9 @@ jobs:
|
||||
env:
|
||||
BRANCH_NAME: dev
|
||||
run: |
|
||||
git fetch origin ${BRANCH_NAME}
|
||||
git checkout ${BRANCH_NAME}
|
||||
git clone -b ${BRANCH_NAME} ${CO_REF}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF}
|
||||
bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF}
|
||||
|
||||
|
||||
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
@@ -1,6 +1,17 @@
|
||||
name: Main-CI
|
||||
|
||||
on: [push, pull_request]
|
||||
# on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branchs:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
pull_request:
|
||||
branchs:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
@@ -8,12 +19,13 @@ jobs:
|
||||
env:
|
||||
GH_REF: ${{ secrets.GH_REF }}
|
||||
CO_REF: ${{ secrets.CO_REF }}
|
||||
BRANCH_NAME: ${{ github.ref }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Pack And Deploy
|
||||
run: |
|
||||
git clone -b `basename ${BRANCH_NAME}` ${CO_REF}
|
||||
bash ./tools/gitsync.sh pack
|
||||
bash ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${GH_REF}
|
||||
bash ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${CO_REF}
|
||||
bash ./tools/gitsync.sh deploy mbfiles `basename ${BRANCH_NAME}` ${CO_REF}
|
||||
79
.gitlab-ci.yml
Normal file
79
.gitlab-ci.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
image: lholota/bash-git:latest
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy:branchs:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git clone -b ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
# - bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
- bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${CO_REF}/monlor/mbfiles.git
|
||||
- bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GH_REF}/monlor/mbfiles.git
|
||||
|
||||
# deploy:dev:
|
||||
# stage: deploy
|
||||
# only:
|
||||
# - dev
|
||||
# script:
|
||||
# - apk add git-lfs
|
||||
# - git clone -b ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
# - bash -e ./tools/gitsync.sh pack
|
||||
# - bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
|
||||
deploy:master:
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git fetch origin master
|
||||
- git checkout master
|
||||
- git clone -b master ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
- bash ./tools/gitsync.sh deploy mbfiles master ${CO_REF}/monlor/mbfiles.git
|
||||
cache:
|
||||
key: master
|
||||
untracked: true
|
||||
|
||||
deploy:test:
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git fetch origin test
|
||||
- git checkout test
|
||||
- git clone -b test ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
- bash ./tools/gitsync.sh deploy mbfiles test ${CO_REF}/monlor/mbfiles.git
|
||||
cache:
|
||||
key: test
|
||||
untracked: true
|
||||
|
||||
syncode:github:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
script:
|
||||
- git fetch origin ${CI_COMMIT_REF_NAME}
|
||||
- git checkout ${CI_COMMIT_REF_NAME}
|
||||
- git push ${GH_REF}/monlor/MIXBOX.git ${CI_COMMIT_REF_NAME}:${CI_COMMIT_REF_NAME}
|
||||
|
||||
# cache:
|
||||
# key: ${CI_COMMIT_REF_NAME}
|
||||
# untracked: true
|
||||
# paths:
|
||||
# - mbfiles/
|
||||
|
||||
14
README.md
14
README.md
@@ -1,6 +1,6 @@
|
||||
# MIXBOX
|
||||
|
||||

|
||||

|
||||
|
||||
> MIXBOX是一款全新的,完全基于Shell脚本的工具箱,为在路由器上实现程序的快速配置及运行管理,欢迎大佬们stars、fork及pr.
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
### 更新日志
|
||||
|
||||
* 2020-03-06
|
||||
* 更新frps到0.31.2
|
||||
* 修复工具箱下载插件失败的问题
|
||||
|
||||
* 2020-03-05-2
|
||||
* 由于cdn缓存不刷新,还是滚回了`coding`源:`https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master`
|
||||
* 新增`DLNA`插件`DMS`
|
||||
@@ -135,7 +139,7 @@ mixbox help
|
||||
| |--- /data/ --- 硬盘目录
|
||||
|--- /extdisks/
|
||||
| |--- /sd*/ --- 外接盘目录
|
||||
|
||||
|
||||
|
||||
### 插件列表
|
||||
|
||||
@@ -191,5 +195,11 @@ mixbox help
|
||||
* `gitsync.sh`是打包插件的脚本,-v为更新版本号`可无`,打包的插件生成在appstore下
|
||||
|
||||
|
||||
#### 请喝咖啡
|
||||
|
||||
| 微信 | 支付宝 |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
|  |  |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
|
||||
eval `mbdb export dms`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
@@ -11,7 +12,7 @@ if [ "$enable" == '1' ]; then
|
||||
readsh "请输入${appname}媒体服务器名称" "servername" "mixbox-dms"
|
||||
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||
[ "$res" = '1' -o -z "$res" ] && return 1
|
||||
[ "$res" = '1' -o -z "$res" ] && return 0
|
||||
else
|
||||
return 0
|
||||
return 1
|
||||
fi
|
||||
BIN
apps/frps/bin/frps_darwin_x86_64
Normal file → Executable file
BIN
apps/frps/bin/frps_darwin_x86_64
Normal file → Executable file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_arm
Normal file → Executable file
BIN
apps/frps/bin/frps_linux_arm
Normal file → Executable file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_mips
Normal file → Executable file
BIN
apps/frps/bin/frps_linux_mips
Normal file → Executable file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_x86_64
Normal file → Executable file
BIN
apps/frps/bin/frps_linux_x86_64
Normal file → Executable file
Binary file not shown.
@@ -4,5 +4,5 @@ needver="0.0.1"
|
||||
openport="1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="内网穿透工具Frp服务端"
|
||||
newinfo="frp程序更新到0.21.0"
|
||||
version="1.1.2"
|
||||
newinfo="frp程序更新到0.31.2"
|
||||
version="1.1.4"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#------------------【Frps】--------------------
|
||||
frps() {
|
||||
|
||||
eval `mbdb export frps`
|
||||
source /etc/mixbox/bin/base
|
||||
uciset="mbdb set $appname.main"
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "技巧:回车表示默认或历史设置,-1表示还原默认或不启用"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
read -p "修改${appname}配置信息?[1/0] " res
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}运行端口号" "port" "7000"
|
||||
readsh "请输入${appname}的udp端口号" "udp_port" "7001"
|
||||
readsh "请输入${appname}的kcp配置[1/0]" "kcp" "1"
|
||||
readsh "请输入${appname}用于http穿透的端口号" "http_port" "90"
|
||||
readsh "请输入${appname}用于https穿透的端口号" "https_port" "91"
|
||||
readsh "请输入${appname}访问密钥" "token" "12345678"
|
||||
readsh "请输入${appname}子域名" "subdomain"
|
||||
read -p "是否启用${appname}的web控制面板?[1/0] " res
|
||||
[ -n "$res" ] && mbdb set $appname.main.dashboard="$res"
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}控制面板端口号" "dashboard_port" "7500"
|
||||
readsh "请输入${appname}控制面板用户名" "dashboard_user" "admin"
|
||||
readsh "请输入${appname}控制面板密码" "dashboard_pwd" "admin"
|
||||
fi
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Frps】--------------------
|
||||
@@ -1 +0,0 @@
|
||||
1.0.4
|
||||
35
apps/frps/scripts/config.sh
Normal file
35
apps/frps/scripts/config.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
|
||||
eval `mbdb export frps`
|
||||
source /etc/mixbox/bin/base
|
||||
uciset="mbdb set $appname.main"
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "技巧:回车表示默认或历史设置,-1表示还原默认或不启用"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
read -p "修改${appname}配置信息?[1/0] " res
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}运行端口号" "port" "7000"
|
||||
readsh "请输入${appname}的udp端口号" "udp_port" "7001"
|
||||
readsh "请输入${appname}的kcp配置[1/0]" "kcp" "1"
|
||||
readsh "请输入${appname}用于http穿透的端口号" "http_port" "90"
|
||||
readsh "请输入${appname}用于https穿透的端口号" "https_port" "91"
|
||||
readsh "请输入${appname}访问密钥" "token" "12345678"
|
||||
readsh "请输入${appname}子域名" "subdomain"
|
||||
read -p "是否启用${appname}的web控制面板?[1/0] " res
|
||||
[ -n "$res" ] && mbdb set $appname.main.dashboard="$res"
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}控制面板端口号" "dashboard_port" "7500"
|
||||
readsh "请输入${appname}控制面板用户名" "dashboard_user" "admin"
|
||||
readsh "请输入${appname}控制面板密码" "dashboard_pwd" "admin"
|
||||
fi
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export frps`
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -10,4 +10,4 @@ kp_rule_koolproxy="https://houzi-.coding.net/p/my_dream/d/my_dream/git/raw/maste
|
||||
kp_rule_daily="https://houzi-.coding.net/p/my_dream/d/my_dream/git/raw/master/daily.txt"
|
||||
kp_rule_dat="https://houzi-.coding.net/p/my_dream/d/my_dream/git/raw/master/kp.dat"
|
||||
kp_rule_user="https://raw.githubusercontent.com/kysdm/ad-rules/master/user-rules-koolproxy.txt"
|
||||
version="1.5.5"
|
||||
version="1.5.6"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
apps/mixbox/bin/base64_linux_arm
Executable file
BIN
apps/mixbox/bin/base64_linux_arm
Executable file
Binary file not shown.
BIN
apps/mixbox/bin/base64_linux_mips
Executable file
BIN
apps/mixbox/bin/base64_linux_mips
Executable file
Binary file not shown.
BIN
apps/mixbox/bin/base64_linux_x86_64
Executable file
BIN
apps/mixbox/bin/base64_linux_x86_64
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -336,8 +336,8 @@ select_app() {
|
||||
[ "$update" == '1' ] && ${mbroot}/scripts/appmanage.sh upgrade ${appname}
|
||||
fi
|
||||
# todo 配置方式修改
|
||||
if [ -f ${mbroot}/apps/${appname}/config.sh ]; then
|
||||
${mbroot}/apps/${appname}/config.sh
|
||||
if [ -f ${mbroot}/apps/${appname}/scripts/config.sh ]; then
|
||||
${mbroot}/apps/${appname}/scripts/config.sh
|
||||
if [ $? -eq 0 ]; then
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
|
||||
@@ -3,5 +3,5 @@ appname="mixbox"
|
||||
needver=""
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
appinfo="一款支持多平台,多架构的Shell工具箱"
|
||||
newinfo="新增base64_encode工具"
|
||||
version="0.1.9.1"
|
||||
newinfo="修复mixbox命令错误"
|
||||
version="0.1.9.6"
|
||||
|
||||
@@ -9,14 +9,14 @@ wgetsh() {
|
||||
[ ! -d "$wgetfiledir" ] && mkdir -p $wgetfiledir
|
||||
[ ! -d ${mbtmp} ] && mkdir -p ${mbtmp}
|
||||
rm -rf ${mbtmp}/${wgetfilename}
|
||||
if command -v wget-ssl &> /dev/null; then
|
||||
wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O "${mbtmp}/${wgetfilename}" "$wgeturl"
|
||||
[ $? -eq 0 ] && result="200"
|
||||
else
|
||||
if command -v curl &> /dev/null; then
|
||||
result1=$(curl -skL --connect-timeout 10 -m 20 -w %{http_code} -o "${mbtmp}/${wgetfilename}" "$wgeturl")
|
||||
else
|
||||
wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O "${mbtmp}/${wgetfilename}" "$wgeturl"
|
||||
[ $? -eq 0 ] && result1="200"
|
||||
fi
|
||||
[ -f "${mbtmp}/${wgetfilename}" ] && result2=$(du -sh "${mbtmp}/${wgetfilename}" 2> /dev/null | awk '{print$1}')
|
||||
if [ "$result" = "200" ] && [ "$result2" != '0' ]; then
|
||||
if [ "$result1" = "200" ] && [ "$result2" != '0' ]; then
|
||||
chmod +x ${mbtmp}/${wgetfilename} > /dev/null 2>&1
|
||||
mv -f ${mbtmp}/${wgetfilename} $wgetfilepath > /dev/null 2>&1
|
||||
return 0
|
||||
@@ -40,11 +40,7 @@ base_encode() {
|
||||
if [ -z "${1}" ]; then
|
||||
echo -n ""
|
||||
else
|
||||
if command -v base64-encode &> /dev/null; then
|
||||
echo -n "$*" | base64-encode
|
||||
else
|
||||
echo -n "$*" | baseutil --b64
|
||||
fi
|
||||
echo -n "$*" | base64
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -52,11 +48,7 @@ base_decode() {
|
||||
if [ -z "${1}" ]; then
|
||||
echo -n ""
|
||||
else
|
||||
if command -v base64-decode &> /dev/null; then
|
||||
echo -n "$*" | base64-decode
|
||||
else
|
||||
echo -n "$*" | baseutil --b64 -d
|
||||
fi
|
||||
echo -n "$*" | base64 -d
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -67,7 +59,7 @@ versioncmp() {
|
||||
|
||||
[ "$1" = "$2" ] && echo -n "0" && return
|
||||
|
||||
if test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; then
|
||||
if test "$(echo "$@" | tr " " "\n" | sort | head -n 1)" != "$1"; then
|
||||
echo -n "-1"
|
||||
else
|
||||
echo -n "1"
|
||||
|
||||
@@ -11,7 +11,7 @@ logsh "【Tools】" "正在卸载工具箱..."
|
||||
|
||||
logsh "【Tools】" "停止所有插件"
|
||||
|
||||
ls ${mbroot}/apps | while read line
|
||||
ls ${mbroot}/apps 2> /dev/null | while read line
|
||||
do
|
||||
result=$(mbdb get ${line}.main.enable)
|
||||
if [ "$result" == '1' ]; then
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export ngrok`
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
#------------------【NPC】--------------------
|
||||
npc() {
|
||||
|
||||
eval `mbdb export npc`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
readsh "请输入npc连接命令:" "connect_cmd"
|
||||
|
||||
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||
[ "$res" = '1' -o -z "$res" ] && ${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【NPC】--------------------
|
||||
@@ -5,4 +5,4 @@ backupfiles=""
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
appinfo="一款轻量级、高性能、功能强大的内网穿透代理服务器"
|
||||
newinfo=""
|
||||
version="0.0.7"
|
||||
version="0.0.9"
|
||||
|
||||
18
apps/npc/scripts/config.sh
Normal file
18
apps/npc/scripts/config.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
|
||||
eval `mbdb export npc`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
readsh "请输入npc连接命令:" "connect_cmd"
|
||||
|
||||
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||
[ "$res" = '1' -o -z "$res" ] && return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
1.1.6
|
||||
@@ -4,5 +4,5 @@ needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
backupfiles="config/ftpuser.conf"
|
||||
appinfo="快速搭建Ftp服务器,局域网文件共享"
|
||||
newinfo=""
|
||||
version="0.0.3"
|
||||
newinfo="修复vsftpd状态显示bug"
|
||||
version="0.0.6"
|
||||
|
||||
@@ -6,12 +6,17 @@ port=21
|
||||
FTPUSER=${mbroot}/apps/vsftpd/config/ftpuser.conf
|
||||
# binname="${appname} ${appname}-ext"
|
||||
userpath=/etc/mixbox/apps/vsftpd/config/vsftpd.users
|
||||
[ "$entware" = '1' ] && configpath=/opt/etc/vsftpd/vsftpd.conf || configpath=/etc/vsftpd.conf
|
||||
configpath=/etc/vsftpd.conf
|
||||
BINPATH=${mbroot}/apps/${appname}/bin/${appname}
|
||||
|
||||
if [ "$entware" = '1' ]; then
|
||||
configpath=/opt/etc/vsftpd/vsftpd.conf
|
||||
BINPATH=/opt/sbin/vsftpd
|
||||
fi
|
||||
[ ! -d /var/run/vsftpd ] && mkdir -p /var/run/vsftpd
|
||||
[ -z "$port" ] && port=21
|
||||
[ -z "$anon_root" ] && anon_root=/var/ftp
|
||||
[ ! -f "${configpath}" ] && touch ${configpath}
|
||||
|
||||
|
||||
add(){
|
||||
sed -i "/$1/"d /etc/passwd
|
||||
@@ -74,7 +79,7 @@ set_config() {
|
||||
anon_enable=NO
|
||||
fi
|
||||
|
||||
mount --bind ${mbroot}/apps/${appname}/config/${appname}.conf ${configpath}
|
||||
cp -rf ${mbroot}/apps/${appname}/config/${appname}.conf ${configpath}
|
||||
echo -e "anonymous_enable=$anon_enable\nanon_root=$anon_root\nlisten_port=${port}" >> ${configpath}
|
||||
|
||||
}
|
||||
@@ -89,20 +94,19 @@ start () {
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
if [ ! -f ${mbroot}/apps/${appname}/bin/${appname} ]; then
|
||||
bincheck ${binname}
|
||||
if [ $? -eq 0 ]; then
|
||||
logsh "【$service】" "安装程序成功,链接程序到工具箱..."
|
||||
ln -sf $(which $binname) ${mbroot}/apps/${appname}/bin/${appname}
|
||||
else
|
||||
logsh "【$service】" "程序安装失败!"
|
||||
end
|
||||
fi
|
||||
if [ $? -eq 0 ]; then
|
||||
logsh "【$service】" "安装程序成功,链接程序到工具箱..."
|
||||
else
|
||||
logsh "【$service】" "程序安装失败!"
|
||||
end
|
||||
fi
|
||||
fi
|
||||
# init_mount
|
||||
set_config
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname}
|
||||
write_firewall_start
|
||||
daemon $BINPATH
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
@@ -121,8 +125,9 @@ stop () {
|
||||
do
|
||||
[ ! -z "${line}" ] && del ${line}
|
||||
done
|
||||
rm -rf ${configpath}
|
||||
killall -9 ${appname} &> /dev/null
|
||||
rm -rf ${configpath}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -130,8 +135,7 @@ stop () {
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
if [ -n "$(pidof "${BINPATH}")" ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号: ${port}|1"
|
||||
|
||||
BIN
appsbin/frp-bin/0.31.2/frpc_darwin_x86_64
Executable file
BIN
appsbin/frp-bin/0.31.2/frpc_darwin_x86_64
Executable file
Binary file not shown.
BIN
appsbin/frp-bin/0.31.2/frpc_linux_arm
Executable file
BIN
appsbin/frp-bin/0.31.2/frpc_linux_arm
Executable file
Binary file not shown.
BIN
appsbin/frp-bin/0.31.2/frpc_linux_mips
Executable file
BIN
appsbin/frp-bin/0.31.2/frpc_linux_mips
Executable file
Binary file not shown.
BIN
appsbin/frp-bin/0.31.2/frpc_linux_x86_64
Executable file
BIN
appsbin/frp-bin/0.31.2/frpc_linux_x86_64
Executable file
Binary file not shown.
@@ -1 +1 @@
|
||||
4.9.0
|
||||
4.22.1
|
||||
BIN
appsbin/v2ray-bin/linux_arm/v2ctl
Executable file → Normal file
BIN
appsbin/v2ray-bin/linux_arm/v2ctl
Executable file → Normal file
Binary file not shown.
BIN
appsbin/v2ray-bin/linux_arm/v2ray
Executable file → Normal file
BIN
appsbin/v2ray-bin/linux_arm/v2ray
Executable file → Normal file
Binary file not shown.
81
backup/.gitlab-ci-template.yaml
Normal file
81
backup/.gitlab-ci-template.yaml
Normal file
@@ -0,0 +1,81 @@
|
||||
# 定义 stages(阶段)。任务将按此顺序执行。
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
|
||||
# 定义 job(任务)
|
||||
job1:
|
||||
stage: test
|
||||
tags:
|
||||
- XX #只有标签为XX的runner才会执行这个任务
|
||||
only:
|
||||
- dev #只有dev分支提交代码才会执行这个任务。也可以是分支名称或触发器名称
|
||||
- /^future-.*$/ #正则表达式,只有future-开头的分支才会执行
|
||||
script:
|
||||
- echo "I am job1"
|
||||
- echo "I am in test stage"
|
||||
|
||||
# 定义 job
|
||||
job2:
|
||||
stage: test #如果此处没有定义stage,其默认也是test
|
||||
only:
|
||||
- master #只有master分支提交代码才会执行这个任务
|
||||
script:
|
||||
- echo "I am job2"
|
||||
- echo "I am in test stage"
|
||||
allow_failure: true #允许失败,即不影响下步构建
|
||||
|
||||
# 定义 job
|
||||
job3:
|
||||
stage: build
|
||||
except:
|
||||
- dev #除了dev分支,其它分支提交代码都会执行这个任务
|
||||
script:
|
||||
- echo "I am job3"
|
||||
- echo "I am in build stage"
|
||||
when: always #不管前面几步成功与否,永远会执行这一步。它有几个值:on_success (默认值)\on_failure\always\manual(手动执行)
|
||||
|
||||
# 定义 job
|
||||
.job4: #对于临时不想执行的job,可以选择在前面加个".",这样就会跳过此步任务,否则你除了要注释掉这个jobj外,还需要注释上面为deploy的stage
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "I am job4"
|
||||
|
||||
# 模板,相当于公用函数,有重复任务时很有用
|
||||
.job_template: &job_definition # 创建一个锚,'job_definition'
|
||||
image: ruby:2.1
|
||||
services:
|
||||
- postgres
|
||||
- redis
|
||||
|
||||
test1:
|
||||
<<: *job_definition # 利用锚'job_definition'来合并
|
||||
script:
|
||||
- test1 project
|
||||
|
||||
test2:
|
||||
<<: *job_definition # 利用锚'job_definition'来合并
|
||||
script:
|
||||
- test2 project
|
||||
|
||||
#下面几个都相当于全局变量,都可以添加到具体job中,这时会被子job的覆盖
|
||||
|
||||
before_script:
|
||||
- echo "每个job之前都会执行"
|
||||
|
||||
after_script:
|
||||
- echo "每个job之后都会执行"
|
||||
|
||||
variables: #变量
|
||||
DATABASE_URL: "postgres://postgres@postgres/my_database" #在job中可以用${DATABASE_URL}来使用这个变量。常用的预定义变量有CI_COMMIT_REF_NAME(项目所在的分支或标签名称),CI_JOB_NAME(任务名称),CI_JOB_STAGE(任务阶段)
|
||||
GIT_STRATEGY: "none" #GIT策略,定义拉取代码的方式,有3种:clone/fetch/none,默认为clone,速度最慢,每步job都会重新clone一次代码。我们一般将它设置为none,在具体任务里设置为fetch就可以满足需求,毕竟不是每步都需要新代码,那也不符合我们测试的流程
|
||||
|
||||
cache: #缓存
|
||||
#因为缓存为不同管道和任务间共享,可能会覆盖,所以有时需要设置key
|
||||
key: ${CI_COMMIT_REF_NAME} # 启用每分支缓存。
|
||||
#key: "$CI_JOB_NAME/$CI_COMMIT_REF_NAME" # 启用每个任务和每个分支缓存。需要注意的是,如果是在windows中运行这个脚本,需要把$换成%
|
||||
untracked: true #缓存所有Git未跟踪的文件
|
||||
paths: #以下2个文件夹会被缓存起来,下次构建会解压出来
|
||||
- node_modules/
|
||||
- dist/
|
||||
79
backup/.gitlab-ci.yml
Normal file
79
backup/.gitlab-ci.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
image: lholota/bash-git:latest
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy:branchs:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git clone -b ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
# - bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
- bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${CO_REF}/monlor/mbfiles.git
|
||||
- bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GH_REF}/monlor/mbfiles.git
|
||||
|
||||
# deploy:dev:
|
||||
# stage: deploy
|
||||
# only:
|
||||
# - dev
|
||||
# script:
|
||||
# - apk add git-lfs
|
||||
# - git clone -b ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
# - bash -e ./tools/gitsync.sh pack
|
||||
# - bash ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
|
||||
deploy:master:
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git fetch origin master
|
||||
- git checkout master
|
||||
- git clone -b master ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
- bash ./tools/gitsync.sh deploy mbfiles master ${CO_REF}/monlor/mbfiles.git
|
||||
cache:
|
||||
key: master
|
||||
untracked: true
|
||||
|
||||
deploy:test:
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- apk add git-lfs
|
||||
- git fetch origin test
|
||||
- git checkout test
|
||||
- git clone -b test ${GL_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
- bash ./tools/gitsync.sh deploy mbfiles test ${CO_REF}/monlor/mbfiles.git
|
||||
cache:
|
||||
key: test
|
||||
untracked: true
|
||||
|
||||
syncode:github:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
script:
|
||||
- git fetch origin ${CI_COMMIT_REF_NAME}
|
||||
- git checkout ${CI_COMMIT_REF_NAME}
|
||||
- git push ${GH_REF}/monlor/MIXBOX.git ${CI_COMMIT_REF_NAME}:${CI_COMMIT_REF_NAME}
|
||||
|
||||
# cache:
|
||||
# key: ${CI_COMMIT_REF_NAME}
|
||||
# untracked: true
|
||||
# paths:
|
||||
# - mbfiles/
|
||||
|
||||
10
install.sh
10
install.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
#copyright by monlor
|
||||
|
||||
|
||||
clear
|
||||
logsh() {
|
||||
# 输出信息到/tmp/messages和标准输出
|
||||
@@ -17,7 +17,7 @@ logsh "【Tools】" "请按任意键安装工具箱(Ctrl + C 退出)."
|
||||
read answer
|
||||
#check root
|
||||
# [ "$USER" != "root" ] && logsh "【Tools】" "请使用root用户安装工具箱!" && exit 1
|
||||
mburl="https://gitee.com/monlor/mbfiles/raw/master"
|
||||
mburl="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master"
|
||||
mbtmp="/tmp/mbtmp"
|
||||
[ ! -d "${mbtmp}" ] && mkdir -p ${mbtmp}
|
||||
model=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
|
||||
@@ -47,11 +47,11 @@ fi
|
||||
|
||||
logsh "【Tools】" "下载工具箱文件..."
|
||||
rm -rf ${mbtmp}/mixbox.tar.gz > /dev/null 2>&1
|
||||
if command -v wget-ssl &> /dev/null; then
|
||||
if command -v curl &> /dev/null; then
|
||||
result=$(curl -w %{http_code} -skLo ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz)
|
||||
else
|
||||
wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz
|
||||
[ $? -eq 0 ] && result="200"
|
||||
else
|
||||
result=$(curl -w %{http_code} -skLo ${mbtmp}/mixbox.tar.gz ${mburl}/appstore/mixbox_${model}.tar.gz)
|
||||
fi
|
||||
[ "$result" != "200" ] && logsh "【Tools】" "文件下载失败!" && exit 1
|
||||
logsh "【Tools】" "解压工具箱文件"
|
||||
|
||||
@@ -59,22 +59,34 @@ gerneral_applist() {
|
||||
|
||||
pack() {
|
||||
|
||||
local pack_dir="${1:-mbfiles}"
|
||||
|
||||
rm -rf appstore/
|
||||
rm -rf mbfiles/
|
||||
|
||||
echo "开始打包插件..."
|
||||
mkdir appstore
|
||||
ls apps/ | while read line; do
|
||||
# 取用缓存数据
|
||||
if [ -f ${pack_dir}/applist.txt ]; then
|
||||
version_old=`cat ${pack_dir}/applist.txt | grep "$line|" | cut -d'|' -f4`
|
||||
version_new=`cat apps/$line/config/$line.uci | grep "version=" | cut -d'=' -f2 | sed -e 's/"//g'`
|
||||
[ "$version_new" = "$version_old" ] && echo "$line未更新,跳过打包..." && continue
|
||||
fi
|
||||
pack_app $line
|
||||
done
|
||||
gerneral_applist
|
||||
|
||||
mkdir mbfiles
|
||||
cp -rf appsbin/ mbfiles/appsbin/
|
||||
cp -rf temp/ mbfiles/temp/
|
||||
cp -rf install.sh mbfiles/
|
||||
mv -f appstore/ mbfiles/appstore/
|
||||
mv -f applist.txt mbfiles/
|
||||
test ! -d ${pack_dir}/appstore && mkdir -p ${pack_dir}/appstore
|
||||
test ! -d ${pack_dir}/temp && mkdir -p ${pack_dir}/temp
|
||||
test ! -d ${pack_dir}/appsbin && mkdir -p ${pack_dir}/appsbin
|
||||
|
||||
cp -rf appsbin/* ${pack_dir}/appsbin/
|
||||
cp -rf temp/* ${pack_dir}/temp/
|
||||
cp -rf install.sh ${pack_dir}/
|
||||
mv -f appstore/* ${pack_dir}/appstore/
|
||||
mv -f applist.txt ${pack_dir}/
|
||||
|
||||
rm -rf appstore/
|
||||
|
||||
}
|
||||
|
||||
@@ -104,16 +116,26 @@ reset() {
|
||||
# $3: remote url with token
|
||||
deploy() {
|
||||
|
||||
sed -Ei "s#mbfiles/raw/[a-z]+#mbfiles/raw/$2#" $1/install.sh
|
||||
sed -Ei "s#mbfiles/git/raw/[a-z]+#mbfiles/git/raw/$2#" $1/install.sh
|
||||
|
||||
cd $1
|
||||
git init
|
||||
git config --local user.email "monlor@qq.com"
|
||||
git config --local user.name "monlor"
|
||||
git add .
|
||||
git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a
|
||||
git push "$3" master:"$2" -f
|
||||
if [ ! -d ".git" ]; then
|
||||
git init
|
||||
fi
|
||||
git config --local user.email "monlor@qq.com"
|
||||
git config --local user.name "monlor"
|
||||
|
||||
git lfs install
|
||||
rm -rf .gitattributes
|
||||
git lfs track "*_linux_*"
|
||||
git lfs track "*_darwin_*"
|
||||
|
||||
if git status &> /dev/null; then
|
||||
git add .
|
||||
git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a
|
||||
fi
|
||||
git lfs push "$3" --all
|
||||
git push "$3"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
||||
Reference in New Issue
Block a user