Skip to content

velizarn/keepass-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keepass-backup

Access .kdbx file from WebDAV and backup on a CDN.

Overview

Flow diagram

When you open Keepass, the latest version of your database is retrieved from a WebDAV server (or any remote location). This means you’re always working with the most up-to-date information, no matter where you are and how many devices you use.

Whenever you save your database, automated triggers are executed to ensure that your data is not only stored securely but also backed up in additional location. The first trigger creates a temporary copy of the .kdbx file on your local machine. This copy acts as a safeguard during the backup process, ensuring that your working version remains intact.

Immediately after, the second trigger uploads this temporary copy to a designated CDN (Content Delivery Network). This step creates a secure backup of your database, providing an extra layer of protection by storing it in a different location.

When you’re done using Keepass and decide to exit the application, a final trigger is activated. This trigger automatically deletes the temporary file created during the save process, ensuring that no unnecessary copies of your sensitive data are left on your device.

How to use

1) Install KeePass (Installation »)

2) Open KeePass and go to File > Open > Open URL... and enter remote location of .kdbx file and credentials (if applicable). If you enter Username and Password then select prefered option for Remember field. Next time when you open KeePass you can open your .kdbx file from File > Open Recent

3) Create a dedicated KeePass entry (DO-NOT-DELETE-T1, cld-entry.jpg) to store Cloudinary credentials

4) Configure required KeePass triggers, go to Tools > Triggers...

4.1) Export database on save

- Properties
  - Name: Export database on save
  - Enabled: true
  - Initially on: true
- Events
  - Event: Saved database file
- Conditions - not used
- Actions
  - Action: Export active database
    - File/URL: location\to\store\{DB_BASENAME}.kdbx(1)
    - File format: KeePass KDBX (2.x)
(1)Location where temp .kdbx file to be saved

4.2) Store database file on remote CDN

- Properties
  - Name: Store database file on remote CDN
  - Enabled: true
  - Initially on: true
- Events
  - Event: Saved database file
- Conditions - not used
- Actions
  - Action: Execute command line / URL
    - File/URL: path\to\git\git-bash.exe(1)
    - Arguments: path/to/cloudinary.bash "location/to/store/{DB_BASENAME}.kdbx" "{DB_BASENAME}.kdbx" {REF:N@T:DO-NOT-DELETE-T1}(2)
    - Wait for exit: true
    - Window style: Maximized
  - Action: Show message box
    - Main instruction: Database {DB_BASENAME} stored on remote CDN
    - Icon: None
    - Buttons: OK
    - Default button: Button 1
    - Action - Condition: Button OK/Yes
    - Action: None
(1)Path to git-bash.exe; not tested with powershell
(2)Command to execute for uploading file to Cloudinary CDN by using cUrl. Required command line arguments:
- local path to file to be uploaded
- Cloudinary plublicId of the uploaded file
- Cloudinary cloud name
- Cloudinary API key
- Cloudinary API secret
- Cloudinary folder where file will be uploaded (optional)
Note: Check repo for shell script cloudinary.bash
Note: Parameters 3) to 6) are taken from a dedicated KeePass entry (DO-NOT-DELETE-T1, cld-entry.jpg), this means all Cloudinary related credentials are stored in KeePass database.

4.3) Delete temp file/s on exit

- Properties
  - Name: Delete temp file/s on exit
  - Enabled: true
  - Initially on: true
- Events
  - Event: Application exit
- Conditions - not used
- Actions
  - Action: Execute command line / URL
    - File/URL: %comspec%(1)
    - Arguments: /c del "C:\tmp\directory\*.kdbx"(2)
    - Wait for exit: true
    - Window style: Hidden
(1)The command interpreter, which by default is cmd.exe in NT systems, and COMMAND.COM in DOS systems
(2)Command to execute with required arguments

Useful KeePass configurations

  • Database settings (Select database file then go to File > Database Settings)
    • Security
    • Compression: GZip
    • Recycle Bin
      • Use a recycle bin: checked
  • Advanced
    • Limit number of history items per entry: e.g. 2
    • Limit history size per entry (MB): e.g. 1
      both settings could reduce the overall size of the database
  • KeePass configurations (Tools > Options)
    • Security
      • Clipboard auto-clear time (seconds; main entry list): e.g. 10
      • Clear clipboard when closing KeePass: checked
      • Do not store data in Windows clipboard: checked
      • Prevent certain screen captures: checked
  • Advancced
    • Limit to single instance: checked

Resources

About

Access .kdbx file from WebDAV and backup on a CDN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published