Commit Graph
91 Commits
Author SHA1 Message Date
Erik Rose d85883d55a Add 2.6 dependencies that were missing from le-auto. Fix #2334.
ConfigArgParse has a conditional dependency for Pythons < 2.7. On my local machine, I had a cached ConfigArgParse wheel built under 2.7, so it didn't carry those dependencies, and the pip freeze I used to determine the le-auto requirements thus missed it. From now on, we'll do those passes with --no-cache-dir.
2016-02-02 13:05:15 -05:00
Erik Rose efd4f35782 Run le-auto tests on Travis.
* We choose a different Travis infra for one of the jobs, as in https://github.com/numpy/numpy/blob/master/.travis.yml#L49.
* We keep the language as "python" so the installation of packages (like tox, which we need) doesn't fail.
* Override the before_install to disable the dpkg stuff the other jobs need.
* adduser is redundant with `--groups sudo` above, so we delete it.
2016-02-01 13:52:56 -05:00
Erik Rose ac0a15d48c Add ordereddict, a conditional dependency of ConfigArgParse under Python 2.6. Ref #2200.
It doesn't hurt under 2.7.
2016-01-27 15:45:52 -05:00
Erik Rose 7189778927 Merge the downgrade of the ConfigArgParse dependency to 0.9.3. 2016-01-25 18:32:36 -05:00
Erik Rose 55dba783c0 Port bootstrapper fixes to the new le-auto's bootstrappers. 2016-01-22 15:26:49 -05:00
Erik Rose 66dbd23f2b Upgrade peep to 3.0.
This will avoid crashing when used with pip 8.x, which was released today and is already the 3rd most used client against PyPI. (7.1.2 and 1.5.4 take spots 1 and 2, respectively.)
2016-01-22 00:07:50 -05:00
Erik Rose 65fbeede69 Downgrade declared ConfigArgParse requirement. Fix #2243. 2016-01-20 16:24:21 -05:00
Erik Rose 3c1ba615a8 Remove nosetests -v option from setup.cfg, and add trailing newline. 2016-01-19 17:56:20 -05:00
Erik Rose b20eab67ce Remove errant DS_Store. Ick. 2016-01-19 16:10:39 -05:00
Erik Rose aefd5b25e1 Revert switch to python setup.py test in tox.ini.
This had more of a purpose when we were moving mock to test_requires. I'll reintroduce this in the separate PR for that.

Also bring back the testing extra in tox for now.
2016-01-19 16:10:17 -05:00
Erik Rose e9239018ec Add mock==1.0.1, the Python 2.6 compatible version, to le-auto reqs.
This should ward off the runtime crashes described in https://github.com/erikrose/letsencrypt/commit/6c05197a43fffe3dcd2c10f41954f8a61aec2134.
2016-01-15 18:41:15 -05:00
Erik Rose e1bd1645b6 Revert moving mock to test_requires.
We'll take this up later, but I don't want to hold up the new le-auto on this debate.
2016-01-15 18:25:26 -05:00
Erik Rose 1706619886 Update known-good-set, and make deps unconditional.
Bring everything to the latest versions.

Make dependencies unconditional: argparse, ndg-httpsclient, and pyasn1 get in all the time, to match the state of master as of 0.2.0.
2016-01-15 18:09:27 -05:00
Erik Rose ecbe2a5c69 Merge master in to get the unconditionalization of dependencies. 2016-01-15 13:43:36 -05:00
Erik Rose 5d93678303 Make ConfigArgParse dependencies unconditional as well.
None of this is ideal, since we're making the dependencies tighter than they theoretically need to be, but the behavior of the old le-auto makes this necessary to make it succeed in practice (when using LE wheels).

Once we move to the new le-auto (which pins everything and makes setup.py dependencies irrelevant for auto installs), we should redo this using env markers as in https://github.com/letsencrypt/letsencrypt/pull/2177. We're too afraid to do it now.

