Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Christophe Siraut | 3dd7ca0a1f | |
Christophe Siraut | 0811ba1444 | |
Chris | 1e83c814a9 | |
Chris | 61753b0634 | |
Anthony Robinson | 8b85f37a81 | |
Chris | 009ba8ea7f | |
Istvan Pusztai | d2d006c2a7 |
|
@ -10,6 +10,7 @@ e.g.: `CLI_DEFAULTS_DEBIAN_JESSIE`. Currently these are defined for:
|
|||
- Ubuntu Vivid (15.04)
|
||||
- Ubuntu Wily (15.10)
|
||||
- Ubuntu Xenial (16.04)
|
||||
- CentOS (7)
|
||||
|
||||
You can define new lists below following the instructions hereafter, please
|
||||
consider making a pull-request when you do so, so others may benefit of your
|
||||
|
@ -57,8 +58,8 @@ from certbot import errors
|
|||
from certbot_haproxy.util import MemoiseNoArgs
|
||||
|
||||
RE_HAPROXY_DOMAIN_ACL = re.compile(
|
||||
r'\s*acl (?P<name>[0-9a-z_\-.]+) '
|
||||
r'hdr\(host\) -i '
|
||||
r'\s*acl\s+(?P<name>[0-9a-z_\-.]+)\s+'
|
||||
r'(?:hdr\(host\)|req\.ssl_sni)\s+-i\s+'
|
||||
r'(?P<domain>' # Start group "domain"
|
||||
r'(?:[0-9-a-z](?:[a-z0-9-]{0,61}[a-z0-9]\.)+)' # (sub-)domain parts
|
||||
r'(?:[0-9-a-z](?:[a-z0-9-]{0,61}[a-z0-9]))' # TLD part
|
||||
|
@ -87,6 +88,17 @@ CLI_DEFAULTS_DEBIAN_BASED_PRE_SYSTEMD_OS = dict(
|
|||
crt_directory='/opt/certbot/haproxy_fullchains',
|
||||
)
|
||||
|
||||
CLI_DEFAULTS_RHEL_BASED_SYSTEMD_OS = dict(
|
||||
service_manager='systemctl',
|
||||
version_cmd=['/usr/sbin/haproxy', '-v'],
|
||||
restart_cmd=['sudo', 'systemctl', 'restart', 'haproxy'],
|
||||
# Needs the config file as an argument:
|
||||
conftest_cmd=['/usr/sbin/haproxy', '-c', '-f'],
|
||||
haproxy_config='/etc/haproxy/haproxy.cfg',
|
||||
# Needs to be writeable by the user that will run certbot
|
||||
crt_directory='/opt/certbot/haproxy_fullchains',
|
||||
)
|
||||
|
||||
CLI_DEFAULTS = {
|
||||
"debian": {
|
||||
'_min_version': '7',
|
||||
|
@ -102,6 +114,10 @@ CLI_DEFAULTS = {
|
|||
'15.04': CLI_DEFAULTS_DEBIAN_BASED_SYSTEMD_OS,
|
||||
'15.10': CLI_DEFAULTS_DEBIAN_BASED_SYSTEMD_OS,
|
||||
'16.04': CLI_DEFAULTS_DEBIAN_BASED_SYSTEMD_OS
|
||||
},
|
||||
"centos": {
|
||||
'_min_version': '7',
|
||||
'7': CLI_DEFAULTS_RHEL_BASED_SYSTEMD_OS
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ def create_self_signed_cert(bits=2048, **kwargs):
|
|||
cert = crypto.X509()
|
||||
|
||||
attributes = {
|
||||
'countryName': u"FU",
|
||||
'countryName': u"UK",
|
||||
'stateOrProvinceName': u"Oceania",
|
||||
'localityName': u"London",
|
||||
'organizationName': u"Ministry of Truth",
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
certbot-haproxy (0.1.1-1) stretch; urgency=low
|
||||
|
||||
* source package automatically created by stdeb 0.8.5
|
||||
|
||||
-- tobald@debian.org <tobald@debian.org> Thu, 19 Jul 2018 11:46:22 +0200
|
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,14 @@
|
|||
Source: certbot-haproxy
|
||||
Maintainer: tobald@debian.org <tobald@debian.org>
|
||||
Section: python
|
||||
Priority: optional
|
||||
Build-Depends: dh-python, python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 9)
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://code.greenhost.net/open/certbot-haproxy
|
||||
|
||||
Package: python-certbot-haproxy
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${python:Depends}
|
||||
Description: HAProxy plugin for Certbot
|
||||
This is a plugin for Certbot, it enables automatically authenticating domains ans retrieving certificates. It can also restart HAProxy after new certificates are installed. However, it will not configure HAProxy because. HAProxy is unlikely to be used for small/simple setups like what Apache or NGiNX are more likely to be used for. HAProxy configurations vary greatly, any configuration this plugin could define is most likely not applicable in your environment.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
# This file was automatically generated by stdeb 0.8.5 at
|
||||
# Thu, 19 Jul 2018 11:46:22 +0200
|
||||
%:
|
||||
dh $@ --with python2
|
||||
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
|
@ -0,0 +1,4 @@
|
|||
# please also check http://pypi.debian.net/certbot-haproxy/watch
|
||||
version=3
|
||||
opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
|
||||
http://pypi.debian.net/certbot-haproxy/certbot-haproxy-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
|
45
setup.py
45
setup.py
|
@ -1,11 +1,48 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from setuptools import setup
|
||||
from setuptools import find_packages
|
||||
from distutils.command.sdist import sdist
|
||||
|
||||
own_version = '0.1.1'
|
||||
certbot_version = '0.8.1'
|
||||
|
||||
class eo_sdist(sdist):
|
||||
def run(self):
|
||||
if os.path.exists('VERSION'):
|
||||
os.remove('VERSION')
|
||||
version = get_version()
|
||||
version_file = open('VERSION', 'w')
|
||||
version_file.write(version)
|
||||
version_file.close()
|
||||
sdist.run(self)
|
||||
if os.path.exists('VERSION'):
|
||||
os.remove('VERSION')
|
||||
|
||||
def get_version():
|
||||
if os.path.exists('VERSION'):
|
||||
version_file = open('VERSION', 'r')
|
||||
version = version_file.read()
|
||||
version_file.close()
|
||||
return version
|
||||
if os.path.exists('.git'):
|
||||
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE)
|
||||
result = p.communicate()[0]
|
||||
if p.returncode == 0:
|
||||
version = result.split()[0][1:]
|
||||
version = version.replace('-', '.')
|
||||
return version
|
||||
return '0'
|
||||
|
||||
def data_tree(destdir, sourcedir):
|
||||
extensions = ['.css', '.png', '.jpeg', '.jpg', '.gif', '.xml', '.html', '.js']
|
||||
r = []
|
||||
for root, dirs, files in os.walk(sourcedir):
|
||||
l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]
|
||||
r.append((root.replace(sourcedir, destdir, 1), l))
|
||||
return r
|
||||
|
||||
# Please update tox.ini when modifying dependency version requirements
|
||||
install_requires = [
|
||||
'acme>={0}'.format(certbot_version),
|
||||
|
@ -43,7 +80,7 @@ haproxy_installer = 'certbot_haproxy.installer:HAProxyInstaller'
|
|||
|
||||
setup(
|
||||
name='certbot-haproxy',
|
||||
version=own_version,
|
||||
version=get_version(),
|
||||
description="HAProxy plugin for Certbot",
|
||||
long_description=long_description,
|
||||
url='https://code.greenhost.net/open/certbot-haproxy',
|
||||
|
@ -70,6 +107,7 @@ setup(
|
|||
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
data_files=data_tree('share/certbot-haproxy/docs/', 'docs/'),
|
||||
install_requires=install_requires,
|
||||
extras_require={
|
||||
'docs': docs_extras,
|
||||
|
@ -81,4 +119,7 @@ setup(
|
|||
],
|
||||
},
|
||||
# test_suite='certbot_haproxy',
|
||||
cmdclass={
|
||||
'sdist': eo_sdist,
|
||||
}
|
||||
)
|
||||
|
|
Reference in New Issue