Ariweb Suite 0.1.1 기반: 공통 라이브러리(db·http·세션·작업 엔진·할당/예약·알림·감사·보관소), 포털 뼈대, Webmaker/AriMail 도입 소스와 manifest
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
9ca4cee341
commit
c7aea8d419
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
// Openprovider DNS 공급자 (v1.5.36) — 1.4.0 부터 있던 lib/openprovider.js 의 영역·레코드 함수를 공통 공급자 모양(lib/dnszone.js)으로 감싼다
|
||||
const op = require('../openprovider');
|
||||
async function listZones() { const d = await op.call('GET', '/dns/zones', null, { limit: 500 }); return ((d && d.results) || []).map((z) => ({ id: z.id, name: String(z.name || '').toLowerCase(), nameServers: [] })); }
|
||||
async function getZone(domain) { const z = await op.getZone(domain); return z ? { id: z.id, name: String(domain).toLowerCase(), nameServers: (z.name_servers || []).map((x) => x.name || x) } : null; }
|
||||
async function createZone(domain, records) { const z = await getZone(domain); if (z) { if (records && records.length) await op.updateRecords(domain, { add: records }); return z; } await op.createZone(domain, records || []); return (await getZone(domain)) || { id: null, name: domain, nameServers: [] }; }
|
||||
async function deleteZone(domain) { const z = await op.getZone(domain); if (!z) return { ok: true, existed: false }; await op.call('DELETE', `/dns/zones/${encodeURIComponent(domain)}`); return { ok: true, existed: true }; }
|
||||
module.exports = { id: 'openprovider', label: 'Openprovider DNS', ready: op.ready, listZones, getZone, createZone, deleteZone, listRecords: op.listRecords, updateRecords: op.updateRecords, nameServers: async (d) => { const z = await getZone(d); return z ? z.nameServers : []; } };
|
||||
Reference in New Issue
Block a user