Fix: remote servers with port and user
This commit is contained in:
parent
d74cfd09ce
commit
d378bb94be
2 changed files with 12 additions and 10 deletions
|
|
@ -247,11 +247,12 @@ public function savePrivateKey()
|
||||||
public function saveServer()
|
public function saveServer()
|
||||||
{
|
{
|
||||||
$this->validate([
|
$this->validate([
|
||||||
'remoteServerName' => 'required',
|
'remoteServerName' => 'required|string',
|
||||||
'remoteServerHost' => 'required',
|
'remoteServerHost' => 'required|string',
|
||||||
'remoteServerPort' => 'required|integer',
|
'remoteServerPort' => 'required|integer',
|
||||||
'remoteServerUser' => 'required',
|
'remoteServerUser' => 'required|string',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->privateKey = formatPrivateKey($this->privateKey);
|
$this->privateKey = formatPrivateKey($this->privateKey);
|
||||||
$foundServer = Server::whereIp($this->remoteServerHost)->first();
|
$foundServer = Server::whereIp($this->remoteServerHost)->first();
|
||||||
if ($foundServer) {
|
if ($foundServer) {
|
||||||
|
|
@ -379,8 +380,8 @@ public function saveAndValidateServer()
|
||||||
'name' => $this->remoteServerName,
|
'name' => $this->remoteServerName,
|
||||||
'port' => $this->remoteServerPort,
|
'port' => $this->remoteServerPort,
|
||||||
'user' => $this->remoteServerUser,
|
'user' => $this->remoteServerUser,
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'UTC',
|
||||||
]);
|
]);
|
||||||
$this->validateServer();
|
$this->validateServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,13 @@ protected static function booted()
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'ip',
|
||||||
'port',
|
'port',
|
||||||
'user',
|
'user',
|
||||||
|
'description',
|
||||||
|
'private_key_id',
|
||||||
|
'team_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
@ -148,11 +153,7 @@ public static function destinationsByServer(string $server_id)
|
||||||
|
|
||||||
public function settings()
|
public function settings()
|
||||||
{
|
{
|
||||||
return $this->hasOne(ServerSetting::class)->withDefault([
|
return $this->hasOne(ServerSetting::class);
|
||||||
'force_disabled' => false,
|
|
||||||
'is_reachable' => false,
|
|
||||||
'is_usable' => false,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setupDefault404Redirect()
|
public function setupDefault404Redirect()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue