Anankke / SSPanel-UIM

Multi-purpose proxy service management system
MIT License
9.41k stars 3.4k forks source link

[BUG] 访问clash订阅链接时报500错误 #2230

Closed ligongfu closed 11 months ago

ligongfu commented 12 months ago

Environment 环境

OS: Ubuntu 20.04.6 LTS HTTPS enabled: enabled PHP version: 8.1 DB version: MariaDB 10.7.3 Redis version: 7 Commit: 77ab567722fae25f37a46b96a24c07dec9e8cfac

Bug Info

Describe the issue you run into. 请描述你遇到的问题。 访问clash订阅链接时报500错误,具体为:

Warning
: Undefined array key "network" in
/www/wwwroot/panel/src/Services/Subscribe/Clash.php
on line
129

在使用2023.5时没错误,升级到2023.6才出错的

zlingxi commented 12 months ago

这不是bug,这次更新的时候有一些php依赖要提前部署好,并且升级一下appprofile好吧,这么多年,作者更新很难的好吧

ligongfu commented 12 months ago

这不是bug,这次更新的时候有一些php依赖要提前部署好,并且升级一下appprofile好吧,这么多年,作者更新很难的好吧

感谢回复,我已经安装了新增要求的PHP依赖yaml,同时更新了appprofile,再次运行升级脚本后进行clash订阅链接的访问不再报500错误,可以成功进行clash配置文件的下载,但下载后的文件顶部依然出现了Warning,影响正常使用。不知是什么原因造成,兴许是DB version不够?

AutisticShark commented 12 months ago

It seems this issue only affects those who use plain vmess/trojan nodes, without network(aka transport plugins) configured, and it only affects the Clash subscription interface.

After code review, it looks like a PHP ternary operator somehow did not catch this edge case and resulted in an undefined value being passed to the final output array.

AutisticShark commented 12 months ago

A patch will be available when the next dev PR is merged into the main repo.

AutisticShark commented 11 months ago

Fixed at https://github.com/Anankke/SSPanel-Uim/commit/edb612fafe22ffee6c675fcd4fd6463b7b3e565b.