Giter Club home page Giter Club logo

carrot-hu23 / dst-admin-go Goto Github PK

View Code? Open in Web Editor NEW
384.0 3.0 55.0 11.11 MB

Don't Starve Together server panel. Manage room with ease, featuring visual world and mod management, player log collection。饥荒联机服务器面板。轻松管理房间,支持可视化的世界和模组管理,玩家日志采集

License: GNU General Public License v3.0

Go 90.28% Python 6.69% Shell 0.95% Lua 2.08% Batchfile 0.01%
dont-starve-together dst go

dst-admin-go's People

Contributors

carrot-hu23 avatar kairlec avatar mamjun avatar tsangkam avatar xdujiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dst-admin-go's Issues

[建议] docker 数据持久化

问题:我通过docker的方式运行了该项目,但我发现了一个严重的问题,当我把正在运行的容器停止删除后,再次重新启动,已经配置好的数据全部丢失。

希望作者可以在 编写Dockerfile、以及定义程序数据存储的路劲时,可以把那些用户数据、以及饥荒服务器数据等规划到一个可供用户挂载出来的目录,例如通过 docker run -v /path/dst-server-data:/data ......。这样即使 容器崩溃 或者不小心删除后,直接重新运行该容器,数据并不会丢失。

未开启游戏的情况下更新导致panic的问题

service/shellService.go

// service/shellService.go
...
func ShutdownMaster() {
	shell := "screen -S \"" + constant.SCREEN_WORK_MASTER_NAME + "\" -p 0 -X stuff \"c_shutdown(true)\\n\""
	_, err := Shell(shell)
	if err != nil {
		log.Panicln("shut down master error: " + err.Error())
	}
}

func shutdownCaves() {
	shell := "screen -S \"" + constant.SCREEN_WORK_CAVES_NAME + "\" -p 0 -X stuff \"c_shutdown(true)\\n\""
	_, err := Shell(shell)
	if err != nil {
		log.Panicln("shut down caves error: " + err.Error())
	}
}
...

在更新游戏时会调用到这两个函数,但是这个时候游戏还没有开启,没有这些窗口时执行,会报错并导致游戏更新失败

[BUG]定时任务导致面板断开连接

云服面板版本:dst-admin-go.1.2.6

BUG出现的环境条件

BUG描述:

  • 在面板【定时任务】创建一个定时备份世界的任务后,如下图:

image

  • 到设定时间点后台面板开始卡住无法操作,刷新页面后显示“错误502”。随后我重启 dst-admin-go 面板后页面恢复正常,接着当我查看【定时任务】中的【上次执行时间】发现没有执行过。

下图是log截取:

image**

New feature,新需求

作者做的这个太好了,能不能提个新需求,能动态添加一个房间的世界个数,可以用来开多层服务器,比如三个地上,一个地下的房间。现在能支持多个房间 就非常好。

bug

docker镜像启动之后,访问vps8082端口无信息,测试搭建其他docker无问题,请检查下docker镜像谢谢!

无法使用bin64启动游戏

本来想fork后改改提个pr的,发现仓库里没有dockerfile

镜像里安装的是libcurl4-gnutls-dev:i386指定了体系结构
run.sh里有一句

ln -s /usr/lib64/libcurl.so.4 /app/dst-dedicated-server/bin64/lib64/libcurl-gnutls.so.4

根本就不会有这个libcurl.so.4
因此如果在系统设置里选择bin为64,会导致启动报错
./dontstarve_dedicated_server_nullrenderer_x64: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory


另外就是README的docker命令只放行了8082端口,没有把udp端口转发出来

直接拿去开服访问不了端口

再就是没有提供容器的数据持久化相关文档

比如dst-db,dst_config,password.txt以及~/.klei下的存档等

还有就是docker entrypoint里run.sh最后建议使用exec ./dst-admin-go

现在不响应docker stop命令

[BUG]自动更新无法识别哪个世界是应该启动

您好,我描述一下场景

我的存档有地上地下两个世界,并且存档都是有效的
我只开了地上,并且能够正常运行。

当饥荒自动更新的时候
地上也会自动关闭,然后游戏更新

更新完成后,地上地下都会启动,其实我只要开地上。自动更新逻辑并没有记住我哪个是应该启动,而不是所有的启动了

