pixelarraylib 1.0.5__tar.gz → 1.0.7__tar.gz
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.
- {pixelarraylib-1.0.5/pixelarraylib.egg-info → pixelarraylib-1.0.7}/PKG-INFO +1 -1
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/__init__.py +1 -1
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/monitor/feishu.py +1 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/scripts/__init__.py +1 -1
- pixelarraylib-1.0.7/pixelarraylib/scripts/nginx_proxy_to_ecs.py +163 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/system/common.py +39 -1
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7/pixelarraylib.egg-info}/PKG-INFO +1 -1
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pyproject.toml +1 -1
- pixelarraylib-1.0.5/pixelarraylib/scripts/nginx_proxy_to_ecs.py +0 -119
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/LICENSE +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/MANIFEST.in +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/README.md +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/__main__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/__init__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/acr.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/aliyun_email.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/billing.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/content_scanner.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/domain.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/eci.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/ecs.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/eip.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/fc.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/oss.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/sms.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/aliyun/sts.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/db_utils/mysql.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/db_utils/redis.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/decorators/__init__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/decorators/decorators.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/gitlab/__init__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/gitlab/code_analyzer.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/gitlab/pypi_package_manager.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/monitor/__init__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/net/request.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/scripts/build_website.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/scripts/collect_code_to_txt.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/scripts/create_test_case_files.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/scripts/remove_empty_lines.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib/system/__init__.py +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib.egg-info/SOURCES.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib.egg-info/dependency_links.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib.egg-info/entry_points.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib.egg-info/requires.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/pixelarraylib.egg-info/top_level.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/requirements.txt +0 -0
- {pixelarraylib-1.0.5 → pixelarraylib-1.0.7}/setup.cfg +0 -0
|
@@ -14,6 +14,7 @@ class Feishu:
|
|
|
14
14
|
"llm微服务报警": "https://open.feishu.cn/open-apis/bot/v2/hook/54942aa6-24f1-4851-8fe9-d7c87572d00a",
|
|
15
15
|
"thirdparty微服务报警": "https://open.feishu.cn/open-apis/bot/v2/hook/b1e6237a-1323-4ad9-96f4-d74de5cdc00f",
|
|
16
16
|
"picturebed服务报警": "https://open.feishu.cn/open-apis/bot/v2/hook/d3c2e68c-3ed3-4832-9b66-76db5bd69b42",
|
|
17
|
+
"picturetransform服务报警": "https://open.feishu.cn/open-apis/bot/v2/hook/e975aa0a-acef-4e3f-bee4-6dc507b87ebd",
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
def __init__(self, channel_name):
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import base64
|
|
3
|
+
from pixelarraylib.system.common import execute_command_through_ssh, execute_command
|
|
4
|
+
from pixelarraylib.aliyun.domain import DomainUtils
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def nginx_proxy_file_template(
|
|
8
|
+
domain_name: str, port_of_service: str, ssl_cert_path: str, ssl_key_path: str
|
|
9
|
+
) -> str:
|
|
10
|
+
return f"""
|
|
11
|
+
server {{
|
|
12
|
+
listen 80;
|
|
13
|
+
server_name {domain_name}.pixelarrayai.com;
|
|
14
|
+
|
|
15
|
+
# 将所有HTTP请求重定向到HTTPS
|
|
16
|
+
return 301 https://$host$request_uri;
|
|
17
|
+
}}
|
|
18
|
+
|
|
19
|
+
server {{
|
|
20
|
+
listen 443 ssl;
|
|
21
|
+
server_name {domain_name}.pixelarrayai.com;
|
|
22
|
+
|
|
23
|
+
ssl_certificate {ssl_cert_path};
|
|
24
|
+
ssl_certificate_key {ssl_key_path};
|
|
25
|
+
|
|
26
|
+
location / {{
|
|
27
|
+
proxy_pass http://localhost:{port_of_service};
|
|
28
|
+
proxy_http_version 1.1;
|
|
29
|
+
proxy_set_header Host $host;
|
|
30
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
31
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
32
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
33
|
+
}}
|
|
34
|
+
}}
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def add_a_record_to_dns(
|
|
39
|
+
domain_name: str, ecs_ip: str, access_key_id: str, access_key_secret: str
|
|
40
|
+
) -> None:
|
|
41
|
+
domain_utils = DomainUtils(
|
|
42
|
+
access_key_id, access_key_secret, domain_name="pixelarrayai.com"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# 先检查是否存在相同的主机记录
|
|
46
|
+
existing_record = domain_utils.find_record_by_rr_and_type(rr=domain_name, type="A")
|
|
47
|
+
if existing_record:
|
|
48
|
+
print(f"发现已存在的主机记录 {domain_name},正在删除...")
|
|
49
|
+
success = domain_utils.delete_record_by_rr_and_type(rr=domain_name, type="A")
|
|
50
|
+
if success:
|
|
51
|
+
print(f"已删除旧的主机记录 {domain_name}")
|
|
52
|
+
else:
|
|
53
|
+
print(f"删除旧记录失败,但继续添加新记录")
|
|
54
|
+
|
|
55
|
+
# 添加新的解析记录
|
|
56
|
+
success, record_id = domain_utils.add_domain_record(
|
|
57
|
+
rr=domain_name,
|
|
58
|
+
type="A",
|
|
59
|
+
value=ecs_ip,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if success:
|
|
63
|
+
print(f"域名解析记录添加成功,记录ID: {record_id}")
|
|
64
|
+
else:
|
|
65
|
+
print("域名解析记录添加失败")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def deploy(
|
|
69
|
+
domain_name: str,
|
|
70
|
+
port_of_service: str,
|
|
71
|
+
ssl_cert_path: str,
|
|
72
|
+
ssl_key_path: str,
|
|
73
|
+
access_key_id: str,
|
|
74
|
+
access_key_secret: str,
|
|
75
|
+
mode: str,
|
|
76
|
+
ecs_ip: str,
|
|
77
|
+
) -> None:
|
|
78
|
+
if mode == "remote":
|
|
79
|
+
execute_command_through_ssh(
|
|
80
|
+
ecs_ip,
|
|
81
|
+
f"sudo rm -f /etc/nginx/sites-available/{domain_name} && sudo rm -f /etc/nginx/sites-enabled/{domain_name}",
|
|
82
|
+
)
|
|
83
|
+
print("删除原有配置成功")
|
|
84
|
+
execute_command_through_ssh(
|
|
85
|
+
ecs_ip,
|
|
86
|
+
f"sudo touch /etc/nginx/sites-available/{domain_name}",
|
|
87
|
+
)
|
|
88
|
+
print("文件创建成功")
|
|
89
|
+
nginx_proxy_file_content = nginx_proxy_file_template(
|
|
90
|
+
domain_name, port_of_service, ssl_cert_path, ssl_key_path
|
|
91
|
+
)
|
|
92
|
+
# 使用 base64 编码来避免特殊字符问题
|
|
93
|
+
encoded_content = base64.b64encode(nginx_proxy_file_content.encode('utf-8')).decode('utf-8')
|
|
94
|
+
execute_command_through_ssh(
|
|
95
|
+
ecs_ip,
|
|
96
|
+
f"echo '{encoded_content}' | base64 -d | sudo tee /etc/nginx/sites-available/{domain_name} > /dev/null",
|
|
97
|
+
)
|
|
98
|
+
print("内容写入成功")
|
|
99
|
+
execute_command_through_ssh(
|
|
100
|
+
ecs_ip,
|
|
101
|
+
f"sudo ln -s /etc/nginx/sites-available/{domain_name} /etc/nginx/sites-enabled/{domain_name}",
|
|
102
|
+
)
|
|
103
|
+
print("nginx配置添加成功,准备重启")
|
|
104
|
+
execute_command_through_ssh(
|
|
105
|
+
ecs_ip, f"sudo nginx -t && sudo systemctl restart nginx"
|
|
106
|
+
)
|
|
107
|
+
print("重启成功,请检查配置是否生效")
|
|
108
|
+
else:
|
|
109
|
+
execute_command(
|
|
110
|
+
f"sudo rm -f /etc/nginx/sites-available/{domain_name} && sudo rm -f /etc/nginx/sites-enabled/{domain_name}"
|
|
111
|
+
)
|
|
112
|
+
print("删除原有配置成功")
|
|
113
|
+
execute_command(
|
|
114
|
+
f"sudo touch /etc/nginx/sites-available/{domain_name}"
|
|
115
|
+
)
|
|
116
|
+
print("文件创建成功")
|
|
117
|
+
nginx_proxy_file_content = nginx_proxy_file_template(
|
|
118
|
+
domain_name, port_of_service, ssl_cert_path, ssl_key_path
|
|
119
|
+
)
|
|
120
|
+
execute_command(
|
|
121
|
+
f"sudo echo {nginx_proxy_file_content} | base64 -d | sudo tee /etc/nginx/sites-available/{domain_name} > /dev/null"
|
|
122
|
+
)
|
|
123
|
+
print("内容写入成功")
|
|
124
|
+
execute_command(
|
|
125
|
+
f"sudo ln -s /etc/nginx/sites-available/{domain_name} /etc/nginx/sites-enabled/{domain_name}"
|
|
126
|
+
)
|
|
127
|
+
print("nginx配置添加成功,准备重启")
|
|
128
|
+
execute_command(
|
|
129
|
+
"sudo nginx -t && sudo systemctl restart nginx"
|
|
130
|
+
)
|
|
131
|
+
print("重启成功,请检查配置是否生效")
|
|
132
|
+
add_a_record_to_dns(domain_name, ecs_ip, access_key_id, access_key_secret)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def main():
|
|
136
|
+
parser = argparse.ArgumentParser(
|
|
137
|
+
description="Nginx反向代理配置到ECS",
|
|
138
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
139
|
+
epilog=__doc__,
|
|
140
|
+
)
|
|
141
|
+
parser.add_argument("--domain_name", "-d", help="需要代理的域名")
|
|
142
|
+
parser.add_argument("--port_of_service", "-p", help="端口或服务")
|
|
143
|
+
parser.add_argument("--access_key_id", "-a", help="阿里云AccessKeyID")
|
|
144
|
+
parser.add_argument("--access_key_secret", "-s", help="阿里云AccessKeySecret")
|
|
145
|
+
parser.add_argument("--mode", "-m", help="本地执行还是远程执行,local或remote,默认是remote")
|
|
146
|
+
parser.add_argument("--ecs_ip", "-e", help="服务器的IP地址")
|
|
147
|
+
|
|
148
|
+
args = parser.parse_args()
|
|
149
|
+
|
|
150
|
+
deploy(
|
|
151
|
+
args.domain_name,
|
|
152
|
+
args.port_of_service,
|
|
153
|
+
"/var/pixelarray/ssl_auth/pixelarrayai.com.pem",
|
|
154
|
+
"/var/pixelarray/ssl_auth/pixelarrayai.com.key",
|
|
155
|
+
args.access_key_id,
|
|
156
|
+
args.access_key_secret,
|
|
157
|
+
args.mode,
|
|
158
|
+
args.ecs_ip,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
if __name__ == "__main__":
|
|
163
|
+
main()
|
|
@@ -3,16 +3,54 @@ import json
|
|
|
3
3
|
import re
|
|
4
4
|
import subprocess
|
|
5
5
|
import traceback
|
|
6
|
-
from typing import Union, List, Generator
|
|
6
|
+
from typing import Callable, Union, List, Generator, Any
|
|
7
7
|
from cryptography.fernet import Fernet
|
|
8
8
|
import base64
|
|
9
9
|
from pixelarraylib.monitor.feishu import Feishu
|
|
10
10
|
import os
|
|
11
11
|
import paramiko
|
|
12
|
+
from concurrent.futures import ProcessPoolExecutor
|
|
12
13
|
|
|
13
14
|
feishu_alert = Feishu("devtoolkit服务报警")
|
|
14
15
|
|
|
15
16
|
|
|
17
|
+
def execute_function_in_other_process(function: Callable, *args, **kwargs) -> Any:
|
|
18
|
+
"""
|
|
19
|
+
description:
|
|
20
|
+
在其他进程中执行函数
|
|
21
|
+
parameters:
|
|
22
|
+
function(Callable): 需要执行的函数
|
|
23
|
+
args(tuple): 函数的参数
|
|
24
|
+
kwargs(dict): 函数的关键字参数
|
|
25
|
+
return:
|
|
26
|
+
result(Any): 函数执行结果
|
|
27
|
+
"""
|
|
28
|
+
with ProcessPoolExecutor() as executor:
|
|
29
|
+
return executor.submit(function, *args, **kwargs).result()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def execute_function_in_other_process_async(
|
|
33
|
+
function: Callable, *args, **kwargs
|
|
34
|
+
) -> Any:
|
|
35
|
+
"""
|
|
36
|
+
description:
|
|
37
|
+
在其他进程中异步执行函数
|
|
38
|
+
parameters:
|
|
39
|
+
function(Callable): 需要执行的函数
|
|
40
|
+
args(tuple): 函数的参数
|
|
41
|
+
kwargs(dict): 函数的关键字参数
|
|
42
|
+
return:
|
|
43
|
+
result(Any): 函数执行结果
|
|
44
|
+
"""
|
|
45
|
+
loop = asyncio.get_event_loop()
|
|
46
|
+
with ProcessPoolExecutor() as executor:
|
|
47
|
+
# 在线程池中运行阻塞的executor.submit操作
|
|
48
|
+
result = await loop.run_in_executor(
|
|
49
|
+
None, lambda: executor.submit(function, *args, **kwargs).result()
|
|
50
|
+
)
|
|
51
|
+
return result
|
|
52
|
+
|
|
53
|
+
|
|
16
54
|
async def execute_batch_async_tasks(tasks, semaphore_count=None):
|
|
17
55
|
if semaphore_count is None:
|
|
18
56
|
return await asyncio.gather(*tasks)
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import base64
|
|
3
|
-
from pixelarraylib.system.common import execute_command_through_ssh
|
|
4
|
-
from pixelarraylib.aliyun.domain import DomainUtils
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def nginx_proxy_file_template(
|
|
8
|
-
domain_name: str, port_of_service: str, ssl_cert_path: str, ssl_key_path: str
|
|
9
|
-
) -> str:
|
|
10
|
-
return f"""
|
|
11
|
-
server {{
|
|
12
|
-
listen 80;
|
|
13
|
-
server_name {domain_name}.pixelarrayai.com;
|
|
14
|
-
|
|
15
|
-
# 将所有HTTP请求重定向到HTTPS
|
|
16
|
-
return 301 https://$host$request_uri;
|
|
17
|
-
}}
|
|
18
|
-
|
|
19
|
-
server {{
|
|
20
|
-
listen 443 ssl;
|
|
21
|
-
server_name {domain_name}.pixelarrayai.com;
|
|
22
|
-
|
|
23
|
-
ssl_certificate {ssl_cert_path};
|
|
24
|
-
ssl_certificate_key {ssl_key_path};
|
|
25
|
-
|
|
26
|
-
location / {{
|
|
27
|
-
proxy_pass http://localhost:{port_of_service};
|
|
28
|
-
proxy_http_version 1.1;
|
|
29
|
-
proxy_set_header Host $host;
|
|
30
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
31
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
32
|
-
proxy_set_header X-Forwarded-Proto $scheme;
|
|
33
|
-
}}
|
|
34
|
-
}}
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def add_a_record_to_dns(
|
|
39
|
-
domain_name: str, ecs_ip: str, access_key_id: str, access_key_secret: str
|
|
40
|
-
) -> None:
|
|
41
|
-
domain_utils = DomainUtils(
|
|
42
|
-
access_key_id, access_key_secret, domain_name="pixelarrayai.com"
|
|
43
|
-
)
|
|
44
|
-
domain_utils.add_domain_record(
|
|
45
|
-
rr=domain_name,
|
|
46
|
-
type="A",
|
|
47
|
-
value=ecs_ip,
|
|
48
|
-
)
|
|
49
|
-
print("域名解析记录添加成功")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def deploy(
|
|
53
|
-
ecs_ip: str,
|
|
54
|
-
domain_name: str,
|
|
55
|
-
port_of_service: str,
|
|
56
|
-
ssl_cert_path: str,
|
|
57
|
-
ssl_key_path: str,
|
|
58
|
-
access_key_id: str,
|
|
59
|
-
access_key_secret: str,
|
|
60
|
-
) -> None:
|
|
61
|
-
execute_command_through_ssh(
|
|
62
|
-
ecs_ip,
|
|
63
|
-
f"sudo rm -f /etc/nginx/sites-available/{domain_name} && sudo rm -f /etc/nginx/sites-enabled/{domain_name}",
|
|
64
|
-
)
|
|
65
|
-
print("删除原有配置成功")
|
|
66
|
-
execute_command_through_ssh(
|
|
67
|
-
ecs_ip,
|
|
68
|
-
f"sudo touch /etc/nginx/sites-available/{domain_name}",
|
|
69
|
-
)
|
|
70
|
-
print("文件创建成功")
|
|
71
|
-
nginx_proxy_file_content = nginx_proxy_file_template(
|
|
72
|
-
domain_name, port_of_service, ssl_cert_path, ssl_key_path
|
|
73
|
-
)
|
|
74
|
-
# 使用 base64 编码来避免特殊字符问题
|
|
75
|
-
encoded_content = base64.b64encode(nginx_proxy_file_content.encode('utf-8')).decode('utf-8')
|
|
76
|
-
execute_command_through_ssh(
|
|
77
|
-
ecs_ip,
|
|
78
|
-
f"echo '{encoded_content}' | base64 -d | sudo tee /etc/nginx/sites-available/{domain_name} > /dev/null",
|
|
79
|
-
)
|
|
80
|
-
print("内容写入成功")
|
|
81
|
-
execute_command_through_ssh(
|
|
82
|
-
ecs_ip,
|
|
83
|
-
f"sudo ln -s /etc/nginx/sites-available/{domain_name} /etc/nginx/sites-enabled/{domain_name}",
|
|
84
|
-
)
|
|
85
|
-
print("nginx配置添加成功,准备重启")
|
|
86
|
-
execute_command_through_ssh(
|
|
87
|
-
ecs_ip, f"sudo nginx -t && sudo systemctl restart nginx"
|
|
88
|
-
)
|
|
89
|
-
print("重启成功,请检查配置是否生效")
|
|
90
|
-
add_a_record_to_dns(domain_name, ecs_ip, access_key_id, access_key_secret)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def main():
|
|
94
|
-
parser = argparse.ArgumentParser(
|
|
95
|
-
description="Nginx反向代理配置到ECS",
|
|
96
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
97
|
-
epilog=__doc__,
|
|
98
|
-
)
|
|
99
|
-
parser.add_argument("--ecs_ip", "-e", help="服务IP地址")
|
|
100
|
-
parser.add_argument("--domain_name", "-d", help="需要代理的域名")
|
|
101
|
-
parser.add_argument("--port_of_service", "-p", help="端口或服务")
|
|
102
|
-
parser.add_argument("--access_key_id", "-a", help="阿里云AccessKeyID")
|
|
103
|
-
parser.add_argument("--access_key_secret", "-s", help="阿里云AccessKeySecret")
|
|
104
|
-
|
|
105
|
-
args = parser.parse_args()
|
|
106
|
-
|
|
107
|
-
deploy(
|
|
108
|
-
args.ecs_ip,
|
|
109
|
-
args.domain_name,
|
|
110
|
-
args.port_of_service,
|
|
111
|
-
"/var/pixelarray/ssl_auth/pixelarrayai.com.pem",
|
|
112
|
-
"/var/pixelarray/ssl_auth/pixelarrayai.com.key",
|
|
113
|
-
args.access_key_id,
|
|
114
|
-
args.access_key_secret,
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if __name__ == "__main__":
|
|
119
|
-
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|