cfmgrv4 init...4

This commit is contained in:
최준흠 2024-10-27 21:13:12 +09:00
parent cd62171712
commit 09f70ade85
4 changed files with 83 additions and 78 deletions

View File

@ -1,47 +1,47 @@
<?php
return [
'title' => "Record정보",
'label' => [
'uid' => "번호",
'zone_uid' => "도메인",
'type' => "Type",
'host' => "호스트명",
'content' => "IP정보",
'ttl' => "TTL",
'proxiable' => "proxiable",
'fixed' => "CDN잠금",
'proxied' => "CDN사용여부",
'locked' => "서비스",
'title' => "Record정보",
'label' => [
'uid' => "번호",
'zone_uid' => "도메인",
'type' => "Type",
'host' => "호스트명",
'content' => "IP정보",
'ttl' => "TTL",
'proxiable' => "proxiable",
'fixed' => "CDN잠금",
'proxied' => "CDN사용여부",
'locked' => "서비스",
'updated_at' => "수정일",
'created_at' => "작성일",
'hosts' => "호스트명",
'hosts' => "호스트명",
],
"ZONE_UID" => [],
"TYPE" => [
'A' => 'A',
"ZONE_UID" => [],
"TYPE" => [
'A' => 'A',
'CNAME' => 'CNAME',
'NS' => 'NS',
'MX' => 'MX',
'PTR' => 'PTR',
'SPF' => 'SPF',
'TXT' => 'TXT',
'SRV' => 'SRV',
'INFO' => 'INFO',
'NS' => 'NS',
'MX' => 'MX',
'PTR' => 'PTR',
'SPF' => 'SPF',
'TXT' => 'TXT',
'SRV' => 'SRV',
'INFO' => 'INFO',
],
"FIXED" => [
"on" => "고정",
"FIXED" => [
"on" => "고정",
"off" => "비고정",
],
"PROXIABLE" => [
"on" => "사용",
"on" => "사용",
"off" => "사용 않함",
],
"PROXIED" => [
"on" => "CDN 사용",
"PROXIED" => [
"on" => "CDN 사용",
"off" => "CDN 미사용",
],
"LOCKED" => [
"on" => "운영중",
"LOCKED" => [
"on" => "운영중",
"off" => "잠김",
],
];

View File

@ -1,62 +1,62 @@
<?php
return [
'title' => "Zone정보",
'label' => [
'uid' => "번호",
'account_uid' => "계정",
'domain' => "도메인",
'name_servers' => "네임서버",
'title' => "Zone정보",
'label' => [
'uid' => "번호",
'account_uid' => "계정",
'domain' => "도메인",
'name_servers' => "네임서버",
'original_name_servers' => "이전네임서버",
'plan' => "plan",
'development_mode' => "개발모드",
'ipv6' => "ipv6",
'security_level' => "공격방어",
'ssl_mode' => "SSL모드",
'always_use_https' => "https사용",
'status' => "서비스",
'updated_at' => "수정일",
'created_at' => "작성일",
'domains' => "도메인명",
'hosts' => "호스트명",
'type' => "TYPE",
'content' => "IP정보",
'proxied' => "CDN기능",
'plan' => "plan",
'development_mode' => "개발모드",
'ipv6' => "ipv6",
'security_level' => "공격방어",
'ssl_mode' => "SSL모드",
'always_use_https' => "https사용",
'status' => "서비스",
'updated_at' => "수정일",
'created_at' => "작성일",
'domains' => "도메인명",
'hosts' => "호스트명",
'type' => "TYPE",
'content' => "IP정보",
'proxied' => "CDN기능",
],
"ACCOUNT_UID" => [],
"ACCOUNT_UID" => [],
"DEVELOPMENT_MODE" => [
"on" => "사용",
"on" => "사용",
"off" => "사용않함",
],
"PLAN" => [
"Free Website" => "Free",
"PLAN" => [
"Free Website" => "Free",
"Pro Website" => "Pro",
"Business Website" => "Business",
],
"IPV6" => [
"on" => "사용",
"IPV6" => [
"on" => "사용",
"off" => "사용않함",
],
"SECURITY_LEVEL" => [
"under_attack" => "under_attack",
"medium" => "medium",
"low" => "low",
"SECURITY_LEVEL" => [
"under_attack" => "under_attack",
"medium" => "medium",
"low" => "low",
"essentially_off" => "essentially_off",
],
"ALWAYS_USE_HTTPS" => [
"on" => "사용",
"ALWAYS_USE_HTTPS" => [
"on" => "사용",
"off" => "사용않함",
],
"SSL_MODE" => [
"off" => "off",
"flexible" => "flexible",
"full" => "full",
"SSL_MODE" => [
"off" => "off",
"flexible" => "flexible",
"full" => "full",
"strict" => "strict",
"origin_pull" => "origin_pull"
],
"STATUS" => [
"STATUS" => [
"initializing" => "initializing",
"pending" => "pending",
"active" => "active",
"active" => "active",
"moved" => "moved"
],
];

View File

@ -168,7 +168,7 @@ class RecordService extends CloudflareService
$entitys = [];
try {
$results = $this->reload_procedure("zones/{$this->getParentEntity()->getPK()}/dns_records");
$total = count($results);
$total = count($results);
if ($total > 0) {
$cnt = 1;
foreach ($results as $result) {

View File

@ -170,19 +170,24 @@ class ZoneService extends CloudflareService
$entitys = [];
try {
$results = $this->reload_procedure("zones");
$cnt = 1;
$total = count($results);
$cnt = 1;
$total = count($results);
if ($total > 0) {
foreach ($results as $result) {
if (!is_object($result) || get_class($result) !== 'stdClass') {
throw new \Exception("Zone: result is not a stdClass:\n" . var_export($result, true) . "\n");
log_message("error", "Zone: result is not a stdClass:\n" . var_export($result, true) . "\n");
continue;
}
if (isset($result->status) && $result->status === 'active') {
$formDatas = $this->getArrayByResult($result);
$formDatas = $this->getCFSetting($formDatas[ZoneModel::PK], $formDatas);
$entity = $this->getModel()->modify(new ZoneEntity(), $formDatas);
log_message("debug", "{$cnt}/{$total} => {$entity->getTitle()} Zone 처리,[{$this->getMySocket()::$_request}]");
$entitys[$entity->getPK()] = $entity;
$cnt++;
} else {
log_message("error", "Zone is abnomral status:\n" . var_export($result, true) . "\n");
}
$formDatas = $this->getArrayByResult($result);
$formDatas = $this->getCFSetting($formDatas[ZoneModel::PK], $formDatas);
$entity = $this->getModel()->modify(new ZoneEntity(), $formDatas);
log_message("debug", "{$cnt}/{$total} => {$entity->getTitle()} Zone 처리,[{$this->getMySocket()::$_request}]");
$entitys[$entity->getPK()] = $entity;
$cnt++;
}
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
$this->getModel()->where(ZoneModel::PARENT, value: $this->getParentEntity()->getPK());