Mojolicious::Command::secret - Create application secrets() consisting of random bytes
If your Mojolicious version is less than 4.63 then you must use version 0.02 of this module.
Tired of manually creating and adding secrets? Me too! Use this command to create secrets and automatically add them to your Mojolicous or Mojolicious::Lite application:
Mojolicous
Mojolicious::Lite
./script/your_app secret ./lite_app secret
This will modify the appropriate application file, though existing secrets will not be overridden unless the -f option is used.
-f
It is assumed that your file contains UTF-8 data and that you use $self or app to refer to your application instance.
$self
app
If you do not want to automatically add secrets to your application use the mojo secret command or the -p option and the secrets will be printed to STDOUT instead:
mojo secret
-p
STDOUT
mojo secret ./script/your_app secret -p
-c, --count N Generate N secrets. Defaults to 1. -f, --force Overwrite an existing secret. Defaults to 0. -g, --generator MODULE=method Module & method to generate the secret. The method must accept an integer argument. Defaults to Crypt::URandom=urandom. and Crypt::OpenSSL::Random=random_bytes -p, --print Print the secret, do not add it to your application. -s, --size SIZE Number of bytes to use. Defaults to 32.
Default options can be added to the MOJO_SECRET_OPTIONS environment variable.
MOJO_SECRET_OPTIONS
Crypt::URandom, Crypt::OpenSSL::Random
(c) 2012 Skye Shaw
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Command::secret, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Command::secret
CPAN shell
perl -MCPAN -e shell install Mojolicious::Command::secret
For more information on module installation, please visit the detailed CPAN module installation guide.