修复配置文件写入,模板增加未设置的选项
This commit is contained in:
parent
48aabb74f4
commit
ddeea23b3c
@ -26,6 +26,10 @@ cache:
|
|||||||
type: ""
|
type: ""
|
||||||
# 内存缓存使用大小,单位 b
|
# 内存缓存使用大小,单位 b
|
||||||
ram: 10000000
|
ram: 10000000
|
||||||
|
# redis 服务端地址,如 127.0.0.1:6379
|
||||||
|
addr: ""
|
||||||
|
# redis 密码
|
||||||
|
password: ""
|
||||||
|
|
||||||
# 位于反向代理后启用,用于记录真实 ip
|
# 位于反向代理后启用,用于记录真实 ip
|
||||||
raelIP: false
|
raelIP: false
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/xmdhs/authlib-skin/config"
|
"github.com/xmdhs/authlib-skin/config"
|
||||||
"github.com/xmdhs/authlib-skin/server"
|
"github.com/xmdhs/authlib-skin/server"
|
||||||
"github.com/xmdhs/authlib-skin/utils/sign"
|
"github.com/xmdhs/authlib-skin/utils/sign"
|
||||||
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
var configPath string
|
var configPath string
|
||||||
@ -44,7 +45,7 @@ func main() {
|
|||||||
rsa2048 := lo.Must(rsa.GenerateKey(rand.Reader, 4096))
|
rsa2048 := lo.Must(rsa.GenerateKey(rand.Reader, 4096))
|
||||||
as := sign.NewAuthlibSignWithKey(rsa2048)
|
as := sign.NewAuthlibSignWithKey(rsa2048)
|
||||||
config.RsaPriKey = lo.Must(as.GetPriKey())
|
config.RsaPriKey = lo.Must(as.GetPriKey())
|
||||||
lo.Must0(os.WriteFile(configPath, []byte(config.RsaPriKey), 0600))
|
lo.Must0(os.WriteFile(configPath, lo.Must(yaml.Marshal(config)), 0600))
|
||||||
}
|
}
|
||||||
|
|
||||||
s, cancel := lo.Must2(server.InitializeRoute(ctx, config))
|
s, cancel := lo.Must2(server.InitializeRoute(ctx, config))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user