版本1.2.7

有一个小问题

root@hecs-226200:/dst-admin-go.1.16.hotfix# ls
config.yml dist Dockerfile dst-admin-go dst_config log.log run.sh static
root@hecs-226200:
/dst-admin-go.1.16.hotfix# chmod +x dst-admin-go
root@hecs-226200:/dst-admin-go.1.16.hotfix# nohup dst-admin-go>log.log &
[1] 4953
root@hecs-226200:
/dst-admin-go.1.16.hotfix# nohup: ignoring input and redirecti ng stderr to stdout
[email protected]
[email protected]

nohup: failed to run command 'dst-admin-go': No such file or directory

为什么有文件执行却说是没文件呢

[疑似bug] 关于定时任务重启服务器

bug描述:定时任务重启了关闭的服务器后,在控制面板仍然显示为关闭状态,实际从资源占用情况来看服务器是开启的,也通过游戏验证了服务器是正常连接状态。

复现步骤:

  1. 添加定时任务 类型:重启世界;时间:任意
  2. 关闭服务器 (包括森林和洞穴)
  3. 定时任务自动触发重启世界

[建议] 非 Docker 部署时使用 systemd 守护

安装脚本中好像是使用 nohup 运行的,提一个小建议,可以用 systemd 守护,实现崩溃自动重启、日志记录、开机自启等功能。
一个简单的 /etc/systemd/system/dst-admin.service 例子:

[Unit]
Description=Don't Starve Together Server Panel
After=network.target

[Service]
Type=simple
ExecStart=/path/to/executable/file
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

然后就可以通过 systemctl start dst-admin 来启动服务了

docker定时任务BUG

面板版本1.2.4
复现步骤:设置18:04备份;18:05重启游戏;18:10备份;18:11重启。
等待时间到18:06,备份任务和重启任务正常,重启容器。
等待时间到18:12,备份任务异常,变为重启,查看日志可以看到两次定时重启记录。
目前我用的所有面板版本都有这个问题,定时备份变为定时重启,还有定时重启变为定时备份的。
附上容器日志,面板日志,定时任务设置界面截图。
dst-admin-go.log
ctr.log
1 2 4定时任务设置界面

docker部署

需求:希望提供docker-compose或者dockerfile文件

docker 启动出现错误:panic: failed to connect database

大佬,求救!!!呜呜呜!!!

使用 docker 启动服务,前面都正常,到最后出现这个错误
系统:CentOS Linux release 7.9.2009 (Core)(6.0.2-1.el7.elrepo.x86_64)
配置:2H4G
目录权限正常777,磁盘空间正常,selinux及其他都关闭了,dst-admin-go.log、dst-db、DoNotStarveTogether 这三个目录都是空的

启动命令有点乱,没用 docker-compose

docker run -d -p 8082:8082 -v /root/dst/DoNotStarveTogether:/root/.klei/DoNotStarveTogether -v /root/dst/backup:/app/backup -v /root/dst/mod:/app/mod -v /root/dst/dst-db:/app/dst-db -v /root/dst/dst-admin-go.log:/app/dst-admin-go.log -v /root/dst/dst-dedicated-server:/app/dst-dedicated-server -v /root/dst/steamcmd:/app/steamcmd hujinbo23/dst-admin-go
Not found Dont Starve Together Sever, start to installing, try: 1
tid(11) burning pthread_key_t == 0 so we never use it
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
Logging directory: '/root/Steam/logs'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1705108307
-- type 'quit' to exit --
Loading Steam API...dlmopen steamservice.so failed: steamservice.so: cannot open shared object file: No such file or directory
OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x11) preallocating, progress: 32.80 (1120309542 / 3415352296)
 ..................................................................................................
 Update state (0x81) verifying update, progress: 96.58 (3298534181 / 3415352296)
 Update state (0x101) committing, progress: 19.03 (649893720 / 3415352296)
 Update state (0x101) committing, progress: 38.85 (1326835985 / 3415352296)
Success! App '343050' fully installed.
SteamCMD installed at /app/steamcmd
SteamDST server installed at /app/dst-dedicated-server
home path: /root
2024/02/01 08:56:52 config:  &{8082  dst-db       {true 5 10} }
panic: failed to connect database

