mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 00:22:04 +02:00
snap: use snap REST API in certbot.wrapper (#8260)
In order to avoid potentially breaking changes in the snap CLI on the host, this commit changes certbot.wrapper to use the snap REST API (via curl and jq) to list connected Certbot plugins.
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ esac
|
|||||||
|
|
||||||
export CERTBOT_AUGEAS_PATH="${SNAP}/usr/lib/${ARCH_TRIPLET}/libaugeas.so.0"
|
export CERTBOT_AUGEAS_PATH="${SNAP}/usr/lib/${ARCH_TRIPLET}/libaugeas.so.0"
|
||||||
|
|
||||||
CERTBOT_PLUGIN_PATH="$(snap connections certbot | gawk 'BEGIN {ORS=""} NR>1 { if ($1 == "content[certbot-1]") { split($3,a,":"); PLUGINS=PLUGINS":/snap/"a[1]"/current/lib/python3.8/site-packages/"; next; } } END { print substr(PLUGINS, 2) }')"
|
CERTBOT_PLUGIN_PATH="$(curl -s --unix-socket /run/snapd.socket "http://localhost/v2/connections?snap=certbot&interface=content" | jq -r '.result.established | map(select(.plug.plug == "plugin" and ."plug-attrs".content == "certbot-1") | "/snap/"+.slot.snap+"/current/lib/python3.8/site-packages/" ) | join(":")')"
|
||||||
export CERTBOT_PLUGIN_PATH
|
export CERTBOT_PLUGIN_PATH
|
||||||
|
|
||||||
exec certbot "$@"
|
exec certbot "$@"
|
||||||
|
|||||||
+2
-1
@@ -72,7 +72,8 @@ parts:
|
|||||||
- python3-pkg-resources
|
- python3-pkg-resources
|
||||||
- python3.8-minimal
|
- python3.8-minimal
|
||||||
# added for certbot.wrapper script:
|
# added for certbot.wrapper script:
|
||||||
- gawk
|
- curl
|
||||||
|
- jq
|
||||||
# To build cryptography and cffi if needed
|
# To build cryptography and cffi if needed
|
||||||
build-packages: [gcc, libffi-dev, libssl-dev, git, libaugeas-dev, python3-dev]
|
build-packages: [gcc, libffi-dev, libssl-dev, git, libaugeas-dev, python3-dev]
|
||||||
build-environment:
|
build-environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user