-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ venv/ | |
credentials.ini | ||
.idea | ||
*.iml | ||
*.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh -e | ||
# This file is based on tools/snap/generate_dnsplugins_postrefreshhook.sh of Certbot | ||
# get certbot version | ||
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then | ||
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" | ||
exit 0 | ||
fi | ||
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) | ||
|
||
# get required certbot version for plugin. certbot version must be at least the plugin's | ||
# version. note that this is not the required version in setup.py, but the version number itself. | ||
cb_required=$(grep -oP "cb_required = '\K.*(?=')" $SNAP/setup.py) | ||
|
||
|
||
$SNAP/bin/python3 -c "import sys; from packaging import version; sys.exit(1) if \ | ||
version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? | ||
if [ "$exit_code" -eq 1 ]; then | ||
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \ | ||
"this plugin can be updated; will try again on next refresh." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: certbot-dns-loopia | ||
summary: Loopia DNS authentication plugin for Certbot | ||
description: Loopia DNS authentication plugin for Certbot | ||
confinement: strict | ||
grade: stable | ||
base: core20 | ||
|
||
adopt-info: certbot-dns-loopia | ||
|
||
parts: | ||
certbot-dns-loopia: | ||
plugin: python | ||
source: . | ||
override-pull: | | ||
snapcraftctl pull | ||
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"` | ||
build-environment: | ||
- SNAP_BUILD: "True" | ||
|
||
certbot-metadata: | ||
plugin: dump | ||
source: . | ||
stage: [setup.py, certbot-shared] | ||
override-pull: | | ||
snapcraftctl pull | ||
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared | ||
slots: | ||
certbot: | ||
interface: content | ||
content: certbot-1 | ||
read: | ||
- $SNAP/lib/python3.8/site-packages | ||
|
||
plugs: | ||
certbot-metadata: | ||
interface: content | ||
content: metadata-1 | ||
target: $SNAP/certbot-shared |