goroutine 1 [running]:
dst-admin-go/bootstrap.initDB()
	C:/Users/paratera/Desktop/我的/饥荒面板/dst-admin-go/bootstrap/init.go:51 +0x558
dst-admin-go/bootstrap.Init()
	C:/Users/paratera/Desktop/我的/饥荒面板/dst-admin-go/bootstrap/init.go:37 +0x25
main.main()
	C:/Users/paratera/Desktop/我的/饥荒面板/dst-admin-go/main.go:17 +0x1d

在点击房间配置后崩溃

2023/06/06 14:28:43 manager.go:55: token=a5GSoRK6U3iHacJcPmTS5Gt7B2wsGs-p0MO5JB4qdp8%3D
2023/06/06 14:28:43 interceptorHandler.go:84: cookiName: admin
2023/06/06 14:28:43 interceptorHandler.go:85: sessionID: a5GSoRK6U3iHacJcPmTS5Gt7B2wsGs-p0MO5JB4qdp8%3D
2023/06/06 14:28:43 clusterService.go:113: str: []
panic: read dst blocklist.txt error:
open /home/leaderone/.klei/DoNotStarveTogether/Cluster3/blocklist.txt: no such file or directory

goroutine 755533 [running]:
dst-admin-go/service.ReadBlocklistFile()
/root/mine/dst/dst-admin-go/service/clusterService.go:115 +0x119
dst-admin-go/service.GetGameConfog.func4()
/root/mine/dst/dst-admin-go/service/clusterService.go:434 +0x2b
created by dst-admin-go/service.GetGameConfog
/root/mine/dst/dst-admin-go/service/clusterService.go:433 +0x1af

./dst-admin-go 没有权限

按照流程下来,到最后运行的时候提示nohup:failed to run command './dst-admin-go': Permission denied,
用chmod授权也不行

新需求

建议添加一个自动更新游戏,更新完自动启动游戏的功能。
(今天刚第一天使用,还没遇到过需要更新的情况,不太清楚是不是只能手动更新,不过我没看到相关设置或说明,大概是没有吧。?)

创建集群报错

Something went wrong.
Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

[Bug] 程序运行后,打印错误日志 “C:/Users/xm/Desktop/dst-project/dst-admin-go/service/announceService.go:39 record not found”

运行环境:

操作系统:CentOS 7

dst-admin-go 版本: 1.2.5

启动方式:通过Release下载的压缩包,执行 start.sh 后, 产生 log.log 日志文件,日志文件中抛出异常错误。

错误信息

$ tail log.log 
[GIN-debug] Listening and serving HTTP on :8082

2023/11/22 17:21:07 C:/Users/xm/Desktop/dst-project/dst-admin-go/service/announceService.go:39 record not found
[0.197ms] [rows:0] SELECT * FROM `announces` WHERE `announces`.`deleted_at` IS NULL ORDER BY `announces`.`id` LIMIT 1

2023/11/22 17:22:07 C:/Users/xm/Desktop/dst-project/dst-admin-go/service/announceService.go:39 record not found
[0.196ms] [rows:0] SELECT * FROM `announces` WHERE `announces`.`deleted_at` IS NULL ORDER BY `announces`.`id` LIMIT 1

2023/11/22 17:23:07 C:/Users/xm/Desktop/dst-project/dst-admin-go/service/announceService.go:39 record not found
[0.227ms] [rows:0] SELECT * FROM `announces` WHERE `announces`.`deleted_at` IS NULL ORDER BY `announces`.`id` LIMIT 1

mod id 2526778484 配置错误

如果通过web端进行模组配置,保存配置之后
image
该mod在世界设置mod配置中是错误的,世界同样无法启动。
image

mod修改不成功;无起始存档会崩溃

  1. 当系统没有~/.klei/DoNotStarveTogether/下没有对应的存档文件夹时,由于访问不到存档信息,后端会崩溃
    建议处理此时的错误:初始化一个存档(比如纯净档)到对应文件夹里,然后再运行用户访问前端

  2. 调试时发现mod修改配置后世界设置-模组-保存配置-更新配置-重启房间,修改不生效。或者说,不知道什么时候会生效,只成功了一次,之后修改就再没生效过

目前在调试docker版的大佬你的go包,打算等把这些问题都解决了再正式发布。