Similarly, we're too afraid to change how we handle argparse right now, despite that it should be required directly by us under 2.6. In practice, ConfigArgParse pulls it in for us, so we're okay as long as it continues to do that.
2016-01-14 16:40:47 -05:00
Erik Rose 2771249522 Merge master in before computing a known-good set for 0.2.0.
This also serves as a suitable base to build sdists for isnot.org, so we can try the old le-auto script against mockless versions of the LE packages.
2016-01-13 18:23:51 -05:00
Erik Rose 25e428ce4b Bring built le-auto up to date again. 2016-01-13 17:27:47 -05:00
Erik Rose c3ea4bdc9b Roll back change to acme's pylintrc, which was needed to get lint to pass on Travis's Trusty beta (sudo) infra.
We're stepping off that infra briefly, to keep it the same as boulder's. When we retire the old le-auto, we'll step back on and change boulder to use it as well.
2016-01-13 17:22:59 -05:00
Erik Rose d8130974c7 Upgrade half-sign to sha256. Bring back old le-auto temporarily. Improve le-auto's option parsing.
If the new le-auto works well in the minutes or hours after release, we'll make another commit to master that removes the old le-auto and bootstrap scripts.

Close https://github.com/erikrose/letsencrypt/pull/2.
2016-01-13 13:12:34 -05:00
Erik Rose 86266f5fe1 Remove backported Python 2.7 assertion helpers.
I didn't backport their imports, so they had NameErrors in the failure case anyway. And, because of the docker image, these tests currently are run under only 2.7 at the moment.
2016-01-13 12:50:12 -05:00
Erik RoseandPeter Eckersley 2d4c21ad4f Bring built le-auto script up to date. 2016-01-13 09:30:54 -08:00
Erik Rose a7ae4369c8 Bring built le-auto script up to date. 2016-01-12 18:16:08 -05:00
Erik Rose cb5beb84c5 Fix Fedora 23 crasher.
This fixes an "OSError: [Errno 2] No such file or directory" on Fedora 23. Note that openssl-devel was not sufficient to install the openssl commandline tool.

The current manual-testing build of le-auto now crashes with #1548, but that should have been resolved when we upgraded the cryptography lib and so should go away when we build a new version.
2016-01-12 17:06:58 -05:00
Erik Rose a3288a92b9 Disable too-many-instance-attributes for the acme linter.
This should make the linter pass and allow us to merge the letsencrypt-auto-release branch when it's ready. IHNI why it passes on master without this disabled.
2016-01-12 14:25:36 -05:00
Erik Rose 7ee23b723a Get all tests, even le_auto, working on Travis.
Switch to a MySQL 5.6 setup based on https://github.com/mozilla/treeherder/pull/1080/files and Travis's beta trusty infra, which runs on Google Compute Engine.

Remove MariaDB addon, which conflicts with the socket used by the treeherder approach's mysql package. Remove maria service (which has no effect).
2016-01-12 13:04:24 -05:00
Erik Rose ed562645e0 Master master into letsencrypt-auto-release so Travis will build it. 2016-01-11 21:45:16 -05:00
Erik Rose 6c05197a43 Remove mock as an install requirement.
The motivation is to free us of a reliance on a rather modern version of setuptools, which caused le-auto failures for people on Wheezy and other older distros. (The alternative would have been to forcibly upgrade setuptools as the old le-auto did, but less is more.)

Mock is used only in tests, so we move it to tests_require. It will still be installed automatically when setup.py test is run. Give all packages a test_suite so this works.

The "testing" extra remains for optional packages not required for the nose tests but used in tox. However, the extra is much less useful now and is a candidate for deletion. We could roll the list of packages therein into the tox config so as not to favor any particular package.

Remove tests_require=install_requires, which I don't think does anything useful, since install requirements are implicitly installed when running setup.py test.

