Refactor Redis password handling and migration to use environment variables
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
@@ -141,7 +141,9 @@ class General extends Component
|
||||
$this->database->refresh();
|
||||
$this->refreshView();
|
||||
}
|
||||
private function refreshView() {
|
||||
|
||||
private function refreshView()
|
||||
{
|
||||
$this->db_url = $this->database->internal_db_url;
|
||||
$this->db_url_public = $this->database->external_db_url;
|
||||
$this->redis_version = $this->database->getRedisVersion();
|
||||
@@ -158,5 +160,4 @@ class General extends Component
|
||||
{
|
||||
return $this->database->runtime_environment_variables()->where('key', $name)->where('is_shared', true)->exists();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -101,5 +101,4 @@ class InstanceSettings extends Model implements SendsEmail
|
||||
|
||||
return "[{$instanceName}]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ class StandaloneRedis extends BaseModel
|
||||
|
||||
protected $appends = ['internal_db_url', 'external_db_url', 'database_type', 'server_status'];
|
||||
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function ($database) {
|
||||
@@ -333,8 +332,9 @@ class StandaloneRedis extends BaseModel
|
||||
get: function () {
|
||||
$username = $this->runtime_environment_variables()->where('key', 'REDIS_USERNAME')->first();
|
||||
if (! $username) {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return $username->value;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user