Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If flags are used instead of positional arguments, also expose cert and key paths falling back to existing defaults. #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mcroydon
Copy link

This builds on top of @cespare's conversion from positional arguments to flags and doesn't make a lot of sense otherwise, so feel free to leave this on the cutting room floor. Adding optional flags for the certificate and key paths makes it nicer to use pollen without having to put them in /etc.

I'd also second the vote for flags over positional arguments. It's nice to be able to run pollen stand alone without any arguments and get the author-provided defaults. What you get for free with -h is nice too:

$ pollen -h
Usage of pollen:
-bytes=64: The size in bytes to transmit and receive each time
-cert="/etc/pollen/cert.pem": The full path to cert.pem
-device="/dev/urandom": The device to use for reading and writing random data
-http-addr=":80": The HTTP address:port on which to listen
-https-addr=":443": The HTTPS address:port on which to listen
-key="/etc/pollen/key.pem": The full path to key.pem

I totally respect the decision if positional arguments are the way to go for your use case.

@dustinkirkland
Copy link
Owner

Fantastic idea, Matthew.

I've merged your suggestion into the upstream bzr branch on Launchpad, and
sync'd that back here to github.

Cheers!

:-Dustin

Dustin Kirkland
Ubuntu Core Developer

On Tue, Feb 18, 2014 at 10:01 PM, Matt Croydon notifications@github.comwrote:

This builds on top of @cespare https://github.com/cespare's conversion
from positional arguments to flags and doesn't make a lot of sense
otherwise, so feel free to leave this on the cutting room floor. Adding
optional flags for the certificate and key paths makes it nicer to use
pollen without having to put them in /etc.

I'd also second the vote for flags over positional arguments. It's nice to
be able to run pollen stand alone without any arguments and get the
author-provided defaults. What you get for free with -h is nice too:

$ pollen -h
Usage of pollen:
-bytes=64: The size in bytes to transmit and receive each time
-cert="/etc/pollen/cert.pem": The full path to cert.pem
-device="/dev/urandom": The device to use for reading and writing random
data
-http-addr=":80": The HTTP address:port on which to listen
-https-addr=":443": The HTTPS address:port on which to listen
-key="/etc/pollen/key.pem": The full path to key.pem

I totally respect the decision if positional arguments are the way to go

for your use case.

You can merge this Pull Request by running

git pull https://github.com/mcroydon/pollen flags

Or view, comment on, or merge it at:

#5
Commit Summary

  • Don't create the entropy device if it doesn't exist
  • Use flags rather than positional arguments, and plumb bytes argument
    through
  • If positional arguments are replaced with flags, also allow cert or
    key to be specified falling back to existing default values.

File Changes

Patch Links:

Reply to this email directly or view it on GitHubhttps://github.com//pull/5
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants