Giter VIP home page Giter VIP logo

Comments (5)

diafygi avatar diafygi commented on June 14, 2024

Two options come to mind:

  • Use python's logging instead of sys.stderr and add a --log-level parameter to the argparse. Open to pull requests on doing this.
  • Output stderr to a temporary file, then print it only if the exit code is not 0.
python acme_tiny.py --account-key ./account.key \
  --csr ./domain.csr --acme-dir /var/www/challenges/ \
  > signed.crt 2> /tmp/errors.log \
|| cat /tmp/errors.log 1>&2

from acme-tiny.

drtoful avatar drtoful commented on June 14, 2024

Wow, you're faster than I can code :-)

drtoful/acme-tiny@30c53c4

The default behavior is the same as before, so it should not break anything for current users. I also took the liberty and compacted some code, so I got below 200 lines.

The script also now accepts "ca" and "out" as parameters, so that I can get rid of some nasty redirects. Also the "ca" option is pretty good if you have a testing server and don't want to fiddle around in the code everytime you want to change it.

from acme-tiny.

diafygi avatar diafygi commented on June 14, 2024

@bwurst added a --quiet parameter to suppress output except for errors

@drtoful Thanks, a lot of the compacting was done by @somecoder42, and it looks like you've got similar things.

FYI, probably not going to accept the CA and out parameters in a pull request. Out doesn't really add much, and I'd like to keep CA at the module level to be able to monkey patch it with the staging CA if I ever get around to writing tests for this.

from acme-tiny.

drtoful avatar drtoful commented on June 14, 2024

Hi

I'm not finished discussing this :-)

The way I added the CA parameter, was as an argument to "get_cert" (with
default value for the productive servers), so you can still "monkey patch"
it during testing, by providing a different URL that way. I don't like
configuration within code (especially when I import it), and I don't think
it's good practice anyway. Furthermore I can use the same script for
staging and production and I do not have to have two copies lying around.

I can create a new pull request for that if you want ^^

The out parameter is just for good measure to get rid of redirects in my
scripts. But since I'm changing anyway to a pure python solution for
automation I don't really need it. Just tried to sneak in that change.

Kind Regards

2015-12-06 1:56 GMT+01:00 Daniel Roesler [email protected]:

@bwurst https://github.com/bwurst added a --quiet parameter to suppress
output except for errors

@drtoful https://github.com/drtoful Thanks, a lot of the compacting was
done by @somecoder42 https://github.com/somecoder42, and it looks like
you've got similar things.

FYI, probably not going to accept the CA and out parameters in a pull
request. Out doesn't really add much, and I'd like to keep CA at the module
level to be able to monkey patch it with the staging CA if I ever get
around to writing tests for this.


Reply to this email directly or view it on GitHub
#23 (comment).

from acme-tiny.

diafygi avatar diafygi commented on June 14, 2024

ok, will review a pull request for the CA parameter

from acme-tiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.