Fix tests to pass with mock removed. We had to stop them pulling down LE from PyPI, since the current version there (0.1.1) requires mock and explodes when `letsencrypt` is run.
2016-01-11 21:26:41 -05:00
Erik Rose 66ca7449cb Take le-auto tests out of Travis until we figure out why sudo:required causes other ones to fail.
For now, we'll run them locally with `tox -e le_auto` as we do with the apacheconf tests.
2016-01-11 21:00:57 -05:00
Erik Rose 2f3425a232 Switch to real key, and add signing to release script. Close #1573. 2016-01-11 12:41:55 -05:00
Erik Rose 5512838377 Get le-auto tests running on Travis. 2016-01-08 17:39:51 -05:00
Erik Rose f2586fbc11 Merge master in so Travis will test this PR. 2016-01-08 17:08:30 -05:00
Erik Rose cd43e9035b Rename letsencrypt_auto dir to match other dirs.
Originally, I had it in mind to move letsencrypt-auto inside this dir. However, now we'd like to copy it or link it to the root level, where people are used to finding it (at least for awhile). Since it would be confusing to have a letsencrypt-auto and a letsencrypt_auto right next to each other, we rename this folder.
2016-01-08 16:26:25 -05:00
Erik Rose 1d719bd89c Teach le-auto about dependencies that are conditional on the Python version. 2016-01-08 15:31:22 -05:00
Erik Rose bb31d71fe6 Add a test for failed hash verification during phase-2 upgrade. 2016-01-07 23:41:02 -05:00
Erik Rose 134b7ab8de Add a test for when openssl signature verification fails during phase-1 upgrade. 2016-01-07 17:04:32 -05:00
Erik Rose e5e5c2d65b Don't stomp on the in-tree le-auto during tests. 2016-01-07 16:45:27 -05:00
Erik Rose 98b3c41f2b Add le-auto tests for "no upgrade needed" and "only a phase-2 upgrade needed". 2016-01-07 16:18:23 -05:00
Erik Rose 4b075df871 Cut down mock PyPI dir listing HTML. 2016-01-06 21:40:10 -05:00
Erik Rose 762709aa53 Remove needless message about reusing venv. Rebuild le-auto. 2016-01-06 17:10:44 -05:00
Erik Rose 4fd9d39b79 Mark changes in letsencrypt-auto-release-testing as having been incorporated into letsencrypt-auto-release.
We grabbed the bug fixes but left the changes specific to the infrastructure we mocked out for human testing.
2016-01-06 16:47:32 -05:00
Erik Rose ba6bf45753 Update pinning of LE packages to 0.1.1.
If we keep these at the latest release, something sane should happen if someone runs le-auto from master.
2016-01-06 16:46:42 -05:00
Erik Rose 4940ee2fcf Add hashes for new cffi 1.3.1 packages.
New ones for OS X 10.6 were released on 2015-12-16.
2016-01-06 16:46:42 -05:00
Erik Rose 275d3b4c68 Swap _ for - so the phase-1 upgrade doesn't 404. 2016-01-06 16:46:36 -05:00
Erik Rose d83dda815c Rebuild and re-sign le-auto. 2016-01-06 13:07:47 -05:00
Erik Rose 484b0321ae Add hashes for new cffi 1.3.1 packages.
New ones for OS X 10.6 were released on 2015-12-16.
2016-01-06 12:44:00 -05:00
Erik Rose 404de8429a Update le-auto requirements file to fake LE 0.1.22 release. 2016-01-06 12:38:02 -05:00
Erik Rose 0f787533c3 Swap _ for - so the phase-1 upgrade doesn't 404. 2016-01-05 18:50:43 -05:00
Erik Rose 91812716d9 Change version of le-auto script to the one published in the pypi.json. 2016-01-05 18:47:23 -05:00
Erik Rose 7d182c210d Substitute test-only values for the env vars.
To come: a test-only public key for letsencrypt-auto.sig.
2016-01-05 17:57:06 -05:00
Erik Rose fa30625922 Update the built version of letsencrypt-auto. 2016-01-05 17:35:17 -05:00
Erik Rose cad4e98003 Merge in master to get up to date.
Bootstrap scripts and letsencrypt-auto itself required some merge work.
2016-01-05 17:29:52 -05:00
Erik Rose e6cece580d Document le-auto env vars. 2016-01-05 15:39:34 -05:00
Erik Rose 7e04f52b90 Add built letsencrypt-auto.
We're going to keep the built artifact in the tree as per https://github.com/letsencrypt/letsencrypt/issues/1572#issuecomment-161379131 so that...

1. People's current behavior of cloning from git and running the le-auto script still works.
2. We don't have a deprecation timeline and process to babysit.

We'll enforce its up-to-dateness with a test.
2016-01-05 15:31:54 -05:00
Erik Rose d9cde2b9d3 Get the first end-to-end test of letsencrypt-auto passing.
To run it, cd letsencrypt_auto && ./build.py && docker build -t lea . && docker run --rm -t -i lea

