|
53 | 53 | "User": "用户", |
54 | 54 | "Subdomain": "子域名", |
55 | 55 | "Resolve to": "源站地址", |
| 56 | + "Content": "内容", |
56 | 57 | "Login as %s": "%s 已登录", |
57 | 58 | "vetting": "审批中", |
58 | 59 | "validating": "等待验证", |
59 | 60 | "ready": "已启用", |
| 61 | + "none": "未知", |
60 | 62 | "Select your action:": "选择所需的操作,输入数字:", |
61 | 63 | "Missing required arg \"%s\". (act:%s)": "缺少参数 \"%s\". (act:%s)", |
62 | 64 | "Login failed, msg: %s": "登录失败: %s", |
|
73 | 75 | "??? %s": "喵喵喵? %s", |
74 | 76 | "Please set CNAME record of %s to %s and run this option again after record become effective": |
75 | 77 | "请将%s的CNAME记录设置为%s, 然后在解析生效后再运行一次\"开通SSL\"", |
| 78 | + "Please create a file with the following content and run this option again after record become effective:": |
| 79 | + "请新建文件使下列URL能访问到指定的内容,然后再运行一次\"开通SSL\":", |
76 | 80 | "Can't delete root record": "不能删除根域名", |
77 | 81 | "Record %s is deleted": "DNS记录%s已删除", |
78 | 82 | "Record %s is not found in zone %s": "记录%s不存在于域名%s中", |
@@ -210,9 +214,18 @@ def ssl_verfication(self, arg): |
210 | 214 | log("SSL for domain %s has already been activated.", arg['zone']) |
211 | 215 | return True |
212 | 216 | verification_info = r['result'][0]['verification_info'] |
213 | | - log("Please set CNAME record of %s to %s and run this option again after record become effective", ( |
214 | | - verification_info['record_name'].encode('utf-8'), verification_info['record_target'].encode('utf-8'))) |
215 | | - |
| 217 | + if 'record_name' in verification_info: # DNS verification |
| 218 | + log("Please set CNAME record of %s to %s and run this option again after record become effective", ( |
| 219 | + verification_info['record_name'].encode('utf-8'), verification_info['record_target'].encode('utf-8'))) |
| 220 | + else: # HTTP verification |
| 221 | + log("Please create a file with the following content and run this option again after record become effective:") |
| 222 | + print("%-90s%s" % (i18n("URL"), i18n("Content"))) |
| 223 | + print("-" * 80) |
| 224 | + print("\n".join(map(lambda x: "%-90s%s" % ( |
| 225 | + x['verification_info']['http_url'], |
| 226 | + x['verification_info']['http_body']), |
| 227 | + r['result']))) |
| 228 | + |
216 | 229 | def add_subdomain(self, arg): |
217 | 230 | r = self._hostapi("zone_lookup", {"zone_name": arg['zone_name']}) |
218 | 231 | if 'hosted_cnames' not in r['response'] or not r['response']['hosted_cnames']: |
@@ -295,7 +308,7 @@ def _zone_lookup(self, j): |
295 | 308 | ssl_cname = z.encode('utf-8') |
296 | 309 | ssl_resolve_to = hosted[z].encode('utf-8') |
297 | 310 | continue |
298 | | - print("%-32s%-24s%-32s" % (z, hosted[z], tos[z])) |
| 311 | + print("%-32s%-32s%-32s" % (z, hosted[z], tos[z])) |
299 | 312 | if ssl_cname and j['response']['ssl_status'] != "ready": |
300 | 313 | print("") |
301 | 314 | log("If you want to activate SSL, please set CNAME record of %s to %s and " \ |
@@ -330,7 +343,7 @@ def check_hostkey(force = False): |
330 | 343 |
|
331 | 344 | def menu(act = None): |
332 | 345 | if not act: |
333 | | - acts = [k for k in CFARG.keys() if k != "user_auth"] + ["logout"] |
| 346 | + acts = [k for k in sorted(CFARG.keys()) if k != "user_auth"] + ["logout"] |
334 | 347 | print("=" * 32) |
335 | 348 | print(i18n("Select your action:")) |
336 | 349 | for i in range(len(acts)): |
|
0 commit comments