mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
reverse proxy basics (#609)
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
use App\Notifications\SiteInstallationSucceed;
|
||||
use App\ValidationRules\DomainRule;
|
||||
use Exception;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
@ -38,6 +39,7 @@ public function create(Server $server, array $input): Site
|
||||
'type' => $input['type'],
|
||||
'domain' => $input['domain'],
|
||||
'aliases' => $input['aliases'] ?? [],
|
||||
'port' => $input['port'] ?? null,
|
||||
'user' => $user,
|
||||
'path' => '/home/'.$user.'/'.$input['domain'],
|
||||
'status' => SiteStatus::INSTALLING,
|
||||
@ -132,6 +134,14 @@ public static function rules(Server $server, array $input): array
|
||||
Rule::unique('sites', 'user')->where('server_id', $server->id),
|
||||
Rule::notIn($server->getSshUsers()),
|
||||
],
|
||||
'port' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
'min:1',
|
||||
'max:65535',
|
||||
Rule::unique('sites', 'port')
|
||||
->where(fn (Builder $query) => $query->where('server_id', $server->id)),
|
||||
],
|
||||
];
|
||||
|
||||
return array_merge($rules, self::typeRules($server, $input));
|
||||
|
Reference in New Issue
Block a user