bs-community / blessing-skin-server

Web application brings your custom skins back in offline Minecraft servers.
MIT License
835 stars 118 forks source link

数据库密码中包含特殊符号会无法安装 #572

Closed Yue-plus closed 1 year ago

Yue-plus commented 1 year ago

Blessing Skin 版本

6.0.2

PHP 版本

8.1

出现问题时所使用的浏览器

Microsoft Edge

您正在使用的 Web Server

Apache

您正在使用宝塔吗?

出现了什么问题?

数据库密码中包含特殊符号(例如 !@#$%^&*() 之类的)会无法安装

手动改 .env 文件,给 DB_PASSWORD= 的内容加上引号就可以了。

应该是保存密码到 .env 文件的时候没带引号,导致读取的时候没识别成字符串。

错误日志

[2023-06-27 22:38:21] production.ERROR: file_get_contents(/var/www/blessing-skin/.env): Failed to open stream: No such file or directory {"exception":"[object] (ErrorException(code: 0): file_get_contents(/var/www/blessing-skin/.env): Failed to open stream: No such file or directory at /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php:96)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php(96): file_get_contents()
#2 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php(80): Illuminate\\Foundation\\Console\\KeyGenerateCommand->writeNewEnvironmentFileWith()
#3 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php(45): Illuminate\\Foundation\\Console\\KeyGenerateCommand->setKeyInEnvironmentFile()
#4 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Foundation\\Console\\KeyGenerateCommand->handle()
#5 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#6 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#7 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#8 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call()
#9 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call()
#10 /var/www/blessing-skin/vendor/symfony/console/Command/Command.php(298): Illuminate\\Console\\Command->execute()
#11 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#12 /var/www/blessing-skin/vendor/symfony/console/Application.php(1005): Illuminate\\Console\\Command->run()
#13 /var/www/blessing-skin/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
#14 /var/www/blessing-skin/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
#15 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\\Component\\Console\\Application->run()
#16 /var/www/blessing-skin/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#17 /var/www/blessing-skin/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#18 {main}
"}

重现步骤

QQ截图20230627224856

此处输入了正确的密码,但仍然提示密码错误

QQ截图20230627230710

SRY-CTB commented 1 year ago

.....file_get_contents(/var/www/blessing-skin/.env): Failed to open stream: No such file or....... 有没有可能他找不到.env,或者他没有读取权限

Yue-plus commented 1 year ago

这个日志可能是刚安装的时候生成的,我这边带特殊符号的密码在 .env 里删掉引号就不行了: image

SRY-CTB commented 1 year ago

特殊符号不带引号,可能不会被正确认为是一个字符串值,可能会被认定为语法错误呢

Yue-plus commented 1 year ago

特殊符号不带引号,可能不会被正确认为是一个字符串值,可能会被认定为语法错误呢

求求修修这个bug,我设个带符号的强密码改来改去发现还是配置文件的锅。

安装时那个数据库配置表单填密码保存到 .env 文件的时候默认带个引号就可以了。

D`C{)QJ}$SJD$X9ZHU $HYX