xserver-cli 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.js +934 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -111,6 +111,81 @@ var ApiClient = class {
|
|
|
111
111
|
return this.delete(`${this.serverPath()}/mail-filter/${enc(filterId)}`);
|
|
112
112
|
}
|
|
113
113
|
// ================================================================
|
|
114
|
+
// 迷惑メールフィルタ設定
|
|
115
|
+
// ================================================================
|
|
116
|
+
async listSpamFilter(params) {
|
|
117
|
+
return this.get(`${this.serverPath()}/spam-filter`, params);
|
|
118
|
+
}
|
|
119
|
+
async updateSpamFilter(domain, data) {
|
|
120
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain)}`, data);
|
|
121
|
+
}
|
|
122
|
+
async updateSpamFilterDmarcReceiver(domain, data) {
|
|
123
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain)}/dmarc-receiver`, data);
|
|
124
|
+
}
|
|
125
|
+
// ================================================================
|
|
126
|
+
// 自動応答設定
|
|
127
|
+
// ================================================================
|
|
128
|
+
async listAutoReply(params) {
|
|
129
|
+
return this.get(`${this.serverPath()}/auto-reply`, params);
|
|
130
|
+
}
|
|
131
|
+
async getAutoReply(mailAddress) {
|
|
132
|
+
return this.get(`${this.serverPath()}/auto-reply/${enc(mailAddress)}`);
|
|
133
|
+
}
|
|
134
|
+
async addAutoReply(data) {
|
|
135
|
+
return this.post(`${this.serverPath()}/auto-reply`, data);
|
|
136
|
+
}
|
|
137
|
+
async updateAutoReply(mailAddress, data) {
|
|
138
|
+
return this.put(`${this.serverPath()}/auto-reply/${enc(mailAddress)}`, data);
|
|
139
|
+
}
|
|
140
|
+
async deleteAutoReply(mailAddress) {
|
|
141
|
+
return this.delete(`${this.serverPath()}/auto-reply/${enc(mailAddress)}`);
|
|
142
|
+
}
|
|
143
|
+
// ================================================================
|
|
144
|
+
// SMTP認証国外アクセス制限
|
|
145
|
+
// ================================================================
|
|
146
|
+
async listSmtpAbroadRestriction(params) {
|
|
147
|
+
return this.get(`${this.serverPath()}/smtp-abroad-restriction`, params);
|
|
148
|
+
}
|
|
149
|
+
async updateSmtpAbroadRestriction(domain, data) {
|
|
150
|
+
return this.put(`${this.serverPath()}/smtp-abroad-restriction/${enc(domain)}`, data);
|
|
151
|
+
}
|
|
152
|
+
// ================================================================
|
|
153
|
+
// DKIM設定
|
|
154
|
+
// ================================================================
|
|
155
|
+
async listDkim(params) {
|
|
156
|
+
return this.get(`${this.serverPath()}/dkim`, params);
|
|
157
|
+
}
|
|
158
|
+
async getDkim(fqdn) {
|
|
159
|
+
return this.get(`${this.serverPath()}/dkim/${enc(fqdn)}`);
|
|
160
|
+
}
|
|
161
|
+
async updateDkim(fqdn, data) {
|
|
162
|
+
return this.put(`${this.serverPath()}/dkim/${enc(fqdn)}`, data);
|
|
163
|
+
}
|
|
164
|
+
// ================================================================
|
|
165
|
+
// SPF設定
|
|
166
|
+
// ================================================================
|
|
167
|
+
async listSpf(params) {
|
|
168
|
+
return this.get(`${this.serverPath()}/spf`, params);
|
|
169
|
+
}
|
|
170
|
+
async addSpf(data) {
|
|
171
|
+
return this.post(`${this.serverPath()}/spf`, data);
|
|
172
|
+
}
|
|
173
|
+
async updateSpf(fqdn, data) {
|
|
174
|
+
return this.put(`${this.serverPath()}/spf/${enc(fqdn)}`, data);
|
|
175
|
+
}
|
|
176
|
+
async deleteSpf(fqdn) {
|
|
177
|
+
return this.delete(`${this.serverPath()}/spf/${enc(fqdn)}`);
|
|
178
|
+
}
|
|
179
|
+
// ================================================================
|
|
180
|
+
// DMARC設定(送信側)
|
|
181
|
+
// ================================================================
|
|
182
|
+
async listDmarc(params) {
|
|
183
|
+
return this.get(`${this.serverPath()}/dmarc`, params);
|
|
184
|
+
}
|
|
185
|
+
async updateDmarc(domain, data) {
|
|
186
|
+
return this.put(`${this.serverPath()}/dmarc/${enc(domain)}`, data);
|
|
187
|
+
}
|
|
188
|
+
// ================================================================
|
|
114
189
|
// FTP
|
|
115
190
|
// ================================================================
|
|
116
191
|
async listFtp(params) {
|
|
@@ -255,6 +330,138 @@ var ApiClient = class {
|
|
|
255
330
|
return this.delete(`${this.serverPath()}/ssh/key/${enc(keyId)}`);
|
|
256
331
|
}
|
|
257
332
|
// ================================================================
|
|
333
|
+
// リソースモニター
|
|
334
|
+
// ================================================================
|
|
335
|
+
async getResourceMonitor(date) {
|
|
336
|
+
return this.get(`${this.serverPath()}/resource-monitor`, { date });
|
|
337
|
+
}
|
|
338
|
+
// ================================================================
|
|
339
|
+
// WAF設定
|
|
340
|
+
// ================================================================
|
|
341
|
+
async listWaf(params) {
|
|
342
|
+
return this.get(`${this.serverPath()}/waf`, params);
|
|
343
|
+
}
|
|
344
|
+
async updateWaf(domain, data) {
|
|
345
|
+
return this.put(`${this.serverPath()}/waf/${enc(domain)}`, data);
|
|
346
|
+
}
|
|
347
|
+
// ================================================================
|
|
348
|
+
// php.ini設定
|
|
349
|
+
// ================================================================
|
|
350
|
+
async listPhpIni(params) {
|
|
351
|
+
return this.get(`${this.serverPath()}/php-ini`, params);
|
|
352
|
+
}
|
|
353
|
+
async updatePhpIni(domain, data) {
|
|
354
|
+
return this.put(`${this.serverPath()}/php-ini/${enc(domain)}`, data);
|
|
355
|
+
}
|
|
356
|
+
async resetPhpIni(domain) {
|
|
357
|
+
return this.post(`${this.serverPath()}/php-ini/${enc(domain)}/reset`);
|
|
358
|
+
}
|
|
359
|
+
// ================================================================
|
|
360
|
+
// WordPressセキュリティ設定
|
|
361
|
+
// ================================================================
|
|
362
|
+
async getWordPressSecurity(params) {
|
|
363
|
+
return this.get(`${this.serverPath()}/wordpress-security`, params);
|
|
364
|
+
}
|
|
365
|
+
async updateWordPressSecurity(data) {
|
|
366
|
+
return this.post(`${this.serverPath()}/wordpress-security`, data);
|
|
367
|
+
}
|
|
368
|
+
// ================================================================
|
|
369
|
+
// Xアクセラレータ設定
|
|
370
|
+
// ================================================================
|
|
371
|
+
async listXAccelerator(params) {
|
|
372
|
+
return this.get(`${this.serverPath()}/x-accelerator`, params);
|
|
373
|
+
}
|
|
374
|
+
async updateXAccelerator(domain, data) {
|
|
375
|
+
return this.put(`${this.serverPath()}/x-accelerator/${enc(domain)}`, data);
|
|
376
|
+
}
|
|
377
|
+
// ================================================================
|
|
378
|
+
// サーバーキャッシュ設定
|
|
379
|
+
// ================================================================
|
|
380
|
+
async listServerCache(params) {
|
|
381
|
+
return this.get(`${this.serverPath()}/server-cache`, params);
|
|
382
|
+
}
|
|
383
|
+
async updateServerCache(domain, data) {
|
|
384
|
+
return this.put(`${this.serverPath()}/server-cache/${enc(domain)}`, data);
|
|
385
|
+
}
|
|
386
|
+
async clearServerCache(domain) {
|
|
387
|
+
return this.delete(`${this.serverPath()}/server-cache/${enc(domain)}/cache`);
|
|
388
|
+
}
|
|
389
|
+
// ================================================================
|
|
390
|
+
// ブラウザキャッシュ設定
|
|
391
|
+
// ================================================================
|
|
392
|
+
async listBrowserCache(params) {
|
|
393
|
+
return this.get(`${this.serverPath()}/browser-cache`, params);
|
|
394
|
+
}
|
|
395
|
+
async updateBrowserCache(domain, data) {
|
|
396
|
+
return this.put(`${this.serverPath()}/browser-cache/${enc(domain)}`, data);
|
|
397
|
+
}
|
|
398
|
+
// ================================================================
|
|
399
|
+
// サイト転送設定
|
|
400
|
+
// ================================================================
|
|
401
|
+
async listUrlRedirect(params) {
|
|
402
|
+
return this.get(`${this.serverPath()}/url-redirect`, params);
|
|
403
|
+
}
|
|
404
|
+
async addUrlRedirect(data) {
|
|
405
|
+
return this.post(`${this.serverPath()}/url-redirect`, data);
|
|
406
|
+
}
|
|
407
|
+
async deleteUrlRedirect(redirectId) {
|
|
408
|
+
return this.delete(`${this.serverPath()}/url-redirect/${enc(redirectId)}`);
|
|
409
|
+
}
|
|
410
|
+
// ================================================================
|
|
411
|
+
// アクセス拒否設定
|
|
412
|
+
// ================================================================
|
|
413
|
+
async listAccessDeny(params) {
|
|
414
|
+
return this.get(`${this.serverPath()}/access-deny`, params);
|
|
415
|
+
}
|
|
416
|
+
async addAccessDeny(data) {
|
|
417
|
+
return this.post(`${this.serverPath()}/access-deny`, data);
|
|
418
|
+
}
|
|
419
|
+
async updateAccessDeny(denyId, data) {
|
|
420
|
+
return this.put(`${this.serverPath()}/access-deny/${enc(denyId)}`, data);
|
|
421
|
+
}
|
|
422
|
+
async deleteAccessDeny(denyId) {
|
|
423
|
+
return this.delete(`${this.serverPath()}/access-deny/${enc(denyId)}`);
|
|
424
|
+
}
|
|
425
|
+
// ================================================================
|
|
426
|
+
// XPageSpeed設定
|
|
427
|
+
// ================================================================
|
|
428
|
+
async listXPageSpeed(params) {
|
|
429
|
+
return this.get(`${this.serverPath()}/xpagespeed`, params);
|
|
430
|
+
}
|
|
431
|
+
async updateXPageSpeed(domain, data) {
|
|
432
|
+
return this.put(`${this.serverPath()}/xpagespeed/${enc(domain)}`, data);
|
|
433
|
+
}
|
|
434
|
+
// ================================================================
|
|
435
|
+
// 自動バックアップの取得・復元
|
|
436
|
+
// ================================================================
|
|
437
|
+
async listAutoBackupBackupDates() {
|
|
438
|
+
return this.get(`${this.serverPath()}/auto-backup/backup-dates`);
|
|
439
|
+
}
|
|
440
|
+
async listAutoBackup() {
|
|
441
|
+
return this.get(`${this.serverPath()}/auto-backup`);
|
|
442
|
+
}
|
|
443
|
+
async getAutoBackup(requestId) {
|
|
444
|
+
return this.get(`${this.serverPath()}/auto-backup/${enc(requestId)}`);
|
|
445
|
+
}
|
|
446
|
+
async createAutoBackup(data) {
|
|
447
|
+
return this.post(`${this.serverPath()}/auto-backup`, data);
|
|
448
|
+
}
|
|
449
|
+
// ================================================================
|
|
450
|
+
// MySQLバックアップの取得・復元
|
|
451
|
+
// ================================================================
|
|
452
|
+
async listMysqlBackupDatabases() {
|
|
453
|
+
return this.get(`${this.serverPath()}/mysql-backup/databases`);
|
|
454
|
+
}
|
|
455
|
+
async listMysqlBackup() {
|
|
456
|
+
return this.get(`${this.serverPath()}/mysql-backup`);
|
|
457
|
+
}
|
|
458
|
+
async getMysqlBackup(requestId) {
|
|
459
|
+
return this.get(`${this.serverPath()}/mysql-backup/${enc(requestId)}`);
|
|
460
|
+
}
|
|
461
|
+
async createMysqlBackup(data) {
|
|
462
|
+
return this.post(`${this.serverPath()}/mysql-backup`, data);
|
|
463
|
+
}
|
|
464
|
+
// ================================================================
|
|
258
465
|
// ログ
|
|
259
466
|
// ================================================================
|
|
260
467
|
async getAccessLog(params) {
|
|
@@ -425,13 +632,19 @@ function formatTable(data) {
|
|
|
425
632
|
const obj = data;
|
|
426
633
|
const arrayEntry = Object.entries(obj).find(([, v]) => Array.isArray(v) && (v.length === 0 || typeof v[0] === "object" && v[0] !== null));
|
|
427
634
|
if (arrayEntry) {
|
|
428
|
-
const
|
|
635
|
+
const [arrayKey, arrayValue] = arrayEntry;
|
|
636
|
+
const scalarEntries = Object.entries(obj).filter(([k]) => k !== arrayKey);
|
|
429
637
|
const parts = [];
|
|
430
638
|
if (scalarEntries.length > 0) {
|
|
431
639
|
parts.push(renderKeyValueTable(Object.fromEntries(scalarEntries)));
|
|
432
640
|
parts.push("");
|
|
433
641
|
}
|
|
434
|
-
|
|
642
|
+
const items = arrayValue;
|
|
643
|
+
if (items.length === 0) {
|
|
644
|
+
parts.push(scalarEntries.length > 0 ? `${arrayKey} (0\u4EF6)` : "(\u30C7\u30FC\u30BF\u306A\u3057)");
|
|
645
|
+
} else {
|
|
646
|
+
parts.push(renderArrayTable(items));
|
|
647
|
+
}
|
|
435
648
|
return parts.join("\n");
|
|
436
649
|
}
|
|
437
650
|
return renderKeyValueTable(obj);
|
|
@@ -447,10 +660,23 @@ function renderKeyValueTable(obj) {
|
|
|
447
660
|
const lines = entries.map((e) => `${padRight(e.key, maxKeyLen)} ${e.value}`);
|
|
448
661
|
return lines.join("\n");
|
|
449
662
|
}
|
|
663
|
+
function collectTableKeys(items) {
|
|
664
|
+
const keys = [];
|
|
665
|
+
const seen = /* @__PURE__ */ new Set();
|
|
666
|
+
for (const item of items) {
|
|
667
|
+
for (const key of Object.keys(item)) {
|
|
668
|
+
if (!seen.has(key)) {
|
|
669
|
+
seen.add(key);
|
|
670
|
+
keys.push(key);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return keys;
|
|
675
|
+
}
|
|
450
676
|
function renderArrayTable(items) {
|
|
451
677
|
if (items.length === 0)
|
|
452
678
|
return "(\u30C7\u30FC\u30BF\u306A\u3057)";
|
|
453
|
-
const keys =
|
|
679
|
+
const keys = collectTableKeys(items);
|
|
454
680
|
const colWidths = keys.map((key) => {
|
|
455
681
|
const headerWidth = displayWidth(key);
|
|
456
682
|
const maxDataWidth = Math.max(...items.map((item) => displayWidth(formatValue(item[key]))));
|
|
@@ -814,6 +1040,54 @@ function registerMailCommands(parent, brand) {
|
|
|
814
1040
|
});
|
|
815
1041
|
}
|
|
816
1042
|
|
|
1043
|
+
// ../core/dist/commands/server/spam-filter/index.js
|
|
1044
|
+
function parseAddressList(value) {
|
|
1045
|
+
if (value === "") {
|
|
1046
|
+
return [];
|
|
1047
|
+
}
|
|
1048
|
+
return value.split(",").map((a) => a.trim()).filter((a) => a !== "");
|
|
1049
|
+
}
|
|
1050
|
+
function registerSpamFilterCommands(parent, brand) {
|
|
1051
|
+
const spamFilter = parent.command("spam-filter").description("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A");
|
|
1052
|
+
spamFilter.command("list").description("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1053
|
+
const client = resolveClient(parent, brand);
|
|
1054
|
+
const params = {};
|
|
1055
|
+
if (opts.domain)
|
|
1056
|
+
params.domain = opts.domain;
|
|
1057
|
+
printResult(await client.listSpamFilter(params), getFormat(parent));
|
|
1058
|
+
});
|
|
1059
|
+
spamFilter.command("update <domain>").description("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09").option("--filter-type <value>", "\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\uFF08off / standard / cloudmark_authority\uFF09").option("--detection-action <action>", "\u691C\u77E5\u6642\u306E\u51E6\u7406\uFF08inbox / spam / trash / delete\uFF09").option("--white-list <addresses>", "\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--black-list <addresses>", "\u30D6\u30E9\u30C3\u30AF\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--spam-level <level>", "\u6A19\u6E96\u30B9\u30D1\u30E0\u30D5\u30A3\u30EB\u30BF\u5224\u5B9A\u57FA\u6E96\uFF08very_lenient / lenient / normal / strict / very_strict / strictest\uFF09").option("--strict-non-japanese-subject <value>", "\u65E5\u672C\u8A9E\u3092\u542B\u307E\u306A\u3044\u4EF6\u540D\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B\uFF08true/false\uFF09").option("--strict-html-mail <value>", "HTML\u30E1\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B\uFF08true/false\uFF09").action(async (domain, opts) => {
|
|
1060
|
+
const data = {};
|
|
1061
|
+
if (opts.filterType !== void 0)
|
|
1062
|
+
data.filter_type = opts.filterType;
|
|
1063
|
+
if (opts.detectionAction !== void 0)
|
|
1064
|
+
data.detection_action = opts.detectionAction;
|
|
1065
|
+
if (opts.whiteList !== void 0)
|
|
1066
|
+
data.white_list = parseAddressList(opts.whiteList);
|
|
1067
|
+
if (opts.blackList !== void 0)
|
|
1068
|
+
data.black_list = parseAddressList(opts.blackList);
|
|
1069
|
+
if (opts.spamLevel !== void 0)
|
|
1070
|
+
data.spam_level = opts.spamLevel;
|
|
1071
|
+
if (opts.strictNonJapaneseSubject !== void 0) {
|
|
1072
|
+
data.strict_non_japanese_subject = opts.strictNonJapaneseSubject;
|
|
1073
|
+
}
|
|
1074
|
+
if (opts.strictHtmlMail !== void 0) {
|
|
1075
|
+
data.strict_html_mail = opts.strictHtmlMail;
|
|
1076
|
+
}
|
|
1077
|
+
if (Object.keys(data).length === 0) {
|
|
1078
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1079
|
+
}
|
|
1080
|
+
const client = resolveClient(parent, brand);
|
|
1081
|
+
printResult(await client.updateSpamFilter(domain, data), getFormat(parent));
|
|
1082
|
+
});
|
|
1083
|
+
spamFilter.command("dmarc-receiver-update <domain>").description("\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0").requiredOption("--dmarc-receiver <value>", "\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A\uFF08true/false\uFF09").action(async (domain, opts) => {
|
|
1084
|
+
const client = resolveClient(parent, brand);
|
|
1085
|
+
printResult(await client.updateSpamFilterDmarcReceiver(domain, {
|
|
1086
|
+
dmarc_receiver: opts.dmarcReceiver
|
|
1087
|
+
}), getFormat(parent));
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
|
|
817
1091
|
// ../core/dist/commands/server/mail-filter/index.js
|
|
818
1092
|
function registerMailFilterCommands(parent, brand) {
|
|
819
1093
|
const mailFilter = parent.command("mail-filter").description("\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u8A2D\u5B9A");
|
|
@@ -848,6 +1122,155 @@ function registerMailFilterCommands(parent, brand) {
|
|
|
848
1122
|
});
|
|
849
1123
|
}
|
|
850
1124
|
|
|
1125
|
+
// ../core/dist/commands/server/auto-reply/index.js
|
|
1126
|
+
function registerAutoReplyCommands(parent, brand) {
|
|
1127
|
+
const autoReply = parent.command("auto-reply").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A");
|
|
1128
|
+
autoReply.command("list").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1129
|
+
const client = resolveClient(parent, brand);
|
|
1130
|
+
const params = {};
|
|
1131
|
+
if (opts.domain)
|
|
1132
|
+
params.domain = opts.domain;
|
|
1133
|
+
printResult(await client.listAutoReply(params), getFormat(parent));
|
|
1134
|
+
});
|
|
1135
|
+
autoReply.command("get <mailAddress>").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97").action(async (mailAccount) => {
|
|
1136
|
+
const client = resolveClient(parent, brand);
|
|
1137
|
+
printResult(await client.getAutoReply(mailAccount), getFormat(parent));
|
|
1138
|
+
});
|
|
1139
|
+
autoReply.command("add").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3").requiredOption("--mail-address <address>", "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9").requiredOption("--from-name <name>", "\u9001\u4FE1\u8005\u540D").requiredOption("--subject <subject>", "\u4EF6\u540D").requiredOption("--body <body>", "\u672C\u6587").requiredOption("--quote-incoming <value>", "\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (opts) => {
|
|
1140
|
+
const client = resolveClient(parent, brand);
|
|
1141
|
+
printResult(await client.addAutoReply({
|
|
1142
|
+
domain: opts.domain,
|
|
1143
|
+
mail_address: opts.mailAddress,
|
|
1144
|
+
from_name: opts.fromName,
|
|
1145
|
+
subject: opts.subject,
|
|
1146
|
+
body: opts.body,
|
|
1147
|
+
quote_incoming: opts.quoteIncoming
|
|
1148
|
+
}), getFormat(parent));
|
|
1149
|
+
});
|
|
1150
|
+
autoReply.command("update <mailAddress>").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09").option("--from-name <name>", "\u9001\u4FE1\u8005\u540D").option("--subject <subject>", "\u4EF6\u540D").option("--body <body>", "\u672C\u6587").option("--quote-incoming <value>", "\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (mailAccount, opts) => {
|
|
1151
|
+
const data = {};
|
|
1152
|
+
if (opts.fromName !== void 0)
|
|
1153
|
+
data.from_name = opts.fromName;
|
|
1154
|
+
if (opts.subject !== void 0)
|
|
1155
|
+
data.subject = opts.subject;
|
|
1156
|
+
if (opts.body !== void 0)
|
|
1157
|
+
data.body = opts.body;
|
|
1158
|
+
if (opts.quoteIncoming !== void 0) {
|
|
1159
|
+
data.quote_incoming = opts.quoteIncoming;
|
|
1160
|
+
}
|
|
1161
|
+
if (Object.keys(data).length === 0) {
|
|
1162
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08--from-name / --subject / --body / --quote-incoming\uFF09");
|
|
1163
|
+
}
|
|
1164
|
+
const client = resolveClient(parent, brand);
|
|
1165
|
+
printResult(await client.updateAutoReply(mailAccount, data), getFormat(parent));
|
|
1166
|
+
});
|
|
1167
|
+
autoReply.command("delete <mailAddress>").description("\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u524A\u9664").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (mailAccount) => {
|
|
1168
|
+
await confirmDestructiveAction(parent, `\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A "${mailAccount}" \u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
1169
|
+
const client = resolveClient(parent, brand);
|
|
1170
|
+
printResult(await client.deleteAutoReply(mailAccount), getFormat(parent));
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
// ../core/dist/commands/server/smtp-abroad-restriction/index.js
|
|
1175
|
+
function registerSmtpAbroadRestrictionCommands(parent, brand) {
|
|
1176
|
+
const smtpAbroadRestriction = parent.command("smtp-abroad-restriction").description("SMTP\u8A8D\u8A3C\u306E\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u8A2D\u5B9A");
|
|
1177
|
+
smtpAbroadRestriction.command("list").description("SMTP\u8A8D\u8A3C\u306E\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1178
|
+
const client = resolveClient(parent, brand);
|
|
1179
|
+
const params = {};
|
|
1180
|
+
if (opts.domain)
|
|
1181
|
+
params.domain = opts.domain;
|
|
1182
|
+
printResult(await client.listSmtpAbroadRestriction(params), getFormat(parent));
|
|
1183
|
+
});
|
|
1184
|
+
smtpAbroadRestriction.command("update <domain>").description("SMTP\u8A8D\u8A3C\u306E\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u8A2D\u5B9A\u3092\u66F4\u65B0").requiredOption("--abroad-access-restriction <value>", "\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (domain, opts) => {
|
|
1185
|
+
const client = resolveClient(parent, brand);
|
|
1186
|
+
printResult(await client.updateSmtpAbroadRestriction(domain, {
|
|
1187
|
+
abroad_access_restriction: opts.abroadAccessRestriction
|
|
1188
|
+
}), getFormat(parent));
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
// ../core/dist/commands/server/dkim/index.js
|
|
1193
|
+
function registerDkimCommands(parent, brand) {
|
|
1194
|
+
const dkim = parent.command("dkim").description("DKIM\u8A2D\u5B9A");
|
|
1195
|
+
dkim.command("list").description("DKIM\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1196
|
+
const client = resolveClient(parent, brand);
|
|
1197
|
+
const params = {};
|
|
1198
|
+
if (opts.domain)
|
|
1199
|
+
params.domain = opts.domain;
|
|
1200
|
+
printResult(await client.listDkim(params), getFormat(parent));
|
|
1201
|
+
});
|
|
1202
|
+
dkim.command("get <fqdn>").description("DKIM\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97").action(async (fqdn) => {
|
|
1203
|
+
const client = resolveClient(parent, brand);
|
|
1204
|
+
printResult(await client.getDkim(fqdn), getFormat(parent));
|
|
1205
|
+
});
|
|
1206
|
+
dkim.command("update <fqdn>").description("DKIM\u8A2D\u5B9A\u306E\u6709\u52B9/\u7121\u52B9\u3092\u5207\u308A\u66FF\u3048").requiredOption("--enabled <value>", "DKIM\u306E\u6709\u52B9/\u7121\u52B9\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (fqdn, opts) => {
|
|
1207
|
+
const client = resolveClient(parent, brand);
|
|
1208
|
+
printResult(await client.updateDkim(fqdn, { enabled: opts.enabled }), getFormat(parent));
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
// ../core/dist/commands/server/dmarc/index.js
|
|
1213
|
+
function parseNotificationMailAddresses(value) {
|
|
1214
|
+
if (value === "") {
|
|
1215
|
+
return [];
|
|
1216
|
+
}
|
|
1217
|
+
return value.split(",").map((address) => address.trim()).filter((address) => address !== "");
|
|
1218
|
+
}
|
|
1219
|
+
function registerDmarcCommands(parent, brand) {
|
|
1220
|
+
const dmarc = parent.command("dmarc").description("\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A");
|
|
1221
|
+
dmarc.command("list").description("\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1222
|
+
const client = resolveClient(parent, brand);
|
|
1223
|
+
const params = {};
|
|
1224
|
+
if (opts.domain)
|
|
1225
|
+
params.domain = opts.domain;
|
|
1226
|
+
printResult(await client.listDmarc(params), getFormat(parent));
|
|
1227
|
+
});
|
|
1228
|
+
dmarc.command("update <domain>").description("\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09").option("--policy <policy>", "DMARC\u30DD\u30EA\u30B7\u30FC\uFF08none / quarantine / reject\uFF09").option("--report-enabled <value>", "\u30EC\u30DD\u30FC\u30C8\u901A\u77E5\u306E\u6709\u52B9/\u7121\u52B9\uFF08true/false \u307E\u305F\u306F 1/0\uFF09\u3002false \u306E\u3068\u304D\u901A\u77E5\u5148\u306F\u81EA\u52D5\u7684\u306B\u7A7A\u306B\u306A\u308B").option("--notification-mail-addresses <addresses>", "\u30EC\u30DD\u30FC\u30C8\u901A\u77E5\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002--report-enabled true \u306E\u3068\u304D\u306F1\u4EF6\u4EE5\u4E0A\u5FC5\u9808").action(async (domain, opts) => {
|
|
1229
|
+
const data = {};
|
|
1230
|
+
if (opts.policy !== void 0)
|
|
1231
|
+
data.policy = opts.policy;
|
|
1232
|
+
if (opts.reportEnabled !== void 0) {
|
|
1233
|
+
data.report_enabled = opts.reportEnabled;
|
|
1234
|
+
}
|
|
1235
|
+
if (opts.notificationMailAddresses !== void 0) {
|
|
1236
|
+
data.notification_mail_addresses = parseNotificationMailAddresses(opts.notificationMailAddresses);
|
|
1237
|
+
}
|
|
1238
|
+
if (Object.keys(data).length === 0) {
|
|
1239
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1240
|
+
}
|
|
1241
|
+
const client = resolveClient(parent, brand);
|
|
1242
|
+
printResult(await client.updateDmarc(domain, data), getFormat(parent));
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// ../core/dist/commands/server/spf/index.js
|
|
1247
|
+
var UPDATE_ACTIONS = ["reset", "enable_gmail", "custom"];
|
|
1248
|
+
function registerSpfCommands(parent, brand) {
|
|
1249
|
+
const spf = parent.command("spf").description("SPF\u8A2D\u5B9A");
|
|
1250
|
+
spf.command("list").description("SPF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1251
|
+
const client = resolveClient(parent, brand);
|
|
1252
|
+
const params = {};
|
|
1253
|
+
if (opts.domain)
|
|
1254
|
+
params.domain = opts.domain;
|
|
1255
|
+
printResult(await client.listSpf(params), getFormat(parent));
|
|
1256
|
+
});
|
|
1257
|
+
spf.command("add").description("SPF\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--fqdn <fqdn>", "FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09").action(async (opts) => {
|
|
1258
|
+
const client = resolveClient(parent, brand);
|
|
1259
|
+
printResult(await client.addSpf({ fqdn: opts.fqdn }), getFormat(parent));
|
|
1260
|
+
});
|
|
1261
|
+
spf.command("update <fqdn>").description("SPF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08reset / enable_gmail / custom\uFF09").requiredOption("--action <action>", `\u64CD\u4F5C\u7A2E\u5225\uFF08${UPDATE_ACTIONS.join(" / ")}\uFF09`).option("--spf-record <record>", "\u30AB\u30B9\u30BF\u30E0SPF\u30EC\u30B3\u30FC\u30C9\uFF08action=custom \u306E\u3068\u304D\u5FC5\u9808\uFF09").action(async (fqdn, opts) => {
|
|
1262
|
+
const body = { action: opts.action };
|
|
1263
|
+
if (opts.spfRecord !== void 0)
|
|
1264
|
+
body.spf_record = opts.spfRecord;
|
|
1265
|
+
const client = resolveClient(parent, brand);
|
|
1266
|
+
printResult(await client.updateSpf(fqdn, body), getFormat(parent));
|
|
1267
|
+
});
|
|
1268
|
+
spf.command("delete <fqdn>").description("SPF\u8A2D\u5B9A\u3092\u524A\u9664").action(async (fqdn) => {
|
|
1269
|
+
const client = resolveClient(parent, brand);
|
|
1270
|
+
printResult(await client.deleteSpf(fqdn), getFormat(parent));
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
|
|
851
1274
|
// ../core/dist/commands/server/ftp/index.js
|
|
852
1275
|
function registerFtpCommands(parent, brand) {
|
|
853
1276
|
const ftp = parent.command("ftp").description("FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u8A2D\u5B9A");
|
|
@@ -1183,6 +1606,495 @@ function registerLogCommands(parent, brand) {
|
|
|
1183
1606
|
});
|
|
1184
1607
|
}
|
|
1185
1608
|
|
|
1609
|
+
// ../core/dist/commands/server/resource-monitor/index.js
|
|
1610
|
+
function registerResourceMonitorCommands(parent, brand) {
|
|
1611
|
+
const resourceMonitor = parent.command("resource-monitor").description("\u30EA\u30BD\u30FC\u30B9\u30E2\u30CB\u30BF\u30FC");
|
|
1612
|
+
resourceMonitor.command("get").description("\u6307\u5B9A\u65E5\u306ECPU\u30FB\u30E1\u30E2\u30EA\u30FB\u8EE2\u9001\u91CF\u6642\u7CFB\u5217\u3092\u53D6\u5F97").requiredOption("--date <date>", "\u5BFE\u8C61\u65E5\uFF08Y-m-d \u307E\u305F\u306F Ymd\u3002\u5F53\u65E5\u542B\u3080\u76F4\u8FD11\u304B\u6708\uFF09").action(async (opts) => {
|
|
1613
|
+
const client = resolveClient(parent, brand);
|
|
1614
|
+
printResult(await client.getResourceMonitor(opts.date), getFormat(parent));
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
// ../core/dist/commands/server/waf/index.js
|
|
1619
|
+
function registerWafCommands(parent, brand) {
|
|
1620
|
+
const waf = parent.command("waf").description("WAF\u8A2D\u5B9A");
|
|
1621
|
+
waf.command("list").description("WAF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1622
|
+
const client = resolveClient(parent, brand);
|
|
1623
|
+
const params = {};
|
|
1624
|
+
if (opts.domain)
|
|
1625
|
+
params.domain = opts.domain;
|
|
1626
|
+
printResult(await client.listWaf(params), getFormat(parent));
|
|
1627
|
+
});
|
|
1628
|
+
waf.command("update <domain>").description("WAF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09").option("--xss-protection <value>", "XSS\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--sql-injection-protection <value>", "SQL\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--file-protection <value>", "\u30D5\u30A1\u30A4\u30EB\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--mail-protection <value>", "\u30E1\u30FC\u30EB\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--command-protection <value>", "\u30B3\u30DE\u30F3\u30C9\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--php-protection <value>", "PHP\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (domain, opts) => {
|
|
1629
|
+
const data = {};
|
|
1630
|
+
if (opts.xssProtection !== void 0)
|
|
1631
|
+
data.xss_protection = opts.xssProtection;
|
|
1632
|
+
if (opts.sqlInjectionProtection !== void 0)
|
|
1633
|
+
data.sql_injection_protection = opts.sqlInjectionProtection;
|
|
1634
|
+
if (opts.fileProtection !== void 0)
|
|
1635
|
+
data.file_protection = opts.fileProtection;
|
|
1636
|
+
if (opts.mailProtection !== void 0)
|
|
1637
|
+
data.mail_protection = opts.mailProtection;
|
|
1638
|
+
if (opts.commandProtection !== void 0)
|
|
1639
|
+
data.command_protection = opts.commandProtection;
|
|
1640
|
+
if (opts.phpProtection !== void 0)
|
|
1641
|
+
data.php_protection = opts.phpProtection;
|
|
1642
|
+
if (Object.keys(data).length === 0) {
|
|
1643
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1644
|
+
}
|
|
1645
|
+
const client = resolveClient(parent, brand);
|
|
1646
|
+
printResult(await client.updateWaf(domain, data), getFormat(parent));
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
// ../core/dist/commands/server/php-ini/index.js
|
|
1651
|
+
var PHP_INI_UPDATE_OPTIONS = [
|
|
1652
|
+
{ cli: "display-errors", api: "display_errors", desc: "\u30A8\u30E9\u30FC\u5185\u5BB9\u3092\u753B\u9762\u306B\u51FA\u529B\uFF08On / Off\uFF09" },
|
|
1653
|
+
{ cli: "error-reporting", api: "error_reporting", desc: "\u30A8\u30E9\u30FC\u51FA\u529B\u30EC\u30D9\u30EB" },
|
|
1654
|
+
{ cli: "display-startup-errors", api: "display_startup_errors", desc: "\u8D77\u52D5\u6642\u30A8\u30E9\u30FC\u3092\u8868\u793A\uFF08On / Off\uFF09" },
|
|
1655
|
+
{ cli: "session-auto-start", api: "session.auto_start", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3\u81EA\u52D5\u958B\u59CB\uFF080 / 1\uFF09" },
|
|
1656
|
+
{ cli: "session-name", api: "session.name", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3\u540D" },
|
|
1657
|
+
{ cli: "session-use-cookies", api: "session.use_cookies", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3ID\u306B\u30AF\u30C3\u30AD\u30FC\u3092\u4F7F\u7528\uFF080 / 1\uFF09" },
|
|
1658
|
+
{ cli: "session-use-only-cookies", api: "session.use_only_cookies", desc: "\u30AF\u30C3\u30AD\u30FC\u306E\u307F\u3067\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u4FDD\u5B58\uFF080 / 1\uFF09" },
|
|
1659
|
+
{ cli: "session-use-trans-sid", api: "session.use_trans_sid", desc: "URL\u3078\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u81EA\u52D5\u8A2D\u5B9A\uFF080 / 1\uFF09" },
|
|
1660
|
+
{ cli: "session-cookie-lifetime", api: "session.cookie_lifetime", desc: "\u30AF\u30C3\u30AD\u30FC\u6709\u52B9\u671F\u9593\uFF08\u79D2\uFF09" },
|
|
1661
|
+
{ cli: "session-cookie-path", api: "session.cookie_path", desc: "\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30D1\u30B9" },
|
|
1662
|
+
{ cli: "session-cookie-domain", api: "session.cookie_domain", desc: "\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30C9\u30E1\u30A4\u30F3" },
|
|
1663
|
+
{ cli: "mbstring-language", api: "mbstring.language", desc: "\u30C7\u30D5\u30A9\u30EB\u30C8\u8A00\u8A9E" },
|
|
1664
|
+
{ cli: "mbstring-internal-encoding", api: "mbstring.internal_encoding", desc: "\u5185\u90E8\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0" },
|
|
1665
|
+
{ cli: "mbstring-http-input", api: "mbstring.http_input", desc: "HTTP\u5165\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB" },
|
|
1666
|
+
{ cli: "mbstring-http-output", api: "mbstring.http_output", desc: "HTTP\u51FA\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB" },
|
|
1667
|
+
{ cli: "mbstring-encoding-translation", api: "mbstring.encoding_translation", desc: "\u5185\u90E8\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3078\u306E\u5909\u63DB\uFF08On / Off\uFF09" },
|
|
1668
|
+
{ cli: "mbstring-detect-order", api: "mbstring.detect_order", desc: "\u6587\u5B57\u30B3\u30FC\u30C9\u691C\u51FA" },
|
|
1669
|
+
{ cli: "mbstring-substitute-character", api: "mbstring.substitute_character", desc: "\u7121\u52B9\u6587\u5B57\u306E\u4EE3\u66FF\u6587\u5B57" },
|
|
1670
|
+
{ cli: "max-execution-time", api: "max_execution_time", desc: "\u6700\u5927\u5B9F\u884C\u6642\u9593\uFF08\u79D2\uFF09" },
|
|
1671
|
+
{ cli: "max-input-time", api: "max_input_time", desc: "\u5165\u529B\u30D1\u30FC\u30B9\u6700\u5927\u6642\u9593\uFF08\u79D2\uFF09" },
|
|
1672
|
+
{ cli: "memory-limit", api: "memory_limit", desc: "\u6700\u5927\u30E1\u30E2\u30EA" },
|
|
1673
|
+
{ cli: "post-max-size", api: "post_max_size", desc: "POST\u30C7\u30FC\u30BF\u6700\u5927\u30B5\u30A4\u30BA" },
|
|
1674
|
+
{ cli: "upload-max-filesize", api: "upload_max_filesize", desc: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u6700\u5927\u30B5\u30A4\u30BA" },
|
|
1675
|
+
{ cli: "register-globals", api: "register_globals", desc: "register_globals\uFF08On / Off\uFF09" },
|
|
1676
|
+
{ cli: "magic-quotes-gpc", api: "magic_quotes_gpc", desc: "magic_quotes_gpc\uFF08On / Off\uFF09" },
|
|
1677
|
+
{ cli: "safe-mode", api: "safe_mode", desc: "safe_mode\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
|
|
1678
|
+
{ cli: "file-uploads", api: "file_uploads", desc: "HTTP\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
|
|
1679
|
+
{ cli: "allow-url-fopen", api: "allow_url_fopen", desc: "allow_url_fopen\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
|
|
1680
|
+
{ cli: "allow-url-include", api: "allow_url_include", desc: "allow_url_include\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" }
|
|
1681
|
+
];
|
|
1682
|
+
function cliOptionToCamelCase(cli) {
|
|
1683
|
+
return cli.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1684
|
+
}
|
|
1685
|
+
function buildUpdateData(opts) {
|
|
1686
|
+
const data = {};
|
|
1687
|
+
for (const { cli, api } of PHP_INI_UPDATE_OPTIONS) {
|
|
1688
|
+
const value = opts[cliOptionToCamelCase(cli)];
|
|
1689
|
+
if (value !== void 0)
|
|
1690
|
+
data[api] = value;
|
|
1691
|
+
}
|
|
1692
|
+
return data;
|
|
1693
|
+
}
|
|
1694
|
+
function registerPhpIniCommands(parent, brand) {
|
|
1695
|
+
const phpIni = parent.command("php-ini").description("php.ini\u8A2D\u5B9A\uFF08php-version \u3068\u306F\u5225\uFF09");
|
|
1696
|
+
phpIni.command("list").description("php.ini\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1697
|
+
const client = resolveClient(parent, brand);
|
|
1698
|
+
const params = {};
|
|
1699
|
+
if (opts.domain)
|
|
1700
|
+
params.domain = opts.domain;
|
|
1701
|
+
printResult(await client.listPhpIni(params), getFormat(parent));
|
|
1702
|
+
});
|
|
1703
|
+
const update = phpIni.command("update <domain>").description("php.ini\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09");
|
|
1704
|
+
for (const { cli, desc } of PHP_INI_UPDATE_OPTIONS) {
|
|
1705
|
+
update.option(`--${cli} <value>`, desc);
|
|
1706
|
+
}
|
|
1707
|
+
update.action(async (domain, opts) => {
|
|
1708
|
+
const data = buildUpdateData(opts);
|
|
1709
|
+
if (Object.keys(data).length === 0) {
|
|
1710
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1711
|
+
}
|
|
1712
|
+
const client = resolveClient(parent, brand);
|
|
1713
|
+
printResult(await client.updatePhpIni(domain, data), getFormat(parent));
|
|
1714
|
+
});
|
|
1715
|
+
phpIni.command("reset <domain>").description("php.ini\u8A2D\u5B9A\u3092\u521D\u671F\u5024\u306B\u623B\u3059").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (domain) => {
|
|
1716
|
+
await confirmDestructiveAction(parent, `\u30C9\u30E1\u30A4\u30F3 "${domain}" \u306E php.ini \u3092\u521D\u671F\u5024\u306B\u623B\u3057\u307E\u3059\u3002\u3053\u306E\u64CD\u4F5C\u306F\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
1717
|
+
const client = resolveClient(parent, brand);
|
|
1718
|
+
printResult(await client.resetPhpIni(domain), getFormat(parent));
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
// ../core/dist/commands/server/wordpress-security/index.js
|
|
1723
|
+
var UPDATE_BLOCKS = [
|
|
1724
|
+
"comment_restriction",
|
|
1725
|
+
"login_attempt_limit",
|
|
1726
|
+
"foreign_ip_restriction",
|
|
1727
|
+
"ip_restriction"
|
|
1728
|
+
];
|
|
1729
|
+
var UPDATE_OPTIONS = [
|
|
1730
|
+
{ cli: "comment-restriction-bulk-post-enabled", desc: "\u5358\u4E00\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u5927\u91CF\u6295\u7A3F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1731
|
+
{ cli: "comment-restriction-foreign-post-enabled", desc: "\u56FD\u5916\u304B\u3089\u306E\u6295\u7A3F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1732
|
+
{ cli: "login-attempt-limit-enabled", desc: "\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1733
|
+
{ cli: "foreign-ip-dashboard-enabled", desc: "\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1734
|
+
{ cli: "foreign-ip-dashboard-allowed-ips", desc: '\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
|
|
1735
|
+
{ cli: "foreign-ip-xml-rpc-api-enabled", desc: "XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1736
|
+
{ cli: "foreign-ip-xml-rpc-api-allowed-ips", desc: 'XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
|
|
1737
|
+
{ cli: "foreign-ip-rest-api-enabled", desc: "REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1738
|
+
{ cli: "foreign-ip-rest-api-allowed-ips", desc: 'REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
|
|
1739
|
+
{ cli: "foreign-ip-wlwmanifest-enabled", desc: "wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1740
|
+
{ cli: "foreign-ip-wlwmanifest-allowed-ips", desc: 'wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
|
|
1741
|
+
{ cli: "ip-restriction-enabled", desc: "IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1742
|
+
{ cli: "ip-restriction-allowed-ips", desc: 'IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A IPv4 \u307E\u305F\u306F CIDR\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' }
|
|
1743
|
+
];
|
|
1744
|
+
function parseIpAddressList(value) {
|
|
1745
|
+
if (value === "") {
|
|
1746
|
+
return [];
|
|
1747
|
+
}
|
|
1748
|
+
return value.split(",").map((a) => a.trim()).filter((a) => a !== "");
|
|
1749
|
+
}
|
|
1750
|
+
function parseBooleanParam(label, value) {
|
|
1751
|
+
const normalized = value.trim().toLowerCase();
|
|
1752
|
+
if (normalized !== "true" && normalized !== "false" && normalized !== "1" && normalized !== "0") {
|
|
1753
|
+
throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", [`${label}\u306F true/false \u307E\u305F\u306F 1/0 \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]);
|
|
1754
|
+
}
|
|
1755
|
+
return normalized === "true" || normalized === "1";
|
|
1756
|
+
}
|
|
1757
|
+
function setForeignIpTarget(block, target, enabledLabel, enabled, allowedIps) {
|
|
1758
|
+
const entry = {};
|
|
1759
|
+
if (enabled !== void 0)
|
|
1760
|
+
entry.enabled = parseBooleanParam(enabledLabel, enabled);
|
|
1761
|
+
if (allowedIps !== void 0)
|
|
1762
|
+
entry.allowed_ip_addresses = parseIpAddressList(allowedIps);
|
|
1763
|
+
if (Object.keys(entry).length > 0)
|
|
1764
|
+
block[target] = entry;
|
|
1765
|
+
}
|
|
1766
|
+
function buildUpdateData2(domain, opts) {
|
|
1767
|
+
const data = { domain };
|
|
1768
|
+
const commentRestriction = {};
|
|
1769
|
+
if (opts.commentRestrictionBulkPostEnabled !== void 0) {
|
|
1770
|
+
commentRestriction.bulk_post = {
|
|
1771
|
+
enabled: parseBooleanParam("\u5358\u4E00\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u5927\u91CF\u6295\u7A3F", opts.commentRestrictionBulkPostEnabled)
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
if (opts.commentRestrictionForeignPostEnabled !== void 0) {
|
|
1775
|
+
commentRestriction.foreign_post = {
|
|
1776
|
+
enabled: parseBooleanParam("\u56FD\u5916\u304B\u3089\u306E\u6295\u7A3F", opts.commentRestrictionForeignPostEnabled)
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
if (Object.keys(commentRestriction).length > 0) {
|
|
1780
|
+
data.comment_restriction = commentRestriction;
|
|
1781
|
+
}
|
|
1782
|
+
if (opts.loginAttemptLimitEnabled !== void 0) {
|
|
1783
|
+
data.login_attempt_limit = {
|
|
1784
|
+
enabled: parseBooleanParam("\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650", opts.loginAttemptLimitEnabled)
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
const foreignIpRestriction = {};
|
|
1788
|
+
setForeignIpTarget(foreignIpRestriction, "dashboard", "\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpDashboardEnabled, opts.foreignIpDashboardAllowedIps);
|
|
1789
|
+
setForeignIpTarget(foreignIpRestriction, "xml_rpc_api", "XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpXmlRpcApiEnabled, opts.foreignIpXmlRpcApiAllowedIps);
|
|
1790
|
+
setForeignIpTarget(foreignIpRestriction, "rest_api", "REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpRestApiEnabled, opts.foreignIpRestApiAllowedIps);
|
|
1791
|
+
setForeignIpTarget(foreignIpRestriction, "wlwmanifest", "wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpWlwmanifestEnabled, opts.foreignIpWlwmanifestAllowedIps);
|
|
1792
|
+
if (Object.keys(foreignIpRestriction).length > 0) {
|
|
1793
|
+
data.foreign_ip_restriction = foreignIpRestriction;
|
|
1794
|
+
}
|
|
1795
|
+
const ipRestriction = {};
|
|
1796
|
+
if (opts.ipRestrictionEnabled !== void 0) {
|
|
1797
|
+
ipRestriction.enabled = parseBooleanParam("IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09", opts.ipRestrictionEnabled);
|
|
1798
|
+
}
|
|
1799
|
+
if (opts.ipRestrictionAllowedIps !== void 0) {
|
|
1800
|
+
ipRestriction.allowed_ip_addresses = parseIpAddressList(opts.ipRestrictionAllowedIps);
|
|
1801
|
+
}
|
|
1802
|
+
if (Object.keys(ipRestriction).length > 0) {
|
|
1803
|
+
data.ip_restriction = ipRestriction;
|
|
1804
|
+
}
|
|
1805
|
+
if (!UPDATE_BLOCKS.some((key) => key in data)) {
|
|
1806
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1807
|
+
}
|
|
1808
|
+
return data;
|
|
1809
|
+
}
|
|
1810
|
+
function registerWordPressSecurityCommands(parent, brand) {
|
|
1811
|
+
const wordpressSecurity = parent.command("wordpress-security").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A");
|
|
1812
|
+
wordpressSecurity.command("get").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1813
|
+
const client = resolveClient(parent, brand);
|
|
1814
|
+
const params = {};
|
|
1815
|
+
if (opts.domain)
|
|
1816
|
+
params.domain = opts.domain;
|
|
1817
|
+
printResult(await client.getWordPressSecurity(params), getFormat(parent));
|
|
1818
|
+
});
|
|
1819
|
+
const update = wordpressSecurity.command("update <domain>").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09");
|
|
1820
|
+
for (const { cli, desc } of UPDATE_OPTIONS) {
|
|
1821
|
+
update.option(`--${cli} <value>`, desc);
|
|
1822
|
+
}
|
|
1823
|
+
update.action(async (domain, opts) => {
|
|
1824
|
+
const data = buildUpdateData2(domain, opts);
|
|
1825
|
+
const client = resolveClient(parent, brand);
|
|
1826
|
+
printResult(await client.updateWordPressSecurity(data), getFormat(parent));
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
// ../core/dist/commands/server/x-accelerator/index.js
|
|
1831
|
+
function registerXAcceleratorCommands(parent, brand) {
|
|
1832
|
+
const xAccelerator = parent.command("x-accelerator").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A");
|
|
1833
|
+
xAccelerator.command("list").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1834
|
+
const client = resolveClient(parent, brand);
|
|
1835
|
+
const params = {};
|
|
1836
|
+
if (opts.domain)
|
|
1837
|
+
params.domain = opts.domain;
|
|
1838
|
+
printResult(await client.listXAccelerator(params), getFormat(parent));
|
|
1839
|
+
});
|
|
1840
|
+
xAccelerator.command("update <domain>").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--xaccelerator-status <status>", "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\uFF08off / v1 / v2\uFF09").action(async (domain, opts) => {
|
|
1841
|
+
const client = resolveClient(parent, brand);
|
|
1842
|
+
printResult(await client.updateXAccelerator(domain, { xaccelerator_status: opts.xacceleratorStatus }), getFormat(parent));
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
// ../core/dist/commands/server/server-cache/index.js
|
|
1847
|
+
function registerServerCacheCommands(parent, brand) {
|
|
1848
|
+
const serverCache = parent.command("server-cache").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A");
|
|
1849
|
+
serverCache.command("list").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1850
|
+
const client = resolveClient(parent, brand);
|
|
1851
|
+
const params = {};
|
|
1852
|
+
if (opts.domain)
|
|
1853
|
+
params.domain = opts.domain;
|
|
1854
|
+
printResult(await client.listServerCache(params), getFormat(parent));
|
|
1855
|
+
});
|
|
1856
|
+
serverCache.command("update <domain>").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--server-cache-status <status>", "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08on / off\uFF09").action(async (domain, opts) => {
|
|
1857
|
+
const client = resolveClient(parent, brand);
|
|
1858
|
+
printResult(await client.updateServerCache(domain, { server_cache_status: opts.serverCacheStatus }), getFormat(parent));
|
|
1859
|
+
});
|
|
1860
|
+
serverCache.command("clear-cache <domain>").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u5185\u5BB9\u3092\u524A\u9664\uFF08\u30D1\u30FC\u30B8\uFF09").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (domain) => {
|
|
1861
|
+
await confirmDestructiveAction(parent, `\u30C9\u30E1\u30A4\u30F3 "${domain}" \u306E\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u5185\u5BB9\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
1862
|
+
const client = resolveClient(parent, brand);
|
|
1863
|
+
printResult(await client.clearServerCache(domain), getFormat(parent));
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
// ../core/dist/commands/server/browser-cache/index.js
|
|
1868
|
+
function registerBrowserCacheCommands(parent, brand) {
|
|
1869
|
+
const browserCache = parent.command("browser-cache").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A");
|
|
1870
|
+
browserCache.command("list").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1871
|
+
const client = resolveClient(parent, brand);
|
|
1872
|
+
const params = {};
|
|
1873
|
+
if (opts.domain)
|
|
1874
|
+
params.domain = opts.domain;
|
|
1875
|
+
printResult(await client.listBrowserCache(params), getFormat(parent));
|
|
1876
|
+
});
|
|
1877
|
+
browserCache.command("update <domain>").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--browser-cache-status <status>", "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08all / ignore-css-js / off\uFF09").action(async (domain, opts) => {
|
|
1878
|
+
const client = resolveClient(parent, brand);
|
|
1879
|
+
printResult(await client.updateBrowserCache(domain, { browser_cache_status: opts.browserCacheStatus }), getFormat(parent));
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
// ../core/dist/commands/server/url-redirect/index.js
|
|
1884
|
+
function registerUrlRedirectCommands(parent, brand) {
|
|
1885
|
+
const urlRedirect = parent.command("url-redirect").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A");
|
|
1886
|
+
urlRedirect.command("list").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1887
|
+
const client = resolveClient(parent, brand);
|
|
1888
|
+
const params = {};
|
|
1889
|
+
if (opts.domain)
|
|
1890
|
+
params.domain = opts.domain;
|
|
1891
|
+
printResult(await client.listUrlRedirect(params), getFormat(parent));
|
|
1892
|
+
});
|
|
1893
|
+
urlRedirect.command("add").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--domain <domain>", "\u5951\u7D04\u30C9\u30E1\u30A4\u30F3").requiredOption("--from-host <host>", "\u8EE2\u9001\u5143\u30DB\u30B9\u30C8\uFF08FQDN\uFF09").option("--from-path <path>", "\u8EE2\u9001\u5143\u30D1\u30B9\uFF08\u7701\u7565\u6642\u306F /\u3002\u5148\u982D\u304C / \u3067\u306A\u3044\u5834\u5408\u306F API \u5074\u3067 / \u3092\u4ED8\u4E0E\uFF09").requiredOption("--redirect-to-url <url>", "\u8EE2\u9001\u5148URL\uFF08http \u307E\u305F\u306F https\uFF09").requiredOption("--status-code <code>", "\u8EE2\u9001\u6642\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9\uFF08301 / 302\uFF09").action(async (opts) => {
|
|
1894
|
+
const client = resolveClient(parent, brand);
|
|
1895
|
+
const data = {
|
|
1896
|
+
domain: opts.domain,
|
|
1897
|
+
from_host: opts.fromHost,
|
|
1898
|
+
redirect_to_url: opts.redirectToUrl,
|
|
1899
|
+
status_code: Number(opts.statusCode)
|
|
1900
|
+
};
|
|
1901
|
+
if (opts.fromPath !== void 0)
|
|
1902
|
+
data.from_path = opts.fromPath;
|
|
1903
|
+
printResult(await client.addUrlRedirect(data), getFormat(parent));
|
|
1904
|
+
});
|
|
1905
|
+
urlRedirect.command("delete <redirectId>").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u524A\u9664").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (redirectId) => {
|
|
1906
|
+
await confirmDestructiveAction(parent, `\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A "${redirectId}" \u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
1907
|
+
const client = resolveClient(parent, brand);
|
|
1908
|
+
printResult(await client.deleteUrlRedirect(redirectId), getFormat(parent));
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
// ../core/dist/commands/server/access-deny/index.js
|
|
1913
|
+
function registerAccessDenyCommands(parent, brand) {
|
|
1914
|
+
const accessDeny = parent.command("access-deny").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A");
|
|
1915
|
+
accessDeny.command("list").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1916
|
+
const client = resolveClient(parent, brand);
|
|
1917
|
+
const params = {};
|
|
1918
|
+
if (opts.domain)
|
|
1919
|
+
params.domain = opts.domain;
|
|
1920
|
+
printResult(await client.listAccessDeny(params), getFormat(parent));
|
|
1921
|
+
});
|
|
1922
|
+
accessDeny.command("add").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--domain <domain>", "\u5951\u7D04\u30C9\u30E1\u30A4\u30F3").requiredOption("--ip-address <address>", "\u62D2\u5426IP\u30A2\u30C9\u30EC\u30B9\u30FB\u30DB\u30B9\u30C8\uFF08IPv4 / CIDR / \u90E8\u5206IP / \u30DB\u30B9\u30C8\u540D\uFF09").option("--memo <memo>", "\u30E1\u30E2\uFF08\u6700\u5927500\u6587\u5B57\uFF09").action(async (opts) => {
|
|
1923
|
+
const client = resolveClient(parent, brand);
|
|
1924
|
+
const data = {
|
|
1925
|
+
domain: opts.domain,
|
|
1926
|
+
ip_address: opts.ipAddress
|
|
1927
|
+
};
|
|
1928
|
+
if (opts.memo !== void 0)
|
|
1929
|
+
data.memo = opts.memo;
|
|
1930
|
+
printResult(await client.addAccessDeny(data), getFormat(parent));
|
|
1931
|
+
});
|
|
1932
|
+
accessDeny.command("update <denyId>").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306E\u30E1\u30E2\u3092\u66F4\u65B0").option("--memo <memo>", "\u30E1\u30E2\uFF08\u7701\u7565\u307E\u305F\u306F\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").action(async (denyId, opts) => {
|
|
1933
|
+
if (opts.memo === void 0) {
|
|
1934
|
+
throw new Error("--memo \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1935
|
+
}
|
|
1936
|
+
const client = resolveClient(parent, brand);
|
|
1937
|
+
printResult(await client.updateAccessDeny(denyId, { memo: opts.memo }), getFormat(parent));
|
|
1938
|
+
});
|
|
1939
|
+
accessDeny.command("delete <denyId>").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u524A\u9664").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (denyId) => {
|
|
1940
|
+
await confirmDestructiveAction(parent, `\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A "${denyId}" \u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
1941
|
+
const client = resolveClient(parent, brand);
|
|
1942
|
+
printResult(await client.deleteAccessDeny(denyId), getFormat(parent));
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
// ../core/dist/commands/server/xpagespeed/index.js
|
|
1947
|
+
var UPDATE_OPTIONS2 = [
|
|
1948
|
+
{ cli: "xoptimize-images", api: "xoptimize_images", label: "\u753B\u50CF\u6700\u9069\u5316", desc: "\u753B\u50CF\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1949
|
+
{ cli: "lazyload-images", api: "lazyload_images", label: "\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1950
|
+
{ cli: "xoptimize-css", api: "xoptimize_css", label: "CSS\u6700\u9069\u5316", desc: "CSS\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1951
|
+
{ cli: "lazyload-css", api: "lazyload_css", label: "CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1952
|
+
{ cli: "xoptimize-javascript", api: "xoptimize_javascript", label: "JavaScript\u6700\u9069\u5316", desc: "JavaScript\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
|
|
1953
|
+
{ cli: "lazyload-javascript", api: "lazyload_javascript", label: "JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" }
|
|
1954
|
+
];
|
|
1955
|
+
function cliOptionToCamelCase2(cli) {
|
|
1956
|
+
return cli.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1957
|
+
}
|
|
1958
|
+
function parseBooleanParam2(label, value) {
|
|
1959
|
+
const normalized = value.trim().toLowerCase();
|
|
1960
|
+
if (normalized !== "true" && normalized !== "false" && normalized !== "1" && normalized !== "0") {
|
|
1961
|
+
throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", [`${label}\u306F true/false \u307E\u305F\u306F 1/0 \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]);
|
|
1962
|
+
}
|
|
1963
|
+
return normalized === "true" || normalized === "1";
|
|
1964
|
+
}
|
|
1965
|
+
function buildUpdateData3(opts) {
|
|
1966
|
+
const data = {};
|
|
1967
|
+
for (const { cli, api, label } of UPDATE_OPTIONS2) {
|
|
1968
|
+
const value = opts[cliOptionToCamelCase2(cli)];
|
|
1969
|
+
if (value !== void 0)
|
|
1970
|
+
data[api] = parseBooleanParam2(label, value);
|
|
1971
|
+
}
|
|
1972
|
+
if (Object.keys(data).length === 0) {
|
|
1973
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1974
|
+
}
|
|
1975
|
+
if (Object.keys(data).length > 1) {
|
|
1976
|
+
throw new Error("1\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u5909\u66F4\u3067\u304D\u308B\u306E\u306F1\u3064\u306E\u6700\u9069\u5316\u6A5F\u80FD\u306E\u307F\u3067\u3059");
|
|
1977
|
+
}
|
|
1978
|
+
return data;
|
|
1979
|
+
}
|
|
1980
|
+
function registerXPageSpeedCommands(parent, brand) {
|
|
1981
|
+
const xPageSpeed = parent.command("xpagespeed").description("XPageSpeed\u8A2D\u5B9A");
|
|
1982
|
+
xPageSpeed.command("list").description("XPageSpeed\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
|
|
1983
|
+
const client = resolveClient(parent, brand);
|
|
1984
|
+
const params = {};
|
|
1985
|
+
if (opts.domain)
|
|
1986
|
+
params.domain = opts.domain;
|
|
1987
|
+
printResult(await client.listXPageSpeed(params), getFormat(parent));
|
|
1988
|
+
});
|
|
1989
|
+
const update = xPageSpeed.command("update <domain>").description("XPageSpeed\u306E\u6700\u9069\u5316\u6A5F\u80FD\u3092\u5909\u66F4\uFF081\u30EA\u30AF\u30A8\u30B9\u30C8\u30671\u6A5F\u80FD\u306E\u307F\uFF09");
|
|
1990
|
+
for (const { cli, desc } of UPDATE_OPTIONS2) {
|
|
1991
|
+
update.option(`--${cli} <value>`, desc);
|
|
1992
|
+
}
|
|
1993
|
+
update.action(async (domain, opts) => {
|
|
1994
|
+
const data = buildUpdateData3(opts);
|
|
1995
|
+
const client = resolveClient(parent, brand);
|
|
1996
|
+
printResult(await client.updateXPageSpeed(domain, data), getFormat(parent));
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
// ../core/dist/commands/server/auto-backup/index.js
|
|
2001
|
+
var DOMAIN_ELEMENT_TYPES = ["web", "setting", "mail"];
|
|
2002
|
+
function validationError(...errors) {
|
|
2003
|
+
throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", errors);
|
|
2004
|
+
}
|
|
2005
|
+
function collectFlagValue(value, previous) {
|
|
2006
|
+
return previous.concat([value]);
|
|
2007
|
+
}
|
|
2008
|
+
function parseDomainElementEntry(part) {
|
|
2009
|
+
const equalIndex = part.indexOf("=");
|
|
2010
|
+
if (equalIndex === -1) {
|
|
2011
|
+
validationError("domain_elements \u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002example.com=web,setting \u5F62\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
2012
|
+
}
|
|
2013
|
+
const domain = part.slice(0, equalIndex).trim();
|
|
2014
|
+
const elementsRaw = part.slice(equalIndex + 1).trim();
|
|
2015
|
+
if (domain === "" || elementsRaw === "") {
|
|
2016
|
+
validationError("domain_elements \u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002example.com=web,setting \u5F62\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
2017
|
+
}
|
|
2018
|
+
const elements = elementsRaw.split(",").map((e) => e.trim()).filter((e) => e !== "");
|
|
2019
|
+
if (elements.length === 0) {
|
|
2020
|
+
validationError(`domain_elements \u306E ${domain} \u306B elements\uFF08${DOMAIN_ELEMENT_TYPES.join(", ")}\uFF09\u30921\u4EF6\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`);
|
|
2021
|
+
}
|
|
2022
|
+
return { domain, elements };
|
|
2023
|
+
}
|
|
2024
|
+
function parseDomainElements(values) {
|
|
2025
|
+
if (values.length === 0) {
|
|
2026
|
+
validationError("scope \u304C selected \u306E\u5834\u5408\u3001domain_elements \u30921\u4EF6\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
2027
|
+
}
|
|
2028
|
+
return values.map((value) => parseDomainElementEntry(value.trim()));
|
|
2029
|
+
}
|
|
2030
|
+
function registerAutoBackupCommands(parent, brand) {
|
|
2031
|
+
const autoBackup = parent.command("auto-backup").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u30FB\u5FA9\u5143");
|
|
2032
|
+
autoBackup.command("backup-dates").description("\u9078\u629E\u53EF\u80FD\u306A\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
|
|
2033
|
+
const client = resolveClient(parent, brand);
|
|
2034
|
+
printResult(await client.listAutoBackupBackupDates(), getFormat(parent));
|
|
2035
|
+
});
|
|
2036
|
+
autoBackup.command("list").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
|
|
2037
|
+
const client = resolveClient(parent, brand);
|
|
2038
|
+
printResult(await client.listAutoBackup(), getFormat(parent));
|
|
2039
|
+
});
|
|
2040
|
+
autoBackup.command("show <requestId>").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u306E\u8A73\u7D30\u3092\u53D6\u5F97").action(async (requestId) => {
|
|
2041
|
+
const client = resolveClient(parent, brand);
|
|
2042
|
+
printResult(await client.getAutoBackup(requestId), getFormat(parent));
|
|
2043
|
+
});
|
|
2044
|
+
autoBackup.command("create").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080").requiredOption("--backup-date <date>", "\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09").requiredOption("--operation-type <type>", "\u51E6\u7406\u7A2E\u5225\uFF08fetch / restore\uFF09").requiredOption("--scope <scope>", "\u51E6\u7406\u65B9\u6CD5\uFF08all / selected\uFF09").option("--domain-elements <value>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF08scope=selected \u306E\u3068\u304D\u5FC5\u9808\u3002\u7E70\u308A\u8FD4\u3057\u53EF\uFF09\u3002\u5F62\u5F0F: example.com=web,setting\uFF08elements: web / setting / mail\uFF09", collectFlagValue, []).option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7\uFF08restore \u6642\uFF09").action(async (opts) => {
|
|
2045
|
+
const operationType = opts.operationType;
|
|
2046
|
+
const scope = opts.scope;
|
|
2047
|
+
if (operationType === "restore") {
|
|
2048
|
+
await confirmDestructiveAction(parent, "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u307F\u307E\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u4E0A\u306E\u30C7\u30FC\u30BF\u304C\u4E0A\u66F8\u304D\u3055\u308C\u3001\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F");
|
|
2049
|
+
}
|
|
2050
|
+
const data = {
|
|
2051
|
+
backup_date: opts.backupDate,
|
|
2052
|
+
operation_type: operationType,
|
|
2053
|
+
scope
|
|
2054
|
+
};
|
|
2055
|
+
const domainElementValues = opts.domainElements;
|
|
2056
|
+
if (scope === "selected") {
|
|
2057
|
+
if (domainElementValues.length === 0) {
|
|
2058
|
+
validationError("scope \u304C selected \u306E\u5834\u5408\u3001--domain-elements \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
2059
|
+
}
|
|
2060
|
+
data.domain_elements = parseDomainElements(domainElementValues);
|
|
2061
|
+
} else if (domainElementValues.length > 0) {
|
|
2062
|
+
validationError("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F \u51E6\u7406\u65B9\u6CD5 \u304C selected \u306E\u5834\u5408\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002");
|
|
2063
|
+
}
|
|
2064
|
+
const client = resolveClient(parent, brand);
|
|
2065
|
+
printResult(await client.createAutoBackup(data), getFormat(parent));
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
// ../core/dist/commands/server/mysql-backup/index.js
|
|
2070
|
+
function registerMysqlBackupCommands(parent, brand) {
|
|
2071
|
+
const mysqlBackup = parent.command("mysql-backup").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u30FB\u5FA9\u5143");
|
|
2072
|
+
mysqlBackup.command("databases").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u72B6\u614B\u3092\u53D6\u5F97").action(async () => {
|
|
2073
|
+
const client = resolveClient(parent, brand);
|
|
2074
|
+
printResult(await client.listMysqlBackupDatabases(), getFormat(parent));
|
|
2075
|
+
});
|
|
2076
|
+
mysqlBackup.command("list").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
|
|
2077
|
+
const client = resolveClient(parent, brand);
|
|
2078
|
+
printResult(await client.listMysqlBackup(), getFormat(parent));
|
|
2079
|
+
});
|
|
2080
|
+
mysqlBackup.command("show <requestId>").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u8A73\u7D30\u3092\u53D6\u5F97").action(async (requestId) => {
|
|
2081
|
+
const client = resolveClient(parent, brand);
|
|
2082
|
+
printResult(await client.getMysqlBackup(requestId), getFormat(parent));
|
|
2083
|
+
});
|
|
2084
|
+
mysqlBackup.command("create").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080").requiredOption("--db-name <name>", "\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D").requiredOption("--backup-date <date>", "\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09").requiredOption("--operation-type <type>", "\u51E6\u7406\u7A2E\u5225\uFF08fetch / restore\uFF09").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7\uFF08restore \u6642\uFF09").action(async (opts) => {
|
|
2085
|
+
const operationType = opts.operationType;
|
|
2086
|
+
if (operationType === "restore") {
|
|
2087
|
+
await confirmDestructiveAction(parent, `\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9 "${opts.dbName}" \u306E MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u307F\u307E\u3059\u3002\u5BFE\u8C61 DB \u304C\u4E0A\u66F8\u304D\u3055\u308C\u3001\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
|
|
2088
|
+
}
|
|
2089
|
+
const client = resolveClient(parent, brand);
|
|
2090
|
+
printResult(await client.createMysqlBackup({
|
|
2091
|
+
db_name: opts.dbName,
|
|
2092
|
+
backup_date: opts.backupDate,
|
|
2093
|
+
operation_type: operationType
|
|
2094
|
+
}), getFormat(parent));
|
|
2095
|
+
});
|
|
2096
|
+
}
|
|
2097
|
+
|
|
1186
2098
|
// ../core/dist/commands/me/index.js
|
|
1187
2099
|
function registerMeCommand(program, brand) {
|
|
1188
2100
|
program.command("me").description("\u73FE\u5728\u306EAPI\u30AD\u30FC\u60C5\u5831\u3092\u8868\u793A").action(async (_opts, cmd) => {
|
|
@@ -1221,7 +2133,13 @@ function run(brand, version = "0.0.0") {
|
|
|
1221
2133
|
registerSshCommands(server, brand);
|
|
1222
2134
|
registerWpCommands(server, brand);
|
|
1223
2135
|
registerMailCommands(server, brand);
|
|
2136
|
+
registerSpamFilterCommands(server, brand);
|
|
1224
2137
|
registerMailFilterCommands(server, brand);
|
|
2138
|
+
registerAutoReplyCommands(server, brand);
|
|
2139
|
+
registerSmtpAbroadRestrictionCommands(server, brand);
|
|
2140
|
+
registerDkimCommands(server, brand);
|
|
2141
|
+
registerDmarcCommands(server, brand);
|
|
2142
|
+
registerSpfCommands(server, brand);
|
|
1225
2143
|
registerFtpCommands(server, brand);
|
|
1226
2144
|
registerDbCommands(server, brand);
|
|
1227
2145
|
registerPhpVersionCommands(server, brand);
|
|
@@ -1230,6 +2148,18 @@ function run(brand, version = "0.0.0") {
|
|
|
1230
2148
|
registerSslCommands(server, brand);
|
|
1231
2149
|
registerDnsCommands(server, brand);
|
|
1232
2150
|
registerLogCommands(server, brand);
|
|
2151
|
+
registerResourceMonitorCommands(server, brand);
|
|
2152
|
+
registerWafCommands(server, brand);
|
|
2153
|
+
registerPhpIniCommands(server, brand);
|
|
2154
|
+
registerWordPressSecurityCommands(server, brand);
|
|
2155
|
+
registerXAcceleratorCommands(server, brand);
|
|
2156
|
+
registerServerCacheCommands(server, brand);
|
|
2157
|
+
registerBrowserCacheCommands(server, brand);
|
|
2158
|
+
registerUrlRedirectCommands(server, brand);
|
|
2159
|
+
registerAccessDenyCommands(server, brand);
|
|
2160
|
+
registerXPageSpeedCommands(server, brand);
|
|
2161
|
+
registerAutoBackupCommands(server, brand);
|
|
2162
|
+
registerMysqlBackupCommands(server, brand);
|
|
1233
2163
|
program.parseAsync(process.argv).catch((err) => {
|
|
1234
2164
|
if (err instanceof ApiError) {
|
|
1235
2165
|
console.error(`\u30A8\u30E9\u30FC [${err.errorCode}]: ${err.message}`);
|
|
@@ -1252,7 +2182,7 @@ function run(brand, version = "0.0.0") {
|
|
|
1252
2182
|
// package.json
|
|
1253
2183
|
var package_default = {
|
|
1254
2184
|
name: "xserver-cli",
|
|
1255
|
-
version: "1.0
|
|
2185
|
+
version: "1.2.0",
|
|
1256
2186
|
description: "Official CLI for XServer API \u2014 manage your XServer hosting from the terminal",
|
|
1257
2187
|
type: "module",
|
|
1258
2188
|
bin: {
|