52 Commits

Author SHA1 Message Date
ohemorange
885ebf80e3 Change snapcraft authentication to use SNAPCRAFT_STORE_CREDENTIALS (#9326)
* try the easy thing of just doing what the error message says

* temporarily add deploy stage to extended tests to see if it uploads properly

* follow instructions on https://forum.snapcraft.io/t/snapcraft-authentication-options/30473

* just run the packaging jobs for speed

* fix formatting

* import changes from test- branch and revert temporary changes

* Update instructions in deploy-stage.yml
2022-06-20 06:37:40 +10:00
Brad Warren
7dd1e814fb Ignore parallel coverage files (#9293)
* ignore parallel coverage files

* Properly shutdown & close HTTP server
2022-05-07 13:31:59 +10:00
Brad Warren
dd0e590de3 Make a test farm tests package (#8821)
Fixes https://github.com/certbot/certbot/issues/8781.

This PR makes our test farm tests into a normal package so it and its dependencies can be tracked and installed like our other packages.

Other noteworthy changes in this PR:

* Rather than continuing to place logs in your CWD, they're placed in a temporary directory that is printed to the terminal.
*  `tests/letstest/auto_targets.yaml` was deleted rather than renamed because the file is no longer used.

* make a letstest package

* remove deleted deps

* fix letstest install

* add __init__.py

* call main

* Explicitly mention activating venv

* rerename file

* fix version.py path

* clarify "this"

* Use >= instead of caret requirement
2021-05-03 17:42:30 -07:00
ohemorange
f339d23e54 Remove further references to certbot-auto in the repo (#8814)
* Move version.py to tests/letstest since it's used by test_sdists.sh

* Delete unused components of certbot-auto

* Remove test_leauto_upgrades.sh and references to it

* Remove test_letsencrypt_auto_certonly_standalone.sh and references to it

* Remove outstanding references to certbot-auto

* Remove references to letsencrypt-auto

* find certbot in the correct directory

* delete letsencrypt-auto-source line from .isort.cfg since that directory no longer contains any python code

* remove (-auto) from certbot(-auto)

* delete line from test

* Improve style for version.py
2021-04-27 15:27:21 -07:00
Brad Warren
ac3edc2c1d don't ignore kgs (#8811) 2021-04-26 15:47:49 -07:00
Brad Warren
f4fc3e636d Redo the majority of Certbot's pinning system (#8741)
* add initial pyproject.toml

* add extra dependencies

* add simple bash script

* polish

* reuse pipstrap

* add requirements.txt

* temporarily remove hashin dep

* Switch to requirements.txt

* remove hashin check

* update requirements.txt again

* remove unnecessary merge

* pin back augeas

* unpin cryptography

* simplify pywin32 pinning

* update comment

* pin back pytest and pylint

* pin back pytest-forked

* pin back coverage

* update script comments

* fix pyopenssl case

* add minimum poetry version

* run pin.sh
2021-03-26 07:51:59 +01:00
Brad Warren
e570e8ad32 Generate plugin snap configs as needed (#8411)
While reviewing https://github.com/certbot/certbot/pull/8404, it occurred to me that we're keeping both the generated files and the script used to generate them in `git`. Keeping both around seems unnecessary and is almost asking for the files to get out of sync at some point in the future. I fixed that by removing the files, adding them to `.gitignore`, and updating `build_remote.py` to generate them as needed.

* Remove generated files.

* Add generated files to gitignore.

* Reuse generate_dnsplugins_all.sh in build_remote
2020-10-30 14:12:57 -07:00
Brad Warren
ef8c481634 Add snap log files to gitignore. (#8336) 2020-10-01 14:44:12 +02:00
Adrien Ferrand
9ac476e87b Certbot snap multiarch build (#8016)
This PR proposes a way to build the certbot snap for several architectures, using a QEMU-base emulation approach, and several optimizations to keep the build time of each snap below 20 minutes.

Most of the reasoning for the approach proposed here is described in the original PR: https://github.com/basak/certbot-snap-build/pull/27

On top of it, I added a docker pull to a pre-compiled snapcraft docker, instead of compiling it during the Travis pipeline, in order to save 5 to 7 minutes more on each snap build. The snap images are compiled and stored here: https://hub.docker.com/repository/docker/adferrand/snapcraft. Depending on the time the PR will be reviewed, we can:
* continue to use `adferrand/snapcraft`
* move its logic to certbot scope and use something like `certbot/snapcraft`
* wait for https://github.com/snapcore/snapcraft/pull/3144 to be merged, and use `snapcore/snapcraft`.

* Backport https://github.com/basak/certbot-snap-build/pull/27 into Certbot project

* Fix build deps

* Integrate proactively #8012 to fix builds on non-amd64 archs

* Configure jobs on Travis

* Focus on snap builds. Disable temporarily some jobs. Disable deploy actions by security.

* Specify TARGET_ARCH during snap build

* Do not do anything if TOXENV is not set

* Various optimizations

* Use recent version of ubuntu for get correct features on snap out of the box

* Add up to date wheels

* Organizing scripts

* Set dest dir

* Get back original configuration for Travis

* Add comments

* Update common_libs.sh

* Use adferrand/snapcraft

* Test build

* Stable snapcraft

* Update build_and_install.sh

* Move back snap builds to the cron/release pipeline

* Update snap/local/compile_native_wheels.sh

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

* Update snap/local/compile_native_wheels.sh

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

* Update snap/local/compile_native_wheels.sh

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

* Update snap/local/build_and_install.sh

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

* Enable i386 builds, various optimizations

* Update dependencies

* Configure a simple http server to serve the pre compiled wheels

* Fix wheels compilation

* Relax permissions

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-06-10 14:33:02 -07:00
Brad Warren
335894ab3b Merge snap code into the Certbot repo
* merge .gitignore

* Move snapcraft.yml up one level.

* update source

* move test.sh to tox.ini

* use new tox.ini in .travis.yml

* move snap build code

* make script executable

* remove unused python3-dev

* don't use deprecated classic flag

* go back to stable channel

* add nginx in snap addons

* add deploy steps

* Add comments explaining external tox envs.

* error if not in CI

* don't use --depth

* remove old .travis.yml

* Add big comment about SNAP_TOKEN.

* Set all_branches: true.

* Add repo setting.

* run travis on tags

* Add more documenting comments to .travis.yml.
2020-04-24 13:47:36 -07:00
ohemorange
316e4640f8 Upgrade the test farm tests to use Python 3 (#7876)
Fixes #7857.

* stop using urllib2 in test farm tests

* use six for urllib instead

* remove fabric lcd usage

* correct lcd removal

* remove fabric cd

* convert some remote calls to v2

* move more cxns to v2

* get run working with prefix

* get sudo commands working

* remove final fabric v1 references including local

* update requirements and README

* add new venv to gitignore

* update version used in travis

* remove deploy_script unused kwargs

* fix killboulder implementation so I can test creating a new boulder server

* hardcode the gopath due to broken env manamagement in fabric2

* Update letstest readme

* move the comment about hardcoding the ggopath

* catch BaseException instead of Exception

* work around fabric #2007

* use connections as context managers to ensure they're closed

* remove reference to virtualenv
2020-04-09 14:35:47 -07:00
Adrien Ferrand
e84ed49c56 Fix certbot-auto regarding python 3.4 -> python 3.6 migration for CentOS 6 users (#7519)
* Revert "Add back Python 3.4 support (#7510)"

This reverts commit 9b848b1d65.

* Fix certbot-auto

* Use a more consistent way to enable rh-python36

* Avoid to call CompareVersions unecessarily

* Control rh-python36 exit code

* Fix travis config

* Remove vscode config

* Ignore vscode

* Fix merge conflicts regarding #7587 (#70)

* Add changelog entry

* Finish sentence

* Update certbot/CHANGELOG.md

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update letsencrypt-auto-source/tests/centos6_tests.sh

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update letsencrypt-auto-source/tests/centos6_tests.sh

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update letsencrypt-auto-source/tests/centos6_tests.sh

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update letsencrypt-auto-source/tests/centos6_tests.sh

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update letsencrypt-auto-source/tests/centos6_tests.sh

Co-Authored-By: Joona Hoikkala <joohoi@users.noreply.github.com>

* Update comments

* Improve warning message

* Update changelog

Co-authored-by: Joona Hoikkala <joohoi@users.noreply.github.com>
2020-01-13 09:24:41 +01:00
Adrien Ferrand
2ac99fefe0 [Windows|Linux] Launch integration tests on Pebble without Docker (#7157)
This PR is a part of the actions necessary to make Certbot-CI work on Windows, in order to execute the integration tests on this platform.

Following #7156, this PR changes how the integration tests are setup against Pebble to not need Docker anymore.

As a reminder, one can check #7156 and letsencrypt/pebble#240 to see the rationale about why using Docker is a problem to run the integration tests on Windows.

Basically, this PR executes directly Pebble using its executable, since it is build using Go, and Go produces self-contained executable that can run without any installation on Linux and on Windows. During the integration tests setup, Certbot-CI will get the Pebble (and Challtestsrv) executables for the defined target version on the GitHub releases. The binaries are persisted on the filesystem, so it is not needed to download them again on the second integration tests execution. Nonetheless, we are talking about 20MB of executables.

Since the setup needs to hold a state, I also took this occasion to refactor the acme_server, in order to use on object oriented approach and improve the readability/maintainability.

Once this PR and #7156 are merged, Docker will not be needed anymore for the main integration tests usecase, that is to use Pebble.

* Complete process

* Fix nginx cert path

* Check conditionnally docker

* Update gitignore, fix apacheconftest

* Full object

* Carriage return

* Move to official v2.1.0 of pebble

* Fix name

* Update acme_server.py

* Relaunch CI

* Update certbot-ci/certbot_integration_tests/utils/acme_server.py

Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>

* Update certbot-ci/certbot_integration_tests/utils/acme_server.py

Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>

* Update docstring

* Update documentation

* Configure a stdout to ACMEServer

* Map all process through defined stdout

* Remove unused variable

* Handle using signals

* Use failsafe entering context

* Remove failsafe rmtree, that is not needed anymore
2019-07-10 14:29:57 -07:00
Adrien Ferrand
e394889864 Add executable scripts to start certbot and acme server in certbot-ci (#7073)
During review of #6989, we saw that some of our test bash scripts were still used in the Boulder project in particular. It is about `tests/integration/_common.sh` in particular, to expose the `certbot_test` bash function,  that is an appropriate way to execute a local version of certbot in test mode: define a custom server, remove several checks, full log and so on.

This PR is an attempt to assert this goal: exposing a new `certbot_test` executable for test purpose. More generally, this PR is about giving well suited scripts to quickly make manual tests against certbot without launching the full automated pytest suite.

The idea here is to leverage the existing logic in certbot-ci, and expose it as executable scripts. This is done thanks to the `console_scripts` entry of setuptools entrypoint feature, that install scripts in the `PATH`, when `pip install` is invoked, that delegate to specific functions in the installed packages.

Two scripts are defined this way:
* `certbot_test`: it executes certbot in test mode in a very similar way than the original `certbot_test` in `_common.sh`, by delegating to `certbot_integration_tests.utils.certbot_call:main`. By default this execution will target a pebble directory url started locally. The url, and also http-01/tls-alpn-01 challenge ports can be configured using ad-hoc environment variables. All arguments passed to `certbot_test` are transferred to the underlying certbot command.
* `acme_server`: it set up a fully running instance of an ACME server, ready for tests (in particular, all FQDN resolves to localhost in order to target a locally running `certbot_test` command) by delegating to `certbot_integration_tests.utils.acme_server:main`. The choice of the ACME server is given by the first parameter passed to `acme_server`, it can be `pebble`, `boulder-v1` or `boulder-v2`. The command keeps running on foreground, displaying the logs of the ACME server on stdout/stderr. The server is shut down and resources cleaned upon entering CTRL+C.

This two commands can be run also through the underlying python modules, that are executable.

Finally, a typical workflow on certbot side to run manual tests would be:
```
cd certbot
tools/venv.py
source venv/bin/activate
acme_server pebble &
certbot_test certonly --standalone -d test.example.com
```

On boulder side it could be:
```
# Follow certbot dev environment setup instructions, then ...
cd boulder
docker-compose run --use-aliases -e FAKE_DNS=172.17.0.1 --service-ports boulder ./start.py
SERVER=http://localhost:4001/directory certbot_test certonly --standalone -d test.example.com
```

* Configure certbot-ci to expose a certbot_test console script calling certbot in test mode against a local pebble instance

* Add a command to start pebble/boulder

* Use explicit start

* Add execution permission to acme_server

* Add a docstring to certbot_test function

* Change executable name

* Increase sleep to 3600s

* Implement a context manager to handle the acme server

* Add certbot_test workspace in .gitignore

* Add documentation

* Remove one function in context, split logic of certbot_test towards capturing non capturing

* Use an explicit an properly configured ACMEServer as handler.

* Add doc. Put constants.
2019-06-12 17:19:23 -07:00
ohemorange
05ad539255 git ignore pytest cache (#6340) 2018-09-05 18:05:48 -07:00
Brad Warren
e178bbfdf5 Release script improvements (#6337)
* Add error checking and automatic logging.

* Ignore release dir and logs

* Don't always require PGP card and fix script cmd.

* keep track of default GPG key

* Add PGP card sanity check after offline signature

* fix typo

* I'm tired of pressing y.

* Automate running tools/offline-sigrequest.sh.

* Update comment and make output more readable.
2018-09-05 14:10:05 -07:00
ohemorange
2d31598484 Get mypy tox env running in the current setup (#5861)
* get mypy tox env running in the current setup

* use any python3 with mypy

* pin mypy dependencies
2018-04-12 15:47:39 -07:00
Brad Warren
49edf17cb7 ignore .docker (#5477) 2018-02-13 09:52:04 -08:00
Joona Hoikkala
a1713c0b79 Broader git ignore for pytest cache files (#5361)
Make gitignore take pytest cache directories in to account, even if
they reside in subdirectories.

If pytest is run for a certain module, ie. `pytest certbot-apache` the
cache directory is created under `certbot-apache` directory.
2018-01-05 11:08:38 -08:00
Brad Warren
5388842e5b Fix pytest on macOS in Travis (#5360)
* Add tools/pytest.sh

* pass TRAVIS through in tox.ini

* Use tools/pytest.sh to run pytest

* Add quiet to pytest.ini

* ignore pytest cache
2018-01-03 17:49:22 -08:00
Blake Griffith
49d46ef99a Impelment account deactivation [revision requested] (#3571)
Impelment account deactivation
2017-01-17 16:00:07 -08:00
Joona Hoikkala
b65ea31b42 Add rope directory to gitignore (#3554)
* Ignore .ropeproject
2016-09-28 10:42:00 -07:00
Jacob Hoffman-Andrews
cb9921f4b1 Add more ignored files to gitignore. 2016-08-10 11:14:39 -07:00
Brad Warren
ae6f1c62f1 Rename misc files 2016-04-14 10:20:23 -07:00
Brad Warren
4a17294654 Remove sigfileball and add it to gitignore 2016-03-10 13:35:06 -08:00
Brad Warren
f1bfbadbdb Don't track releases folder 2016-03-01 11:21:40 -08:00
Brad Warren
113774746d Ignore venv in letstest dir 2016-02-02 13:44:44 -08:00
Brad Warren
4156d1cecc Ignore log directories and key files 2015-12-23 12:28:57 -05:00
Jakub Warmuz
3c08b512c3 Simple dev release script 2015-09-27 16:12:50 +00:00
Jakub Warmuz
96f12fe668 Gitignore /.tox/ 2015-07-17 08:10:49 +00:00
Jakub Warmuz
7f46e69454 Update ignore files to remove shared tox.venv 2015-07-12 15:30:51 +00:00
Jakub Warmuz
a876a664df Add py3 tox tests for acme.jose 2015-07-12 11:37:56 +00:00
Jakub Warmuz
db1e078c06 Shared tox envdir 2015-07-10 16:40:46 +00:00
Brad Warren
13913fd8e0 Added traceback dump 2015-06-30 12:57:51 -07:00
James Kasten
5027d70002 Ignore pycharm project files 2015-06-26 09:30:10 -07:00
Jakub Warmuz
e51f300ee6 Merge remote-tracking branch 'github/letsencrypt/master' into csr
Conflicts:
	letsencrypt/cli.py
	letsencrypt/client.py
	letsencrypt/tests/client_test.py
2015-06-25 13:36:41 +00:00
Jakub Warmuz
d3ad5f8b56 gitignore: +htmlcov, -m3, reorg 2015-06-02 10:41:33 +00:00
Jakub Warmuz
b76e8b6c41 Revert "Update unit tests for determine_authenticator"
This reverts commit 79f5ebe734.
2015-04-22 09:02:39 +00:00
yan
995b5622f8 Fix most pylint errors 2015-04-17 22:24:19 -07:00
Garrett Robinson
79f5ebe734 Update unit tests for determine_authenticator
The last commit refactored determine_authenticator to take a mapping of
authenticator names to authenticators instead of a list of
authenticators. This commit updates the existing unit tests to work with
this refactor.
2015-04-09 15:46:19 -07:00
Garrett Robinson
73824c859a Ignore emacs autosave files 2015-04-09 15:45:18 -07:00
James Kasten
ce2a6b7c5a Merge branch 'restification'
Conflicts:
	.gitignore
	CONTRIBUTING.rst
2015-03-21 14:03:36 -07:00
Garrett Robinson
5eb007cc31 Add Vagrantfile, document use
* Adds workaround to setup.py for issue with Vagrant sync filesystem and
  hard linking (used by distutils in Python < 2.7.9). This workaround is
  only used in a Vagrant environment.
* Adds Vagrant-related files to .gitignore
2015-03-21 12:51:33 -07:00
William Budington
75e4e5d48b Gitignore .swp for vim 2015-03-20 20:56:44 +00:00
Jakub Warmuz
d40a7acf8a gitignore: .coverage is a file 2014-11-27 22:49:15 +01:00
Jakub Warmuz
93291feb58 Ignore .coverage 2014-11-27 20:57:24 +01:00
Jakub Warmuz
300a4f0b45 Use tox for tests 2014-11-22 15:04:36 +01:00
Jakub Warmuz
3ce1679717 Virtualenv setup. Fixes $41. 2014-11-21 17:45:13 +01:00
Jakub Warmuz
8dc8ceca2d gitignore setuptools artifacts 2014-11-19 13:29:02 +01:00
James Kasten
d3708e1e79 Remove trustify/attic related code from setup.py
Conflicts:
	.gitignore
	setup.py
2014-11-18 18:39:39 -08:00