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

Confusing configuration messaging #66

Closed
samnissen opened this issue Nov 15, 2016 · 1 comment
Closed

Confusing configuration messaging #66

samnissen opened this issue Nov 15, 2016 · 1 comment

Comments

@samnissen
Copy link
Contributor

When using symmetric-encryption, it warns of a missing config:

$ rake db:create # or whatever
# ...
Symmetric Encryption config not found.
To generate one for the first time: bin/rails generate symmetric_encryption:config

Taken at its word, this command does not complete the task, and generates an infinite loop unless carefully parsed:

$ rails generate symmetric_encryption:config

Symmetric Encryption config not found.
To generate one for the first time: bin/rails generate symmetric_encryption:config

Usage:
  rails generate symmetric_encryption:config KEY_PATH [options]

Runtime options:
  -f, [--force]                    # Overwrite files that already exist
  -p, [--pretend], [--no-pretend]  # Run but do not make any changes
  -q, [--quiet], [--no-quiet]      # Suppress status output
  -s, [--skip], [--no-skip]        # Skip files that already exist

Creates a SymmetricEncryption configuration file at config/symmetric-encryption.yml

I understand from the documentation here that my original command is missing the key path, and adding it successfully creates the config. I admit this is in the Usage section. However, I always forget this and find it confusing when initializing a new project.

Also, even successfully creating the config also triggers the message.

$ rails generate symmetric_encryption:config /path/to/keys

Symmetric Encryption config not found.
To generate one for the first time: bin/rails generate symmetric_encryption:config

      create  config/symmetric-encryption.yml

I suggest two changes

  1. The error message changes from
Symmetric Encryption config not found.
To generate one for the first time: bin/rails generate symmetric_encryption:config

to

Symmetric Encryption config not found.
To generate one for the first time: 
1) `rails generate symmetric_encryption:new_keys development`
2) `bin/rails generate symmetric_encryption:config /path/to/keys`

See more information about generating keys here 
  -->  http://rocketjob.github.io/symmetric-encryption/configuration.html
  1. The error messaging be removed from successful creation of the config.
@reidmorrison
Copy link
Owner

v4 of Symmetric Encryption is now at beta3 and includes an all new CLI that addresses the above issues.

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

No branches or pull requests

2 participants