From 7ddca1a7d101f043c92bcc727cf4767c0982c3dd Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Sat, 7 Jan 2023 08:27:34 -0800 Subject: [PATCH 1/3] ci: use requirements.txt to manage certbot/cryptography versions --- iot-certbot/Dockerfile | 6 +-- iot-certbot/build.yaml | 4 +- iot-certbot/requirements.in | 3 ++ iot-certbot/requirements.txt | 85 ++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 iot-certbot/requirements.in create mode 100644 iot-certbot/requirements.txt diff --git a/iot-certbot/Dockerfile b/iot-certbot/Dockerfile index 3a39bbb..ab3d7dc 100755 --- a/iot-certbot/Dockerfile +++ b/iot-certbot/Dockerfile @@ -7,6 +7,8 @@ ARG \ CRYPTOGRAPHY_VERSION \ CERTBOT_VERSION +COPY requirements.txt /build/requirements.txt + # py3-pip is kept in the installation because otherwise it removes some dependencies # that we need (six) RUN apk add --no-cache --update \ @@ -28,9 +30,7 @@ RUN apk add --no-cache --virtual .build-dependencies \ RUN python3 -mvenv /opt/certbot RUN /opt/certbot/bin/python -mpip install --no-cache-dir --find-links \ "https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \ - cryptography==${CRYPTOGRAPHY_VERSION} \ - certbot==${CERTBOT_VERSION} \ - certbot-dns-route53==${CERTBOT_VERSION} + -r /build/requirements.txt FROM $BUILD_FROM diff --git a/iot-certbot/build.yaml b/iot-certbot/build.yaml index 2d6ea80..258549a 100644 --- a/iot-certbot/build.yaml +++ b/iot-certbot/build.yaml @@ -10,6 +10,4 @@ labels: org.opencontainers.image.description: "Use AWS IOT and LetsEncrpyt for DNS challenge certs" org.opencontainers.image.source: "https://github.com/offbyone/homeassistant-addons" org.opencontainers.image.licenses: "BSD" -args: - CRYPTOGRAPHY_VERSION: 41.0.5 - CERTBOT_VERSION: 2.7.4 +args: {} diff --git a/iot-certbot/requirements.in b/iot-certbot/requirements.in new file mode 100644 index 0000000..d863b95 --- /dev/null +++ b/iot-certbot/requirements.in @@ -0,0 +1,3 @@ +cryptography>=41.0.5 +certbot>=2.7.4 +certbot-dns-route53>=2.1 diff --git a/iot-certbot/requirements.txt b/iot-certbot/requirements.txt new file mode 100644 index 0000000..b0fa872 --- /dev/null +++ b/iot-certbot/requirements.txt @@ -0,0 +1,85 @@ +# +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: +# +# pip-compile --no-emit-index-url --no-emit-trusted-host requirements.in +# +acme==2.1.0 + # via + # certbot + # certbot-dns-route53 +boto3==1.26.45 + # via certbot-dns-route53 +botocore==1.29.45 + # via + # boto3 + # s3transfer +certbot==2.1.0 + # via + # -r requirements.in + # certbot-dns-route53 +certbot-dns-route53==2.1.0 + # via -r requirements.in +certifi==2022.12.7 + # via requests +cffi==1.15.1 + # via cryptography +charset-normalizer==2.1.1 + # via requests +configargparse==1.5.3 + # via certbot +configobj==5.0.6 + # via certbot +cryptography==39.0.0 + # via + # -r requirements.in + # acme + # certbot + # josepy + # pyopenssl +distro==1.8.0 + # via certbot +idna==3.4 + # via requests +jmespath==1.0.1 + # via + # boto3 + # botocore +josepy==1.13.0 + # via + # acme + # certbot +parsedatetime==2.6 + # via certbot +pycparser==2.21 + # via cffi +pyopenssl==23.0.0 + # via + # acme + # josepy +pyrfc3339==1.1 + # via + # acme + # certbot +python-dateutil==2.8.2 + # via botocore +pytz==2022.7 + # via + # acme + # certbot + # pyrfc3339 +requests==2.28.1 + # via acme +s3transfer==0.6.0 + # via boto3 +six==1.16.0 + # via + # configobj + # python-dateutil +urllib3==1.26.13 + # via + # botocore + # requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools From d009417c25272f29c204b3d20d17bb293b7d6385 Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Sat, 7 Jan 2023 08:34:48 -0800 Subject: [PATCH 2/3] dev: also monitor requirements.txt and build the addon if that changes --- .github/workflows/builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 16c8799..d0c7406 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -2,7 +2,7 @@ name: Builder env: BUILD_ARGS: "--test" - MONITORED_FILES: "build.yaml config.yaml Dockerfile rootfs" + MONITORED_FILES: "build.yaml config.yaml Dockerfile requirements.txt rootfs" on: push: From 9126ed13050d95501bb41dd76823ca1f9c1491d5 Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Mon, 13 Nov 2023 17:34:57 -0800 Subject: [PATCH 3/3] Remove the args: entry in build.yml entirely --- iot-certbot/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/iot-certbot/build.yaml b/iot-certbot/build.yaml index 258549a..0ad73b2 100644 --- a/iot-certbot/build.yaml +++ b/iot-certbot/build.yaml @@ -10,4 +10,3 @@ labels: org.opencontainers.image.description: "Use AWS IOT and LetsEncrpyt for DNS challenge certs" org.opencontainers.image.source: "https://github.com/offbyone/homeassistant-addons" org.opencontainers.image.licenses: "BSD" -args: {}