mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
Created Setting the Bichon Encryption Password (markdown)
@@ -0,0 +1,68 @@
|
||||
## 🔐 Setting the Bichon Encryption Password
|
||||
|
||||
Bichon uses an encryption password to protect sensitive data. **You must set it before first use**, when no data exists.
|
||||
|
||||
Once the password is set, it **cannot be changed**. Changing it later will make all encrypted data unreadable. To start over, you must **reinitialize Bichon and delete all emails and metadata**.
|
||||
|
||||
---
|
||||
|
||||
### 🆕 New in v0.2.0: Password File Support
|
||||
|
||||
Starting from **v0.2.0**, Bichon supports loading the encryption password from a file using the `bichon_encrypt_password_file` option (or its corresponding environment variable).
|
||||
|
||||
* If **`bichon_encrypt_password_file` is specified**, Bichon will:
|
||||
|
||||
* Read the file content
|
||||
* Use the file’s content (as-is) as the encryption password
|
||||
|
||||
* If **`bichon_encrypt_password_file` is NOT set**, Bichon falls back to:
|
||||
|
||||
* `bichon-encrypt-password` (CLI argument), or
|
||||
* `BICHON_ENCRYPT_PASSWORD` (environment variable)
|
||||
|
||||
---
|
||||
|
||||
### How to Set the Password
|
||||
|
||||
You can set the password using **one of the following methods**.
|
||||
|
||||
---
|
||||
|
||||
### 📄 Password File (Recommended for Production)
|
||||
|
||||
**Command-line:**
|
||||
|
||||
```bash
|
||||
bichon --bichon-encrypt-password-file /path/to/password.txt
|
||||
```
|
||||
|
||||
**Environment variable:**
|
||||
|
||||
```bash
|
||||
export BICHON_ENCRYPT_PASSWORD_FILE=/path/to/password.txt
|
||||
bichon
|
||||
```
|
||||
|
||||
> The file should contain only the password string (no extra whitespace or newlines).
|
||||
|
||||
---
|
||||
|
||||
### ⌨️ Command-Line (Direct Password)
|
||||
|
||||
```bash
|
||||
bichon --bichon-encrypt-password "your-strong-password"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🌱 Environment Variable
|
||||
|
||||
```bash
|
||||
export BICHON_ENCRYPT_PASSWORD="your-strong-password"
|
||||
bichon
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Tip:**
|
||||
Use a strong, securely stored password. Once set, it **cannot be changed** without wiping all encrypted data.
|
||||
Reference in New Issue
Block a user