27 Commits
Author SHA1 Message Date
Dmitry FigolandBrad Warren 36dfd06503 Prepare certbot module for mypy check untyped defs (#6005)
* Prepare certbot module for mypy check untyped defs

* Fix #5952

* Bump mypy to version 0.600 and fix associated bugs

* Fix pylint bugs after introducing mypy

* Implement Brad's suggestions

* Reenabling pylint and adding nginx mypy back
2018-05-18 06:28:17 -07:00
Brad WarrenandGitHub 356471cdf6 Add hook directories (#5151)
* Add hook dir constants

* Add hook dir properties to configuration

* test hook dir properties

* reuse certbot.util.is_exe

* Add certbot.hooks.list_hooks

* test list_hooks

* Run pre-hooks in directory

* Run deploy-hooks in directory

* Run post-hooks in directory

* Refactor and update certbot/tests/hook_test.py

* Add integration tests for hook directories

* Have Certbot create hook directories.

* document renewal hook directories

* Add --no-directory-hooks

* Make minor note about locale independent sorting
2017-10-03 13:52:02 -07:00
Brad Warren e94ee31a6f add hooks.deploy_hook 2017-06-30 10:24:00 -04:00
FabianandBrad Warren 2680879068 Print stdout when running a hook (#4167, #4487) (#4702) 2017-05-22 13:00:44 -07:00
dokazakiandBrad Warren 8011fb2879 Add mypy (#4386)
* Initial configuration of mypy in box, correction of base mypy errors.

* Move mypy install to toe

* Add pylint comments for typing imports.

* Remove typing module for Python 2.6 compatibility.
2017-03-18 19:10:10 -07:00
Alex BowersandBrad Warren 80326511bb Improve error reporting for hooks (#4235)
* Improve error reporting for hooks

* My bad

* Whitespace.
2017-03-03 10:28:05 -08:00
Brad WarrenandGitHub dc16013abe Correctly report when we skip hooks during renewal (#3977)
* Remove incorrect hook message

* Add generalized msg about skipping hooks

* Properly report when hooks were skipped

* Also print message about renew hook

* Change quotes to help OCD
2017-01-05 19:47:10 -05:00
Brad Warren dae9eee7d4 bool(len([])) == bool([]) 2017-01-04 12:58:59 -08:00
Brad Warren 458c7c8131 Use a set for pre_hook.already 2017-01-04 12:57:54 -08:00
Brad Warren d08cf89ad2 Remove all calls to which 2017-01-04 12:54:51 -08:00
Brad Warren 42b0188519 Merge branch 'master' into save-more-hooks 2017-01-04 12:24:53 -08:00
Brad WarrenandGitHub 39f5551305 Merge the manual and script plugins (#3890)
* Start of combined manual/script plugin

* Return str from hooks.execute, not bytes

* finish manual/script rewrite

* delete old manual and script plugins

* manually specify we want chall.token

* use consistent quotes

* specify chall for uri

* s/script/hook

* fix spacing on instructions

* remove unneeded response argument

* make achall more helpful

* simplify perform

* remove old test files

* add start of manual_tests

* fix ParseTest.test_help

* stop using manual_test_mode in cli tests

* Revert "make achall more helpful"

This reverts commit 54b01cea30.

* use bad response/validation methods on achalls

* simplify perform and cleanup environment

* finish manual tests

* Add HTTP manual hook integration test

* add manual http scripts

* Add manual DNS script integration test

* remove references to the script plugin

* they're hooks, not scripts

* add --manual-public-ip-logging-ok to integration tests

* use --pref-chall for dns integration

* does dns work?

* validate hooks

* test hook validation

* Revert "does dns work?"

This reverts commit 1224cc2961.

* busy wait in manual-http-auth

* remove DNS script test for now

* Fix challenge prefix and add trailing .

* Add comment about universal_newlines

* Fix typo from 0464ba2c4

* fix nits and typos

* Generalize HookCOmmandNotFound error

* Add verify_exe_exists

* Don't duplicate code in hooks.py

* Revert changes to hooks.py

* Use consistent hook error messages
2016-12-22 08:24:08 -08:00
Peter Eckersley ac17f98b0c Refactor post_hook storage during "renew" 2016-12-21 23:02:27 -08:00
Peter Eckersley 186a8c888f Path surgery makes sense for hooks that may be called from cron 2016-12-17 15:02:13 -08:00
Peter Eckersley 64daefea6b util.exe_exists and hooks._which were almost identical; merge them 2016-12-17 15:02:10 -08:00
Peter Eckersley de77dd74ad Unbreak repeated insertion logic 2016-12-15 17:31:32 -08:00
Peter Eckersley 33de782fba Make post hooks run in deterministic order 2016-12-15 17:28:16 -08:00
Peter Eckersley 0c2dc60484 Integration tests for hooks 2016-12-15 17:28:16 -08:00
Peter Eckersley 6f9abde894 Support intricate combinations of pre-hooks in different lineages 2016-12-15 17:28:16 -08:00
Peter Eckersley 0bea6c7350 Log when we run renew hooks (why weren't we doing this already?) 2016-12-15 17:28:16 -08:00
Peter Eckersley 876a760a91 Begin implementing pre / post-hook preservation 2016-12-15 17:28:16 -08:00
Joona HoikkalaandPeter Eckersley d741e684d0 Script plugin (#3521)
* Script plugin initial commit

* Fix auth script path

* Return correct responses

* Added DNS-01 support

* Report the challenge pref correctly

* Use config root from certbot constants rather than hardcoded

* Remove prehook and rename posthook to cleanup for clarity

* Refactoring

* Docs

* Refactoring

* Refactoring continued, working now

* Use global preferred-challenges argument in favor of local

* Added http-01 as fallback challenge if not defined

* Do not continue if auth script not defined

* Skip unnecessary steps when running

* Read config values from correct places

* Tests and minor fixes

* Make Python 2.6 happy again

* Added CERTBOT_AUTH_OUTPUT and better tests

* Lint & Py3 fixes

* Make Python 2.6 happy again

* Doc changes

* Refactor hook execute and reuse in script plugin

* Refactored hook validation

* Added long_description for plugin help text

* Refactored env var writing
2016-11-07 15:22:48 -08:00
Ville Skyttä c7b89c334b Use logger.warning instead of deprecated warn 2016-07-22 09:54:28 +03:00
Peter Eckersley 0294db7061 Merge pull request #2992 from certbot/post-hook
Only run post-hook if pre-hook was (or would have been, if it existed)
2016-05-18 16:31:00 -07:00
Marius Gedminas 321a806b91 Hook validation: skip leading spaces/newlines
Improves the situation with #3020 a bit.

Does nothing about other valid shell commands that the current
validation would reject:

  - shell builtins like --post-hook 'if [ -x /my/script ]; then /my/script; fi'
  - variable assignments like --post-hook 'ENV_VAR=value command'
  - comments
  - redirections like --post-hook '<infile command'
  - I'm sure I'm missing many other exciting possibilities
2016-05-18 11:57:50 +03:00
Peter Eckersley f4103bdbb3 post-hook only runs if pre-hook was (or would have been, if it existed) 2016-05-13 18:49:01 -07:00
Brad Warren 3961b70deb s/letsencrypt/certbot 2016-04-13 16:03:59 -07:00