Clarify GeoIP update env setup for cached config deployments.
Deploy Ladill Link / deploy (push) Successful in 41s
Deploy Ladill Link / deploy (push) Successful in 41s
Point operators at shared/.env and config:clear when MaxMind credentials are missing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,11 +15,26 @@ class UpdateGeoIpDatabaseCommand extends Command
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$accountId = (string) config('link.maxmind_account_id', '');
|
||||
$licenseKey = (string) config('link.maxmind_license_key', '');
|
||||
$accountId = trim((string) config('link.maxmind_account_id', ''));
|
||||
$licenseKey = trim((string) config('link.maxmind_license_key', ''));
|
||||
|
||||
if ($accountId === '' || $licenseKey === '') {
|
||||
$this->error('Set MAXMIND_ACCOUNT_ID and MAXMIND_LICENSE_KEY in .env before updating GeoIP data.');
|
||||
$envPath = realpath(base_path('.env')) ?: base_path('.env');
|
||||
$configCached = is_file(base_path('bootstrap/cache/config.php'));
|
||||
|
||||
$this->error('Set MAXMIND_ACCOUNT_ID and MAXMIND_LICENSE_KEY before updating GeoIP data.');
|
||||
$this->line('');
|
||||
$this->line('Production uses the shared env file (current/.env is usually a symlink):');
|
||||
$this->line(' '.$envPath);
|
||||
$this->line('');
|
||||
$this->line('Add both variables there, then refresh config:');
|
||||
$this->line(' php artisan config:clear');
|
||||
$this->line(' php artisan link:geoip-update');
|
||||
$this->line(' php artisan config:cache');
|
||||
|
||||
if ($configCached) {
|
||||
$this->warn('Config is cached — Laravel will ignore new .env values until you run config:clear.');
|
||||
}
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user