feat: Implement keyring-based OTP secret storage with migration from config.json and allow launcher command configuration.
This commit is contained in:
parent
1ec9339b26
commit
d52743d69c
3 changed files with 89 additions and 26 deletions
23
installer.sh
23
installer.sh
|
|
@ -142,25 +142,10 @@ if [ -f "$CONFIG_FILE" ]; then
|
|||
fi
|
||||
|
||||
if [ "$SETUP_CONFIG" = true ]; then
|
||||
echo "We will now set up the configuration file."
|
||||
echo "You will need your generic TOTP secret (base32 format) OR a full otpauth:// URL."
|
||||
read -p "Enter your TOTP Secret or URL: " SECRET
|
||||
|
||||
if [ -z "$SECRET" ]; then
|
||||
echo "Error: Secret cannot be empty."
|
||||
# We can continue to install files even if config fails?
|
||||
# Or should we exit? Probably exit or just warn.
|
||||
# Let's exit for safety if they intended to set it up but failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > "$CONFIG_FILE" <<EOF
|
||||
{
|
||||
"secret": "$SECRET"
|
||||
}
|
||||
EOF
|
||||
echo "Configuration created successfully at: $CONFIG_FILE"
|
||||
|
||||
echo "Creating empty configuration file..."
|
||||
echo "{}" > "$CONFIG_FILE"
|
||||
echo "Configuration created at: $CONFIG_FILE"
|
||||
echo "You will be prompted for your OTP secret when you run the wrapper for the first time."
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue