mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:14:21 +02:00
Make Certbot find externally snapped plugins (#8054)
* Add snap plugin support Switch to a PoC branch of certbot that supports the new CERTBOT_PLUGIN_PATH and wrap the snap to set this variable correctly based on the content interfaces connected. (cherry picked from commit 7076a55fd82116d068e2aca7239209b7203917d2) * Modify certbot.wrapper to append to PYTHONPATH instead of separate CERTBOT_PLUGIN_PATH variable * Update certbot-wrapper to python3.6 version * add source field * Update changelog * Use bash instead of sh Co-authored-by: Brad Warren <bmw@users.noreply.github.com> * Exit if something goes wrong Co-authored-by: Brad Warren <bmw@users.noreply.github.com> * No leading : when modifying empty PYTHONPATH * Improve bash handling of PYTHONPATH manipulation Co-authored-by: Robie Basak <robie.basak@canonical.com> Co-authored-by: Brad Warren <bmw@eff.org> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
This commit is contained in:
co-authored by
Brad Warren
Robie Basak
Brad Warren
parent
50fa04ba0c
commit
8d776fb7ac
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
join() {
|
||||
sep=$1
|
||||
first=$2
|
||||
if [ "$first" != "" ]; then
|
||||
shift 2
|
||||
echo -n "${first}"
|
||||
for item in "$@"; do echo -n "${sep}${item}"; done
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
paths=$(for plugin_snap in $(snap connections certbot|sed -n '2,$p'|awk '$1=="content[certbot-1]"{print $3}'|cut -d: -f1); do echo /snap/$plugin_snap/current/lib/python3.6/site-packages; done)
|
||||
export PYTHONPATH=$(join : $PYTHONPATH $paths)
|
||||
if [ -z "$PYTHONPATH" ]; then
|
||||
unset PYTHONPATH
|
||||
fi
|
||||
exec certbot "$@"
|
||||
Reference in New Issue
Block a user