mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 16:55:56 +03:00
[GH-ISSUE #978] 请教一个问题,为什么每次更换了nginx-ui的镜像后 之前直接挂载的数据 就没办法用了,必须走备份恢复逻辑吗? #6298
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#6298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @freshgeek on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/978
请教一个问题,为什么每次更换了nginx-ui的镜像后 之前直接挂载的数据 就没办法用了,必须走备份恢复逻辑吗?
比如:我把整个nginx 、 nginx-ui 、 www 几个关键文件做了存储卷挂载
然后启动新的nginx-ui 镜像,版本不一致的话,同样的账号密码就无法登录进去了,只能重新初始化 拷贝文件?
@0xJacky commented on GitHub (Apr 21, 2025):
不可能的,看看命令,你是不是挂载错文件夹了
@freshgeek commented on GitHub (Apr 21, 2025):
我是参考文档中的 执行:
docker run -d --name=nginx --restart=always -v ./nginx:/etc/nginx -v ./nginx:/etc/nginx-ui -v ./nginx:/var/www -p 80:80 -p 443:443
我好像猜到原因了,是不是需要配置固定的 NGINX_UI_APP_JWT_SECRET
@0xJacky commented on GitHub (Apr 21, 2025):
参考文档可不是让你三个文件夹都映射在同一个文件夹里,这样可能会有安全风险,你可以先试试分开文件夹来映射
@0xJacky commented on GitHub (Apr 21, 2025):
不需要,app.ini 里有写入就可以
@freshgeek commented on GitHub (Apr 21, 2025):
嗯 这个不重名就不要紧,因为云服务不支持子目录,所以只能先挂一个下面,不然得创建三个挂载点
@freshgeek commented on GitHub (Apr 21, 2025):
核对这个是相同的
@freshgeek commented on GitHub (Apr 21, 2025):
日志好像显示是: record not found
/root/workspace/__flow_work/__flow_builds/12c7912a-7c7d-42e8-9068-a84b6113d9a3/workspace/nginx-ui_9uNW/internal/user/login.go:14 record not found
[0.077ms] [rows:0] SELECT * FROM
authsWHEREauths.name= "xx" ANDauths.deleted_atIS NULL ORDER BYauths.idLIMIT 1[GIN] 2025/04/21 - 01:18:15 | 403 | 87.864µs | 221.127.201.167 | GET "/api/notifications/live"
[GIN] 2025/04/21 - 01:18:15 | 403 | 160.395µs | 221.127.201.167 | GET "/api/notifications/live"
[GIN] 2025/04/21 - 01:18:20 | 403 | 65.697µs | 221.127.201.167 | GET "/api/notifications/live"
@freshgeek commented on GitHub (Apr 21, 2025):
好像下发的公钥不一样 api/crypto/public_key ,但是看没有和环境相关,都是缓存10分钟轮转
@0xJacky commented on GitHub (Apr 21, 2025):
跟这个没关系,这个是安全性设计JackyOn Apr 21, 2025, at 9:50 AM, Chen.Chao @.> wrote:
好像下发的公钥不一样 api/crypto/public_key—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>
freshgeek left a comment (0xJacky/nginx-ui#978)
好像下发的公钥不一样 api/crypto/public_key
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
@0xJacky commented on GitHub (Apr 21, 2025):
说明数据库中没有这个 name 的记录
@freshgeek commented on GitHub (Apr 21, 2025):
这个auth 应该是三方授权吧,用户在user表 ,问题是 login.go:14 这条没找到,但是从挂载的文件夹把数据库user表拉出来看是有数据的,名字从日志中可以看到是正确的,那么是否是密码hash 有问题,在不同平台上有差异?
@0xJacky commented on GitHub (Apr 21, 2025):
额?你用的什么版本,我还没发布呢
@freshgeek commented on GitHub (Apr 21, 2025):
老的镜像tag是 sha-c5ea44c
新的镜像是main 分支构建的
@0xJacky commented on GitHub (Apr 21, 2025):
你是在新的
c5ea44c镜像中安装了,然后回退到 main 分支构建的镜像了吗@freshgeek commented on GitHub (Apr 21, 2025):
嗯 那么说 main 是更老的吗
@0xJacky commented on GitHub (Apr 21, 2025):
那没事,你等rc.6吧,要不就在 main 上再装一次。main 肯定是老的,但是我没发布之前 dev 不推荐在生产环境上使用,也不会提供降级回退的功能。
@freshgeek commented on GitHub (Apr 21, 2025):
好的 ,那main 是稳定的线上吧
@0xJacky commented on GitHub (Apr 21, 2025):
是的