Code Monkey home page Code Monkey logo

Comments (6)

lwch avatar lwch commented on August 27, 2024

你好,看错误信息表现为两个问题

  1. 服务器端和客户端中的common.yaml里的secret配置不一致导致握手失败
  2. common.yaml中的log相关配置被设置为0导致日志无法被滚动生成

from natpass.

bugstark avatar bugstark commented on August 27, 2024

哦哦,不好意思,看到#include common.yaml 是注释状态,私以为可以无需配置
解除注释,并修改格式后变为 include: common.yaml
重启3端后。连接被控端报错:

2022/07/11 12:26:54 [INFO]add link a975db41d3f34cec
panic: runtime error: index out of range [0] with length 0

goroutine 34 [running]:
github.com/lwch/logging.(*rotateSizeLogger).rotate(0x1400009e000)
	/root/go/pkg/mod/github.com/lwch/[email protected]/rotate_size.go:99 +0x7f8
github.com/lwch/logging.(*Logger).Error(0x101c6de60, {0x10125ca7c, 0xe}, {0x14000068160, 0x1, 0x1})
	/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:90 +0x7c
github.com/lwch/logging.Error(...)
	/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30
github.com/lwch/natpass/code/network.(*Conn).loopWrite(0x140000ac040)
	/build/code/network/network.go:127 +0x1cc
created by github.com/lwch/natpass/code/network.NewConn
	/build/code/network/network.go:42 +0x148

from natpass.

lwch avatar lwch commented on August 27, 2024

可以检查一下common.yaml中的log.size和log.rotate配置这两个目前不支持设置为0哦

from natpass.

bugstark avatar bugstark commented on August 27, 2024

common都是保持的原有设置,未曾修改

common

secret: 0123456789  # 预共享密钥,否则握手失败
link:
  read_timeout:  1s # 读取数据包超时时间
  write_timeout: 1s # 发送数据包超时时间
log:
  dir: ./logs # 路径,相对于可执行文件所在目录的相对路径
  size: 50M   # 单个文件大小
  rotate: 7   # 保留数量

local

id: local              # 客户端ID
server: XXXXXX:9876 # 服务器地址
ssl: false             # 是否使用tls加密连接
dashboard: # web面板
  enabled: true   # 是否开放dashboard
  listen: 0.0.0.0 # 监听地址
  port: 8080      # 监听端口号
include: common.yaml
rules: # rule列表
  #include rule.d/*.yaml

remote

id: remote             # 客户端ID
server: xxxxx:9876 # 服务器地址
ssl: false             # 是否使用tls加密连接
dashboard: # web面板
  enabled: false # 是否开放dashboard
include: common.yaml
rules: # rule列表

server

listen: 9876 # 监听端口号
include: common.yaml
#tls:
#  key: /dir/to/tls/key/file # tls密钥
#  crt: /dir/to/tls/crt/file # tls证书

from natpass.

lwch avatar lwch commented on August 27, 2024

#include前面有个井号哦

from natpass.

bugstark avatar bugstark commented on August 27, 2024

可以了,我还以为 #include是被注释了

from natpass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.