mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
rename to checkRule
This commit is contained in:
@@ -11,7 +11,7 @@ class Certificate extends Event
|
||||
public const string ACTION_DOMAIN_VERIFICATION = 'verification';
|
||||
public const string ACTION_GENERATION = 'generation';
|
||||
protected bool $skipRenewCheck = false;
|
||||
protected bool $skipRule = false;
|
||||
protected bool $checkRule = true;
|
||||
protected string $action = self::ACTION_GENERATION;
|
||||
protected ?Document $domain = null;
|
||||
protected ?string $validationDomain = null;
|
||||
@@ -96,26 +96,26 @@ class Certificate extends Event
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if rule lookup and updates should be skipped.
|
||||
* Set if rule lookup and updates should be checked.
|
||||
*
|
||||
* @param bool $skipRule
|
||||
* @param bool $checkRule
|
||||
* @return self
|
||||
*/
|
||||
public function setSkipRule(bool $skipRule): self
|
||||
public function setCheckRule(bool $checkRule): self
|
||||
{
|
||||
$this->skipRule = $skipRule;
|
||||
$this->checkRule = $checkRule;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if rule lookup and updates should be skipped.
|
||||
* Return if rule lookup and updates should be checked.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSkipRule(): bool
|
||||
public function getCheckRule(): bool
|
||||
{
|
||||
return $this->skipRule;
|
||||
return $this->checkRule;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +152,7 @@ class Certificate extends Event
|
||||
'project' => $this->project,
|
||||
'domain' => $this->domain,
|
||||
'skipRenewCheck' => $this->skipRenewCheck,
|
||||
'skipRule' => $this->skipRule,
|
||||
'checkRule' => $this->checkRule,
|
||||
'validationDomain' => $this->validationDomain,
|
||||
'action' => $this->action
|
||||
];
|
||||
|
||||
@@ -23,15 +23,15 @@ class SSL extends Action
|
||||
->desc('Validate server certificates')
|
||||
->param('domain', System::getEnv('_APP_DOMAIN', ''), new Hostname(), 'Domain to generate certificate for. If empty, main domain will be used.', true)
|
||||
->param('skip-check', true, new Boolean(true), 'If DNS and renew check should be skipped. Defaults to true, and when true, all jobs will result in certificate generation attempt.', true)
|
||||
->param('skip-rule', false, new Boolean(true), 'If rule lookup and updates should be skipped. Defaults to false. Set to true for domains without a rule in DB (e.g., _APP_DOMAIN).', true)
|
||||
->param('check-rule', true, new Boolean(true), 'If rule lookup and updates should be checked. Defaults to true. Set to false for domains without a rule in DB (e.g., _APP_DOMAIN).', true)
|
||||
->inject('queueForCertificates')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
public function action(string $domain, bool|string $skipCheck, bool|string $skipRule, Certificate $queueForCertificates): void
|
||||
public function action(string $domain, bool|string $skipCheck, bool|string $checkRule, Certificate $queueForCertificates): void
|
||||
{
|
||||
$skipCheck = \strval($skipCheck) === 'true';
|
||||
$skipRule = \strval($skipRule) === 'true';
|
||||
$checkRule = \strval($checkRule) === 'true';
|
||||
|
||||
Console::success('Scheduling a job to issue a TLS certificate for domain: ' . $domain);
|
||||
|
||||
@@ -40,7 +40,7 @@ class SSL extends Action
|
||||
'domain' => $domain
|
||||
]))
|
||||
->setSkipRenewCheck($skipCheck)
|
||||
->setSkipRule($skipRule)
|
||||
->setCheckRule($checkRule)
|
||||
->trigger();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class Certificates extends Action
|
||||
$domain = new Domain($document->getAttribute('domain', ''));
|
||||
$domainType = $document->getAttribute('domainType');
|
||||
$skipRenewCheck = $payload['skipRenewCheck'] ?? false;
|
||||
$checkRule = !$payload['skipRule'] ?? true;
|
||||
$checkRule = $payload['checkRule'] ?? true;
|
||||
$validationDomain = $payload['validationDomain'] ?? null;
|
||||
$action = $payload['action'] ?? Certificate::ACTION_GENERATION;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user