mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-07 14:43:17 +08:00
优化
This commit is contained in:
@@ -284,7 +284,7 @@ ipv4_end = "10.1.2.200"
|
||||
-c=/etc/server.toml --ip_lease=1209600 # IP地址租约时长
|
||||
```
|
||||
|
||||
7. 构建镜像
|
||||
7. 构建镜像 (非必需)
|
||||
|
||||
```bash
|
||||
#获取仓库源码
|
||||
|
1
build.sh
Executable file → Normal file
1
build.sh
Executable file → Normal file
@@ -52,6 +52,7 @@ cp -r server/conf $deploy
|
||||
|
||||
cp -r systemd $deploy
|
||||
cp -r LICENSE $deploy
|
||||
cp -r home $deploy
|
||||
|
||||
tar zcvf ${deploy}.tar.gz $deploy
|
||||
|
||||
|
@@ -34,6 +34,7 @@ COPY docker/docker_entrypoint.sh /app/
|
||||
#COPY ./server/bridge-init.sh /app/
|
||||
COPY ./server/conf /app/conf
|
||||
COPY ./LICENSE /app/LICENSE
|
||||
COPY ./home /app/home
|
||||
|
||||
|
||||
#TODO 本地打包时使用镜像
|
||||
|
@@ -22,22 +22,32 @@ func checkTun() {
|
||||
defer ifce.Close()
|
||||
|
||||
// 测试ip命令
|
||||
cmdstr := fmt.Sprintf("ip link set dev %s up mtu %s multicast off", ifce.Name(), "1399")
|
||||
err = execCmd([]string{cmdstr})
|
||||
cmdstr0 := fmt.Sprintln("modprobe -i tun")
|
||||
cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %s multicast off", ifce.Name(), "1399")
|
||||
err = execCmd([]string{cmdstr0, cmdstr1})
|
||||
if err != nil {
|
||||
base.Fatal("testTun err: ", err)
|
||||
}
|
||||
//开启服务器转发
|
||||
if err := execCmd([]string{"sysctl -w net.ipv4.ip_forward=1"}); err != nil {
|
||||
base.Error(err)
|
||||
base.Fatal(err)
|
||||
}
|
||||
if base.Cfg.IptablesNat {
|
||||
//添加NAT转发规则
|
||||
ipt, err := iptables.New()
|
||||
if err != nil {
|
||||
base.Error(err)
|
||||
base.Fatal(err)
|
||||
return
|
||||
}
|
||||
|
||||
//修复 rockyos nat 不生效
|
||||
cmdstr0 := fmt.Sprintln("modprobe -i iptable_filter")
|
||||
cmdstr1 := fmt.Sprintf("modprobe -i iptable_nat")
|
||||
err = execCmd([]string{cmdstr0, cmdstr1})
|
||||
if err != nil {
|
||||
base.Fatal("testTun err: ", err)
|
||||
}
|
||||
|
||||
natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-j", "MASQUERADE"}
|
||||
forwardRule := []string{"-j", "ACCEPT"}
|
||||
if natExists, _ := ipt.Exists("nat", "POSTROUTING", natRule...); !natExists {
|
||||
|
@@ -248,11 +248,14 @@
|
||||
<el-form-item label="自定义首页" prop="homeindex">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
:rows="10"
|
||||
placeholder="请输入内容"
|
||||
v-model="dataOther.homeindex"
|
||||
>
|
||||
</el-input>
|
||||
<el-tooltip content="自定义内容可以参考 home 目录下的文件" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="账户开通邮件" prop="account_mail">
|
||||
|
Reference in New Issue
Block a user