windows下路径错误

配置:cluster=cluster2
报错:
File reading error: open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster2/cluster_token.txt: The system cannot find the path specified.
2023/05/12 12:14:22 errorHandle.go:15: panic: read cluster_token.txt file error: open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster2/cluster_token.txt: The system cannot find the path specified.
生成新游戏时报错:
open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Caves/server.ini: The system cannot find the path specified.
2023/05/12 12:27:18 gameConfigService.go:348: 生成master_leveldataoverride.txt 文件 C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Master/leveldataoverride.lua
open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Master/leveldataoverride.lua: The system cannot find the path specified.
2023/05/12 12:27:18 gameConfigService.go:358: 生成caves_leveldataoverride.lua 文件 C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Caves/leveldataoverride.lua
open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Caves/leveldataoverride.lua: The system cannot find the path specified.
2023/05/12 12:27:18 gameConfigService.go:368: 生成master_modoverrides.lua 文件 C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Master/modoverrides.lua
2023/05/12 12:27:18 gameConfigService.go:369: 生成caves_modoverrides.lua 文件 C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Caves/modoverrides.lua
open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Master/modoverrides.lua: The system cannot find the path specified.
open C:\Users\Administrator/.klei/DoNotStarveTogether/cluster3/Caves/modoverrides.lua: The system cannot find the path specified.
2023/05/12 12:27:18 shellService.go:381: error: exit status 255
2023/05/12 12:27:18 shellService.go:388: shell exec: ps -ef | grep -v grep |grep 'Caves' |sed -n '1P'|awk '{print $2}'
Output:
'ps' is not recognized as an internal or external command,
operable program or batch file.

2.0.0 beta 版本无法启动房间里面的世界

2.0.0 beta 版本在配置好steamcmd以及DST安装位置之后,启动地上及洞穴的时候报错,详见下图
image

PS:世界配置全部都是默认的,只有增加了几个mod订阅信息,其他没有更改任何参数。

image

PS:取消mod订阅之后的日志截图。

[Bug]无法识别宕机还是手动关闭

你好,系统没有识别用户手动关闭/开启操作

例如我开启地上/地下宕机检测后,我手动关闭地上/地下

依照我的逻辑,应该是cron检测任务停止了,不在需要检测对应的世界是否宕机了。

但貌似没有这个功能,仍会自动世界。

这还会有另外的问题,游戏没更新完,就启动世界了。

问题版本:1.2.5

存档问题

Ubuntu18.04 版本1.2.4不能通过面板修改存档名称,也不能下载存档,下载存档提示{"error":"Invalid characters in parameter"}

下载steamcmd时出现问题

stdout: Not found Dont Starve Together Sever, start to installing, try: 1
stderr: /app/steamcmd/steamcmd.sh: line 29: /app/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error
stdout: Not found Dont Starve Together Sever, start to installing, try: 2
stderr: /app/steamcmd/steamcmd.sh: line 29: /app/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error
stdout: Not found Dont Starve Together Sever, start to installing, try: 3
stderr: /app/steamcmd/steamcmd.sh: line 29: /app/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error
stdout: Download Dont Starve Together Sever failed after three times

操作面板空白

操作面板点击后跳转到空白页
请问部署的详细步骤是怎样的?是先走一遍qingming大佬的dst-admin后开这个面板吗?

资源占用大

在两核服务器运行并有玩家在线时,finalShell显示 “dst-admin-go” CPU占用超过30%,是否可以优化😂

[建议]steamcmd指定文件而不是安装目录

大佬您好,提个需求。

例如在ubuntu上,用sudo apt install steamcmd,shell文件名及位置如下
/usr/games/steamcmd

您的程序先用cd xxx 在 ./steamcmd.sh执行,不能兼容,不知道有没有兴趣改成
直接指定steamcmd文件,而不是安装路径。

还有个就是
我用ln创建/usr/games/steamcmd的软链兼容steamcmd.sh文件
如果没有这个文件夹~/.steam,这个steamcmd.sh里ln创建会失败(因为它没有包含创建这个文件夹的命令),有std.err输出,然后go-admin程序直接挂了。

问题版本1.2.5

一点反馈

如果是开服之后拿自己的存档文件替换,识别不到模组。模组的更改网页端实现不了。
image

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.