tengattack / certbot-dns-aliyun Goto Github PK
View Code? Open in Web Editor NEWA certbot dns plugin to obtain certificates using aliyun.
License: Other
A certbot dns plugin to obtain certificates using aliyun.
License: Other
上一版本certbot/certbot:v0.37.2正常。新版本提示找不到alidns模块
已在阿里云控制台上给用户分配了AliyunDomainFullAccess权限,任然报一下错误:
AliError: User not authorized to operate on the specified resource, or this API doesn't support RAM
Hi, it seems that the extension does not work with STS credentials, since there is no way to specify the token. Please correct me if I am wrong.
本次certbot更新后 提示
An unexpected error occurred: pkg_resources.ContextualVersionConflict: (cryptography 36.0.0 (/var/lib/snapd/snap/certbot/1670/lib/python3.8/site-packages), Requirement.parse('cryptography<4,>=2'), {'dns-lexicon'}) Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/tmpsg4ueu0p/log or re-run Certbot with -v for more details.
去掉setup.py
里面的 dns-lexicon
以及certbot_dns_aliyun/dns_aliyun.py
引用 from certbot.plugins import dns_common_lexicon
后 我本地测试没啥问题
官方certbot 工具在0.22.0 版本以上就支持获取通配符证书了。当前certboot 版本是 0.31.0 。当前插件支持的版本是多少?
当前环境
$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
安装过程中出现下面的提示:
$ pip install certbot-dns-aliyun
Collecting certbot-dns-aliyun
Using cached https://files.pythonhosted.org/packages/b3/b0/aed9384ee7f0850218ccd2ea9ad2b9993cb6216b5faa242555681799123a/certbot_dns_aliyun-2.0.0-py2.py3-none-any.whl
Collecting acme>=2.0.0 (from certbot-dns-aliyun)
Could not find a version that satisfies the requirement acme>=2.0.0 (from certbot-dns-aliyun) (from versions: 0.0.0.dev20151006, 0.0.0.dev20151008, 0.0.0.dev20151017, 0.0.0.dev20151020, 0.0.0.dev20151021, 0.0.0.dev20151024, 0.0.0.dev20151030, 0.0.0.dev20151104, 0.0.0.dev20151107, 0.0.0.dev20151108, 0.0.0.dev20151114, 0.0.0.dev20151123, 0.0.0.dev20151201, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.22.1, 0.22.2, 0.23.0, 0.24.0, 0.25.0, 0.25.1, 0.26.0, 0.26.1, 0.27.0, 0.27.1, 0.28.0, 0.29.0, 0.29.1, 0.30.0, 0.30.1, 0.30.2, 0.31.0, 0.32.0, 0.33.0, 0.33.1, 0.34.0, 0.34.1, 0.34.2, 0.35.0, 0.35.1, 0.36.0, 0.37.0, 0.37.1, 0.37.2, 0.38.0, 0.39.0, 0.40.0, 0.40.1, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0)
No matching distribution found for acme>=2.0.0 (from certbot-dns-aliyun)
申请阿里云国际下的域名,确认 key 和 secret 正确,但提示
Failed authorization procedure. xxxxx.org (dns-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Incorrect TXT record "hVTVJTKwxtfkjzj5_RCUsuzqRGuIN5mnXIbeGtGhaQc" found at _acme-challenge.xxxxx.org, xxxxx.org (dns-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Incorrect TXT record "hVTVJTKwxtfkjzj5_RCUsuzqRGuIN5mnXIbeGtGhaQc" found at _acme-challenge.xxxxx.org
账号也没有看到任何操作记录。
如题,直接使用pip install certbot-dns-aliyun
后没有找到credentials.ini
。这个文件需要自己在哪个文件夹下创建吗?
这篇教程 先配置虚拟环境venv
之后再pip install
,即可让credentials.ini
在指定环境的文件夹中。如果不创建venv
应该在哪里找到/创建credentials.ini
呢?
建不同的credentials.ini ?
::Create virtual env. you can try other new version to eliminate certroot warnings about python version
conda create --name certbot python=3.7
::activate env, also works in bat file.
call C:\miniconda3\Scripts\activate.bat C:\miniconda3\envs\certbot3
::Note in particular the double quotes here
certbot certonly --authenticator=dns-aliyun --dns-aliyun-credentials="C:\path\to\credentials.ini" -d "*.example.com"
I am using Centos 7.6 and Python 2.7.5 and I think something goes wrong ...
-bash: virtualenv: command not found
[clusteradmin@LBR certbot-dns-aliyun]$ python --version
Python 2.7.5
[clusteradmin@LBR certbot-dns-aliyun]$ sudo python setup.py install
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to certbot_dns_aliyun.egg-info/requires.txt
writing certbot_dns_aliyun.egg-info/PKG-INFO
writing top-level names to certbot_dns_aliyun.egg-info/top_level.txt
writing dependency_links to certbot_dns_aliyun.egg-info/dependency_links.txt
writing entry points to certbot_dns_aliyun.egg-info/entry_points.txt
reading manifest file 'certbot_dns_aliyun.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.rst'
writing manifest file 'certbot_dns_aliyun.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/certbot_dns_aliyun
copying build/lib/certbot_dns_aliyun/dns_aliyun_test.py -> build/bdist.linux-x86_64/egg/certbot_dns_aliyun
copying build/lib/certbot_dns_aliyun/__init__.py -> build/bdist.linux-x86_64/egg/certbot_dns_aliyun
copying build/lib/certbot_dns_aliyun/alidns_test.py -> build/bdist.linux-x86_64/egg/certbot_dns_aliyun
copying build/lib/certbot_dns_aliyun/dns_aliyun.py -> build/bdist.linux-x86_64/egg/certbot_dns_aliyun
copying build/lib/certbot_dns_aliyun/alidns.py -> build/bdist.linux-x86_64/egg/certbot_dns_aliyun
byte-compiling build/bdist.linux-x86_64/egg/certbot_dns_aliyun/dns_aliyun_test.py to dns_aliyun_test.pyc
byte-compiling build/bdist.linux-x86_64/egg/certbot_dns_aliyun/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/certbot_dns_aliyun/alidns_test.py to alidns_test.pyc
byte-compiling build/bdist.linux-x86_64/egg/certbot_dns_aliyun/dns_aliyun.py to dns_aliyun.pyc
byte-compiling build/bdist.linux-x86_64/egg/certbot_dns_aliyun/alidns.py to alidns.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying certbot_dns_aliyun.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/certbot_dns_aliyun-0.23.0.dev0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing certbot_dns_aliyun-0.23.0.dev0-py2.7.egg
Removing /usr/lib/python2.7/site-packages/certbot_dns_aliyun-0.23.0.dev0-py2.7.egg
Copying certbot_dns_aliyun-0.23.0.dev0-py2.7.egg to /usr/lib/python2.7/site-packages
certbot-dns-aliyun 0.23.0.dev0 is already the active version in easy-install.pth
Installed /usr/lib/python2.7/site-packages/certbot_dns_aliyun-0.23.0.dev0-py2.7.egg
Processing dependencies for certbot-dns-aliyun==0.23.0.dev0
Traceback (most recent call last):
File "setup.py", line 66, in <module>
test_suite='certbot_dns_aliyun',
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 73, in run
self.do_egg_install()
File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 101, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 380, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 604, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 655, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 706, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 631, in resolve
requirements.extend(dist.requires(req.extras)[::-1])
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2497, in requires
"%s has no such extra feature %r" % (self, ext)
pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'
粗略看了一遍你的代码,感觉你这个import好像是2.x的风格?
然后我在 3.6 里安装之后,提示我没有alidns
,我提个pr给你更新一下?
如 /etc/letsencrypt/live/mapp-api.rzatfc.com-0001/fullchain.pem
红色提示推荐我将 certbot-dns-aliyun:dns-aliyun 改为 dns-aliyun ,但是使用 dns-aliyun 却无法正确获得证书,我现在只能继续使用 certbot-dns-aliyun:dns-aliyun 忽略红色提示,觉得有点矛盾,建议在 dns-aliyun 真正可以使用时再提示。
证书到期后,运行 certbot-auto renew 时遇到一下错误:
Cert is due for renewal, auto-renewing...
Could not choose appropriate plugin: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',)
Attempting to renew cert (test.com) from /etc/letsencrypt/renewal/test.com.conf produced an unexpected error: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',). Skipping.
需要做额外设置吗?
I packaged this thing on Fedora COPR here. Users of these OSes may find these preferable to installing using pip
. FYI.
ImportError: No module named 'alidns'
Hello, nice work.
A suggestion. AliyunDNSFullAccess is too wide, for I will provide the website access permission to others.
Could you please check the minimum permission required?
I'm trying, and after finish, I will provide my experience here.
certbot -a certbot-dns-aliyun:dns-aliyun -i nginx -d xxxx.com -d "*.xxxx.com" --server https://acme-v02.api.lets
encrypt.org/directory --certbot-dns-aliyun:dns-aliyun-credentials ~/.secerts/certbot/aliyun
Encountered exception during recovery:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/certbot/error_handler.py", line 124, in _call_registered
self.funcs-1
File "/usr/local/lib/python2.7/dist-packages/certbot/auth_handler.py", line 220, in _cleanup_challenges
self.auth.cleanup(achalls)
File "/usr/local/lib/python2.7/dist-packages/certbot/plugins/dns_common.py", line 77, in cleanup
self._cleanup(domain, validation_domain_name, validation)
File "/usr/local/lib/python2.7/dist-packages/certbot_dns_aliyun/dns_aliyun.py", line 53, in _cleanup
self._get_alidns_client().del_txt_record(domain, validation_name, validation)
File "/usr/local/lib/python2.7/dist-packages/certbot_dns_aliyun/alidns.py", line 81, in del_txt_record
domain = self._find_domain_id(domain)
File "/usr/local/lib/python2.7/dist-packages/certbot_dns_aliyun/alidns.py", line 54, in _find_domain_id
.format(domain, domain_name_guesses))
PluginError: Unable to determine zone identifier for xxxx.com using zone names: [u'xxxx.com', u'com']
using ubuntu arm64 for raspi 3b+, but snap install
return
error: snap "certbot-dns-aliyun" is not available on stable for this architecture (arm64) but
exists on other architectures (amd64).
could you help to port it to arm64?
大佬,树莓派上用Ubuntu,snap安装报没有当前架构,能适配一下arm64么?
执行命令certbot certonly --authenticator = dns-aliyun \ --dns-aliyun-credentials = '/my/credentials.ini' \ --email [email protected] \ -d "jenkins.pengbocloud.com"
@tengattack
Hi the certbot provider works great but mess up pour DNS Zone files with TXT records. It will be great if it also delete the TXT again
An unexpected error occurred:
pkg_resources.ContextualVersionConflict: (cryptography 36.0.0 (/snap/certbot/1670/lib/python3.8/site-packages), Requirement.parse('cryptography<4,>=2'), {'dns-lexicon'})
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/tmpjakf_8wr/log or re-run Certbot with -v for more details.
Name Version Rev Tracking Publisher Notes
certbot 1.22.0 1670 latest/stable certbot-eff✓ classic
certbot-dns-aliyun 0.38.1 1 latest/stable tengattack -
core20 20211129 1270 latest/stable canonical✓ base
snapd 2.53.4 14295 latest/stable canonical✓ snapd
dns-lexicon
dependency was broken by cryptography
versioning. It is fixed in lexicon 3.7.1
. Please bump its version and update snap image.
dns-lexicon
依赖因为 cryptography
的版本编号不能满足, 在lexicon 3.7.1
版本中修复了。应该升级一下依赖更新一下snap image就行了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.