mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
fix ipv6 (#96)
This commit is contained in:
parent
0420babdef
commit
55bf8b8ecf
@ -118,7 +118,6 @@ private function validateInputs(array $input): void
|
|||||||
if ($input['provider'] == 'custom') {
|
if ($input['provider'] == 'custom') {
|
||||||
$rules['ip'] = [
|
$rules['ip'] = [
|
||||||
'required',
|
'required',
|
||||||
'ip',
|
|
||||||
new RestrictedIPAddressesRule(),
|
new RestrictedIPAddressesRule(),
|
||||||
];
|
];
|
||||||
$rules['port'] = [
|
$rules['port'] = [
|
||||||
|
@ -64,11 +64,15 @@ public function setLog(string $logType, $siteId = null): void
|
|||||||
*/
|
*/
|
||||||
public function connect(bool $sftp = false): void
|
public function connect(bool $sftp = false): void
|
||||||
{
|
{
|
||||||
|
$ip = $this->server->ip;
|
||||||
|
if (str($ip)->contains(':')) {
|
||||||
|
$ip = '['.$ip.']';
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if ($sftp) {
|
if ($sftp) {
|
||||||
$this->connection = new SFTP($this->server->ip, $this->server->port);
|
$this->connection = new SFTP($ip, $this->server->port);
|
||||||
} else {
|
} else {
|
||||||
$this->connection = new SSH2($this->server->ip, $this->server->port);
|
$this->connection = new SSH2($ip, $this->server->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
$login = $this->connection->login($this->user, $this->privateKey);
|
$login = $this->connection->login($this->user, $this->privateKey);
|
||||||
|
@ -14,7 +14,6 @@ public function createValidationRules(array $input): array
|
|||||||
return [
|
return [
|
||||||
'ip' => [
|
'ip' => [
|
||||||
'required',
|
'required',
|
||||||
'ip',
|
|
||||||
Rule::unique('servers', 'ip'),
|
Rule::unique('servers', 'ip'),
|
||||||
new RestrictedIPAddressesRule(),
|
new RestrictedIPAddressesRule(),
|
||||||
],
|
],
|
||||||
|
@ -4,7 +4,8 @@ export DEBIAN_FRONTEND=noninteractive
|
|||||||
export NEEDRESTART_MODE=a
|
export NEEDRESTART_MODE=a
|
||||||
export V_USERNAME=vito
|
export V_USERNAME=vito
|
||||||
export V_PASSWORD=$(openssl rand -base64 12)
|
export V_PASSWORD=$(openssl rand -base64 12)
|
||||||
export V_IP_ADDRESS=$(curl https://freeipapi.com)
|
export V_IP_ADDRESS=$(curl https://freeipapi.com --silent)
|
||||||
|
export V_IS_DOMAIN=1
|
||||||
|
|
||||||
echo "Enter the domain you want to install Vito? (your-domain.com)"
|
echo "Enter the domain you want to install Vito? (your-domain.com)"
|
||||||
echo "Hit enter to use your IP address (${V_IP_ADDRESS}):"
|
echo "Hit enter to use your IP address (${V_IP_ADDRESS}):"
|
||||||
@ -13,6 +14,7 @@ read V_DOMAIN
|
|||||||
|
|
||||||
if [[ -z "${V_DOMAIN}" ]]; then
|
if [[ -z "${V_DOMAIN}" ]]; then
|
||||||
export V_DOMAIN=${V_IP_ADDRESS}
|
export V_DOMAIN=${V_IP_ADDRESS}
|
||||||
|
export V_IS_DOMAIN=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Enter your email address:"
|
echo "Enter your email address:"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user