So as not to depend on the state of the host machine, the test runs within an Ubuntu Docker image. This lets us sidestep interaction challenges by setting up passwordless sudo. It also lets us insert our own local CA for the mock HTTPS server. (openssl's SSL_CERT_FILE env var replaces rather than adds to the accepted CAs, meaning later connections to PyPI within the same process chain fail. SSL_CERT_DIR seems not to work at all on OS X.) This also demonstrates a way to test across various Linux distros, even within Travis if we like,

Also...

* Switch to an official release of ConfigArgParse.
* Don't redundantly re-bootstrap on --no-self-upgrade (that is, phase 2).
2016-01-05 15:31:45 -05:00
Erik Rose 0c4a7bb3bc Make le-auto pull the requisite things from env vars so we can run against test servers.
This should let us create a harness that won't force us to mess with GitHub or PyPI just to test.

(I haven't tried this commit yet, but you can if you want to get a head start on testing.)
2015-12-10 14:04:39 -05:00
Erik Rose 8b2c5cbec7 Update LE package pins to 0.1.0, the public beta. 2015-12-04 17:27:37 -05:00
Erik Rose 1da5e472b8 Put quotes around variables that might contain spaces.
Bourne does the dumb thing when substituting vars; this helps that. Bash does the smart thing but is unhurt by this.

We don't do it to $SUDO because Bourne takes "" as a command rather than a no-op, and we don't want the SUDO= case to generate command-not-found errors.
2015-12-04 14:30:14 -05:00
Erik Rose 6db54e21f6 Correct length of dividers. 2015-12-03 19:21:35 -05:00
Erik Rose 4a44c46c60 Add a header for peep errors...
...since the shell's collected output is such a line-break-lacking mess.
2015-12-03 19:21:35 -05:00
Erik Rose 4bcd594234 Put off rm-ing the venv for as long as possible, since it triggers a re-bootstrap.
If DeterminePythonVersion has an error, we shouldn't re-bootstrap.
2015-12-03 19:21:34 -05:00
Erik Rose 55a52d1b96 "none" is clearer than "0.0.0" as a sentinel value. 2015-12-03 19:21:34 -05:00
Erik Rose 5cc69d92e7 In Phase 1, download a new letsencrypt-auto script only if necessary.
* Temp dir creation is now always done in shell.
* Split download_upgrade.py into 2 phases itself so we can have it report back the latest LE version and make a decision based on it before doing and major downloading. Rename it for clarity.
2015-12-03 19:21:34 -05:00
Erik Rose 46779da3b5 In Phase 2, recreate a venv and reinstall Python packages only if necessary.
* Teach the build script how to do special vars. Factor up file reading.
* Use a static string for the PyPI JSON location, as it will soon be overrideable via an env var for testing.
2015-12-03 19:21:34 -05:00
Erik Rose 02255fa024 Upgrade peep to 2.5, for compatibility with pip 7.x. 2015-12-02 22:38:48 -05:00
Erik Rose be6c34de32 Make --no-self-upgrade public.
This replaces --_skip-to-install and is suitable for people who have audited letsencrypt-auto and wish to run it as is, without upgrading to the latest version.

Also...
* rm temp dirs when done. No longer reuse a single temp dir across phases so the user doesn't have to pass a temp dir with --no-self-upgrade as phase 1 itself used to.
* Swap stanzas in the big "if" so we aren't testing negatives all the time.
* Fix a bug in which we ran peep with $LE_PYTHON rather than the python in the venv.
* Bootstrap only if it looks like we never got to the point of making a venv before.
* Move venv creation into Phase 2. Besides the practical benefit of ensuring there's a venv if a user passes --no-self-upgrade, this has the philosophical advantage of making Phase 1 more minimal, giving us more latitude to change behavior in updates.
2015-12-02 17:56:39 -05:00
Erik Rose 5bae8e0ac1 Install not only LE's dependencies but LE itself. 2015-12-02 17:48:59 -05:00
Erik Rose fc52608b40 Rewrap some comments. 2015-12-02 16:37:42 -05:00
Erik Rose 4a69584a84 Standardize semicolon use. 2015-12-02 16:08:28 -05:00
Erik Rose 346ec588b4 Add visual separators between language changes.
On his first time auditing, pde thought this would help.
2015-12-02 15:00:04 -05:00
Erik Rose a1b26262a2 Print the final letsencrypt invocation before doing it.
People like to know what they're sudo-ing.
2015-12-02 14:53:33 -05:00
Erik Rose 3f0bcb5c9a Add real requirements, suitable as of ab9051ff09 on master. 2015-12-02 14:43:26 -05:00
Erik Rose 9d6cbea5ce Fix some errors.
Use the correct Python interpreter. Fix a syntax error. Fix a missing import.
2015-12-02 11:41:49 -05:00
Erik Rose f9d1de6179 Remove test signature, which I shouldn't have committed. 2015-12-02 11:40:30 -05:00
Erik Rose 66436c5255 le-auto now doesn't trigger sh syntax errors when run. 2015-12-02 11:13:23 -05:00
Erik Rose cdd855c745 Add build script for letsencrypt-auto.
Change template language to reference files, saving me some boilerplate over the dict-based .format() thing I originally had in mind.

Put newlines at the ends of bootstrap scripts. It makes the built le-auto script prettier.
2015-12-02 11:13:23 -05:00
Erik Rose ec9a498622 Move OS-package bootstrappers to a private folder.
They're now used only by the le-auto build process. The new public interface for OS-level bootstrapping is le-auto --os-packages-only, which dispatches by OS automatically. That obsoletes install-deps.sh as well, saving some repetition.

Also, switch to mustache-style templating to avoid colliding with shell variable references.

To optimize for the docker cache, we could later add a shim script that sources just deb_common.sh and calls its bootstrap function.
2015-12-02 11:12:57 -05:00
Erik Rose 4abe7ab93d Merge master in to get up to date. 2015-12-02 00:53:09 -05:00
Erik Rose e3ace6f84c Split large independent scripts off from the main body of the proof-of-concept script. Integrate the bits of the old le-auto script that are still useful.
This makes the script more readable and easier to work on. We'll stitch it together with a build process.

Also, stop passing the sudo command as an arg to the experimental bootstrappers. They will be inlined into the main script and can just reference $SUDO. As a result, stop recommending devs run the scripts manually, instead running le-auto --os-packages-only. This has the nice side effect of making dev documentation simpler.

Name the folder "letsencrypt_auto" rather than "letsencrypt-auto" because git yield endless pain when replacing a file with a dir. Perhaps we can change it with impunity in a latter commit.
2015-12-02 00:48:18 -05:00
Erik Rose fe77da2f7f Unquote heredoc terminators.
Quoting them causes them to not be recognized sometimes. (Perhaps it's when they're not within backticks?)
2015-12-01 11:37:21 -05:00
Erik Rose 86203c85df Add peep and sample requirements file.
We cat it to a file rather than just calling it in place because otherwise the "-" arg would have to be stripped off by editing the script.
2015-12-01 11:35:51 -05:00
Erik Rose 2c36f595b3 Return a temp dir, not the file within.
This lets us reuse the dir for other things and makes it easy to rm afterward.
2015-12-01 11:32:27 -05:00
Erik Rose 7fb9295394 Find a better semantic for HumanException.
These are the exceptions that are likely to happen, so we give them extra, human-readable descriptions.

Also, name them more in line with stdlib exceptions.
2015-11-30 17:26:13 -05:00
Erik Rose 602e97755f Stop catching exception types that are no longer thrown by get(). 2015-11-30 17:25:17 -05:00
Erik Rose a75c74303e Compute latest stable version of letsencrypt properly.
PyPI does not appear to give it to us for free through its JSON interface. distutils gives us a sufficient (though not foolproof) comparator without having to go outside the stdlib.
2015-11-30 17:04:48 -05:00
Erik Rose 1a8f40e01b This works now, to the point where it calls the downloaded version of le_auto. 2015-11-30 12:38:03 -05:00
Erik Rose ec415b26fd Add a sig to test against. 2015-11-30 12:25:06 -05:00
Erik Rose 8ba831a8e4 WIP. Here's a letsencrypt-auto script that downloads a new copy of itself, checks a signature on it, and replaces itself with it. 2015-11-30 12:03:30 -05:00
Erik Rose e75dc96559 Stop calling things that don't implement IAuthenticator authenticators. 2015-11-25 12:44:17 -05:00
Erik Rose 8147216f1a Fix some underline lengths in docs. 2015-11-25 12:43:29 -05:00
Erik Rose 1d30bba0c2 Correct pep8 errors across codebase. 2015-11-19 13:23:38 -05:00
Erik Rose 9205b9c987 Remove remaining "DVSNI" wording, changing it to reference TLS-SNI-01, which it changed into. Close #1417.
Also make _get_addrs() private, since it's called only internally.
2015-11-19 13:23:07 -05:00