mirror of
https://github.com/vwxyzjn/portwarden
synced 2025-12-06 01:33:18 +00:00
API-19 # Add simple arguments to enable Portwarden not logging out of Bitwarden
This commit is contained in:
@@ -29,6 +29,7 @@ var (
|
||||
passphrase string
|
||||
filename string
|
||||
sleepMilliseconds int
|
||||
noLogout bool
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -51,6 +52,11 @@ func main() {
|
||||
Destination: &sleepMilliseconds,
|
||||
Value: 300,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "no-logout",
|
||||
Usage: "If set to true, then Portwarden won't log you out of the Bitwarden CLI",
|
||||
Destination: &noLogout,
|
||||
},
|
||||
}
|
||||
|
||||
app.Commands = []cli.Command{
|
||||
@@ -108,7 +114,7 @@ func EncryptBackupController(fileName, passphrase string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return portwarden.CreateBackupFile(fileName, passphrase, sessionKey, sleepMilliseconds)
|
||||
return portwarden.CreateBackupFile(fileName, passphrase, sessionKey, sleepMilliseconds, noLogout)
|
||||
}
|
||||
|
||||
func DecryptBackupController(fileName, passphrase string) error {
|
||||
|
||||
7
core.go
7
core.go
@@ -62,8 +62,11 @@ func CreateBackupBytesUsingBitwardenLocalJSON(dataJson []byte, BITWARDENCLI_APPD
|
||||
return CreateBackupBytes(passphrase, sessionKey, sleepMilliseconds)
|
||||
}
|
||||
|
||||
func CreateBackupFile(fileName, passphrase, sessionKey string, sleepMilliseconds int) error {
|
||||
defer BWLogout()
|
||||
func CreateBackupFile(fileName, passphrase, sessionKey string, sleepMilliseconds int, noLogout bool) error {
|
||||
if !noLogout {
|
||||
fmt.Println("true")
|
||||
defer BWLogout()
|
||||
}
|
||||
if !strings.HasSuffix(fileName, ".portwarden") {
|
||||
fileName += ".portwarden"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user