Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Onion Services
Onionmine
Commits
20c4abae
Verified
Commit
20c4abae
authored
May 16, 2022
by
Silvio Rhatto
Browse files
Feat(mine): auto generate passphrase (Fixes
#14
)
parent
2b7ae7f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/mine
View file @
20c4abae
...
...
@@ -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
...
...
onionmine.conf.sample
View file @
20c4abae
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment