Skip to content

Commit

Permalink
fix ipv6 获取证书
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Nov 29, 2019
1 parent 7e6e24d commit 16e0df3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v2ray_util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '3.7.5.1'
__version__ = '3.7.5.2'

from .util_core.trans import _
5 changes: 4 additions & 1 deletion v2ray_util/util_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,22 @@ def bytes_2_human_readable(number_of_bytes, precision=1):
return str(number_of_bytes) + ' ' + unit

def gen_cert(domain):
local_ip = get_ip()
service_name = ["nginx", "httpd", "apache2"]
start_cmd = "systemctl start {} >/dev/null 2>&1"
stop_cmd = "systemctl stop {} >/dev/null 2>&1"

if not os.path.exists("/root/.acme.sh/acme.sh"):
if ":" in get_ip():
if ":" in local_ip:
if not os.path.exists("/root/.acme.sh/"):
os.makedirs("/root/.acme.sh")
os.system("curl https://acme-install.netlify.com/acme.sh -o /root/.acme.sh/acme.sh")
else:
os.system("curl https://get.acme.sh | sh")

get_ssl_cmd = "bash /root/.acme.sh/acme.sh --issue -d " + domain + " --debug --standalone --keylength ec-256"
if ":" in local_ip:
get_ssl_cmd = get_ssl_cmd + " --listen-v6"

if not os.path.exists("/.dockerenv"):
for name in service_name:
Expand Down

0 comments on commit 16e0df3

Please sign in to comment.