From 21826684ea951274c2d63efc89b2b28f9d6395bc Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 20 Feb 2018 14:28:23 +0100 Subject: app-crypt/wile: 1.0.0-r1 with webroot fixed Related issue: https://github.com/costela/wile/issues/32 --- app-crypt/wile/files/wile-1.0.0-fix-webroot.patch | 39 +++++++++++++++++++++++ app-crypt/wile/wile-1.0.0-r1.ebuild | 36 +++++++++++++++++++++ app-crypt/wile/wile-1.0.0.ebuild | 33 ------------------- 3 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 app-crypt/wile/files/wile-1.0.0-fix-webroot.patch create mode 100644 app-crypt/wile/wile-1.0.0-r1.ebuild delete mode 100644 app-crypt/wile/wile-1.0.0.ebuild diff --git a/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch b/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch new file mode 100644 index 0000000..39c9d30 --- /dev/null +++ b/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch @@ -0,0 +1,39 @@ +From f6d355f14363ed3ce6bf44d4d9ab3140bc0ec247 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Mon, 19 Feb 2018 20:21:24 +0100 +Subject: [PATCH] Fix storing of webroot validation for local folders (issue + #32) + +Function os.open was used with the signature of __builtin__.open. +So string mode "wb" ended up as the flags parameter to os.open, +resulting in "TypeError: an integer is required". +--- + wile/cert.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/wile/cert.py b/wile/cert.py +index c9fc33b..f8b85aa 100644 +--- a/wile/cert.py ++++ b/wile/cert.py +@@ -262,6 +262,7 @@ def _store_webroot_validation(ctx, webroot, ssh_private_key, challb, val): + raise + + chall_mod = os ++ chall_open = open + else: + sftp = sftp_helper.cachedSFTPfactory(user=webroot.remote_user, host=webroot.remote_host, + port=webroot.remote_port, private_key=ssh_private_key) +@@ -269,8 +270,9 @@ def _store_webroot_validation(ctx, webroot, ssh_private_key, challb, val): + sftp.makedirs(os.path.join(webroot.path, challb.URI_ROOT_PATH)) + + chall_mod = sftp ++ chall_open = chall_mod.open + +- with chall_mod.open(chall_path, 'wb') as outf: ++ with chall_open(chall_path, 'wb') as outf: + logger.info('storing validation to %s', os.path.basename(chall_path)) + outf.write(b(val)) + # TODO: this may cause a race-condition with paramiko teardown code. +-- +2.16.1 + diff --git a/app-crypt/wile/wile-1.0.0-r1.ebuild b/app-crypt/wile/wile-1.0.0-r1.ebuild new file mode 100644 index 0000000..aabfe2c --- /dev/null +++ b/app-crypt/wile/wile-1.0.0-r1.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit distutils-r1 + +DESCRIPTION="Stripped down letsencrypt (ACME) client" +HOMEPAGE="https://github.com/costela/wile" +SRC_URI="https://github.com/costela/wile/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=" + dev-python/setuptools_scm[${PYTHON_USEDEP}] + " +RDEPEND=" + >=app-crypt/acme-0.21[${PYTHON_USEDEP}] + dev-python/josepy[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] + dev-python/click[${PYTHON_USEDEP}] + dev-python/pyopenssl[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/paramiko[${PYTHON_USEDEP}] + " + +DOCS=( README.md ) + +PATCHES=( + "${FILESDIR}"/${P}-josepy.patch + "${FILESDIR}"/${P}-fix-webroot.patch +) diff --git a/app-crypt/wile/wile-1.0.0.ebuild b/app-crypt/wile/wile-1.0.0.ebuild deleted file mode 100644 index b579a01..0000000 --- a/app-crypt/wile/wile-1.0.0.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -PYTHON_COMPAT=( python2_7 ) -inherit distutils-r1 - -DESCRIPTION="Stripped down letsencrypt (ACME) client" -HOMEPAGE="https://github.com/costela/wile" -SRC_URI="https://github.com/costela/wile/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND=" - dev-python/setuptools_scm[${PYTHON_USEDEP}] - " -RDEPEND=" - >=app-crypt/acme-0.21[${PYTHON_USEDEP}] - dev-python/josepy[${PYTHON_USEDEP}] - dev-python/six[${PYTHON_USEDEP}] - dev-python/click[${PYTHON_USEDEP}] - dev-python/pyopenssl[${PYTHON_USEDEP}] - dev-python/cryptography[${PYTHON_USEDEP}] - dev-python/paramiko[${PYTHON_USEDEP}] - " - -DOCS=( README.md ) - -PATCHES=( "${FILESDIR}"/${P}-josepy.patch ) -- cgit v1.2.3-65-gdbad