certbot/tools
ohemorange 9ee4831f78
Make externally snapped plugin updates more stable (#8145)
Fixes #7863.

Connect command is `sudo snap connect certbot-dns-dnsimple:certbot-metadata certbot:certbot-metadata`
Logs are `cat /var/snap/certbot-dns-dnsimple/current/debuglog`
Echos in hook are only printed to terminal when it exits 0; otherwise, check logs in `debuglog` mentioned above.

Manual tests include all iterations of connected, unconnected, installed for the first, second time, etc, with passing and failing version checks.

* Make dnsimple not update if certbot is too old

* create an interface to read cb version

* add missing newline

* fix syntax

* trying to figure out the consumer syntax

* trying to figure out the consumer syntax, again

* only check post first install

* valid setting name

* test for first install differently

* snapctl doesn't error if it fails I guess

* time to do some print debugging

* continue playing with syntax

* once again, fooled by bash int vs string comparisons!

* debugging

* if we use post and pre together we can do this

* is this how content interface syntax works

* it's a directory?

* more debug

* what's that error message again?

* try other syntax

* if it's not documented just guess at syntax

* actually, I think this is the syntax

* oops didn't set for new hook

* test passing information along connection

* interface attributes can only be set during the execution of prepare hooks

* just do it with main connection

* undo last few test changes

* Add some printing to make sure we understand what's going on

* create empty directory to bind to

* put mkdir in the correct part

* let's inspect the environment

* it can't run bash directly.

* perhaps only directories can be shared via the contente interface

* update name of folder

* echo to debug log to understand what's going on exactly. we have file access though!

* update grep for new file

* more printing

* echo to the debug log

* ok NOW all print statements are going to the log

* why does echo need two >s

* remove unnecessary extra check, just check if the init file is available

* check if certbot version will be available post-refresh after all

* pre-refresh hook is not necessary to get certbot version

* update mkdir so we don't have to clean each time

* try comparing version numbers in python

* it's python3

* we need different prints for if we succeed or if we fail.

* improve bash syntax

* remove some debugging code

* Remove debug script

* remove spaces for clarity

* consolidate parts and remove more test code

* s/certbot-version/certbot-metadata/g

* use sys.exit instead of exit

* find and save certbot version on the certbot side

* change presence test to new file

* switch to using packaging.version.parse instead of LooseVersion

* switch to requiring certbot version >= plugin version

* add plugin snap changes to generate script

* Add comment to generation file saying not to edit generated files manually

* Create post-refresh hook for all plugins with script

* generate files using new script

* update snapcraft.yaml files for plugins

* bin/sh comes first

* Add packaging to install_requires

* Check that refresh is allowed in integration test

* switch plug and slot names in integration test

* Update tools/generate_dnsplugins_postrefreshhook.sh

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

* small bash fixes

* Update snap readme with new instructions

* Run tools/generate_dnsplugins_postrefreshhook.sh

* Update tools/snap/generate_dnsplugins_postrefreshhook.sh

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-07-22 17:07:07 -07:00
..
snap Make externally snapped plugin updates more stable (#8145) 2020-07-22 17:07:07 -07:00
_changelog_top.txt Remove list of modified packages from changelog. (#7146) 2019-06-11 14:02:54 -07:00
_release.sh Use Python 3 in the release script. (#7918) 2020-04-20 14:44:53 -07:00
_venv_common.py Fix TLS-ALPN tests with newer versions of OpenSSL (#8026) 2020-06-01 15:18:38 -07:00
deactivate.py Minor bugfixes (#7891) 2020-04-13 10:41:39 -07:00
dev_constraints.txt Update to IPython with Python 3.8 support. (#8152) 2020-07-17 13:01:04 -07:00
eff-pubkey.pem Add pubkey to tree 2016-03-01 11:21:51 -08:00
extract_changelog.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
half-sign.c Use SHA256 openssl signatures 2016-01-11 14:22:51 -08:00
install_and_test.py Remove letshelp-certbot (#7761) 2020-02-14 17:19:19 -08:00
merge_requirements.py Address review comments 2019-03-04 15:52:38 +02:00
offline-sigrequest.sh Don't require festival during signing. (#6079) 2018-06-07 11:43:45 +03:00
oldest_constraints.txt Update to IPython with Python 3.8 support. (#8152) 2020-07-17 13:01:04 -07:00
pip_install.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
pip_install_editable.py Add comment about pyca's use of tools script (#8044) 2020-06-08 12:14:02 -07:00
readlink.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
release.sh Release script improvements (#6337) 2018-09-05 14:10:05 -07:00
run_oldest_tests.sh Migrate the CI pipeline from Travis to Azure Pipeline (#8098) 2020-07-02 15:01:21 -07:00
simple_http_server.py Some improvements (#8132) 2020-07-06 16:04:59 -07:00
sphinx-quickstart.sh Don't display todo comments in docs (#7753) 2020-02-06 15:39:47 -08:00
strip_hashes.py Address review comments 2019-03-04 15:52:38 +02:00
venv.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
venv3.py Refactor certbot/ and certbot/tests/ to use the same structure as the other packages (#7544) 2019-11-25 14:28:05 -08:00