Coder Social home page Coder Social logo

stchao / bitwarden-backup Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 79 KB

A simple c# console app that integrates with the Bitwarden CLI (Command Line Interface) to export your Bitwarden Vault, utilizing Serilog for logging and Spectre.Console for console prompts.

License: MIT License

C# 100.00%

bitwarden-backup's Introduction

Bitwarden-Backup

A simple c# console app that integrates with the Bitwarden CLI (Command Line Interface) to export your Bitwarden Vault, utilizing Serilog for logging and Spectre.Console for console prompts.

Requirements

  • Bitwarden CLI Executable
  • .NET 8.0 SDK

Installation

  1. Clone Bitwarden-Backup repository and build it, or download the corresponding release file.
  2. Make a copy of the appsettings-example.json file and name it appsettings.json.
    • The appsettings can be left as is and will run prompting you for all the needed values.
  3. Download and install .NET 8.0 SDK (See .NET 8.0 SDK Download).
  4. Download Bitwarden CLI Executable (See Bitwarden CLI Download).
  5. Place the Bitwarden CLI Executable in the same directory as the Bitwarden-Backup executable

Configurable appsetting.json Options

These options can be configured by setting the values for the keys in the appsettings.json file.

Key Default Example Description
Serilog:MinimumLevel:Default Debug Information The minimum log event level written to the log file. See Serilog Minimum Level.
Serilog:WriteTo:Args:path - Logs/log.txt The file name or path to the file name. If the directories to the file names don't exist, it will be created.
Serilog:WriteTo:Args:rollingInterval Infinite Day The frequency at which the log file should roll. See Serilog Rolling Interval.
Serilog:WriteTo:Args:retainedFileCountLimit 31 null The number of files to retain.
Serilog:WriteTo:Args:shared false true By default, only one process may write to a log file at a given time. Setting this allows multi-process shared log files.
Serilog:WriteTo:Args:outputTemplate {Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception} {Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u5}] {Message:lj}{NewLine}{Exception} The format for each log entry. See Serilog Formatting Output.
ExportFile:Name bw_export C:\Temp\bw_export The path to place the exported file with the file name.
ExportFile:DateInFileNameFormat - yyyyMMdd When set, a date string based on the format is appended to the exported file name. See Format Specifier.
ExportFile:Format json encrypted_json The file format of the exported file. See Export Format for all options.
ExportFile:CustomExportPassword - custompw When ExportFile:Format is set to encrypted_json and this is set, the file will be encrypted with this password instead of the Bitwarden's account encryption key.
BitwardenConfiguration:Url - https://your.bw.domain.com The Bitwarden server to connect to.
BitwardenConfiguration:UserLogInMethod None EmailPw The method to log in to your Bitwarden vault. See Log In Method for all options.
BitwardenConfiguration:EnableInteractiveLogIn true false If you want to be prompted for any missing but required values from the appsettings.json file.
BitwardenConfiguration:ExecutablePath Executing Directory C:\Temp The path to the bw.exe file.
Credentials:EmailPasswordCredential:Email - [email protected] The email address for your Bitwarden vault.
Credentials:EmailPasswordCredential:MasterPassword or Credentials:APIKeyCredential:MasterPassword - bwpassword The master password for your Bitwarden vault.
Credentials:EmailPasswordCredential:UserTwoFactorMethod None Email The two factor method to unlock your Bitwarden vault. See Two Factor Method for all options.
Credentials:EmailPasswordCredential:TwoFactorCode - 999999 The two factor code corresponding to the two factor method.
Credentials:APIKeyCredential:ClientId - user.clientId A value unique to your account. See Personal API Key for how to obtain it.
Credentials:APIKeyCredential:ClientSecret or Credentials:EmailPasswordCredential:ClientSecret* - clientSecret A unique value that can be rotated. See Personal API Key for how to obtain it.

* For this ClientSecret key under the key EmailPasswordCredential, it will only be needed when Bitwarden CLI prompts for additional authentication. See CLI Authentication Challenges.

bitwarden-backup's People

Contributors

stchao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.