在 Docker 环境中读取 INSTALL 环境变量判断是否已经安装

This commit is contained in:
xboard 2023-12-04 20:30:38 +08:00
parent 4a6339c9db
commit aa0fe64afe

View File

@ -7,7 +7,6 @@ use Illuminate\Encryption\Encrypter;
use App\Models\User;
use App\Utils\Helper;
use Illuminate\Support\Env;
use Illuminate\Support\Facades\DB;
class XboardInstall extends Command
{
@ -51,7 +50,9 @@ class XboardInstall extends Command
$this->info(" \ \/ / | __ \ / _ \ / _` | '__/ _` | ");
$this->info(" / /\ \ | |_) | (_) | (_| | | | (_| | ");
$this->info("/_/ \_\|____/ \___/ \__,_|_| \__,_| ");
if (\File::exists(base_path() . '/.env') && $this->getEnvValue('INSTALLED')) {
if ((\File::exists(base_path() . '/.env') && $this->getEnvValue('INSTALLED'))
|| (env('INSTALLED', false) && $isDocker)
) {
$securePath = admin_setting('secure_path', admin_setting('frontend_admin_path', hash('crc32b', config('app.key'))));
$this->info("访问 http(s)://你的站点/{$securePath} 进入管理面板,你可以在用户中心修改你的密码。");
$this->warn("如需重新安装请清空目录下 .env 文件的内容Docker安装方式不可以删除此文件");