Verified Commit 20c4abae authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Feat(mine): auto generate passphrase (Fixes #14)

parent 2b7ae7f8
......@@ -54,9 +54,22 @@ echo ">started at: $DATE" > $LOG
echo ">build flags: $MKP224O_BUILD_FLAGS" >> $LOG
cat $FILTERS | xargs echo ">filters:" >> $LOG
# Check for PASSPHRASE_COMMAND
if [ ! -z "$PASSPHRASE_COMMAND" ]; then
PASSPHRASE="`$PASSPHRASE_COMMAND`"
# Check for passphrase handling
if [ -z "$PASSPHRASE" ]; then
if [ ! -z "$PASSPHRASE_AUTOGEN" ] && [ "$PASSPHRASE_AUTOGEN" == "1" ]; then
if [ -s "$POOL/passphrase" ]; then
PASSPHRASE="`cat $POOL/passphrase`"
else
PASSPHRASE="`head -c 20 /dev/urandom | base64`"
echo "$PASSPHRASE" > $POOL/passphrase
fi
elif [ ! -z "$PASSPHRASE_COMMAND" ]; then
PASSPHRASE="`$PASSPHRASE_COMMAND`"
fi
# Export the passphrase
export PASSPHRASE
fi
# Run
......
......@@ -85,6 +85,9 @@ MKP224O_RUN_FLAGS="-s -d $CANDIDATES -f $FILTERS -B"
# Store the passphrase in a variable (not recommended)
#PASSPHRASE=""
# Set to 1 to autogenerate a passphrase for each pool
#PASSPHRASE_AUTOGEN="0"
# Fetch the passphrase an external command
#
# Any external command can be used as long as it returns a passphrase in the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment