The Aegis 2FAuth Importer is a Python-based tool that facilitates the migration of encrypted Aegis 2FA backups into a 2FAuth instance. It supports both REST API mode (server) and command-line interface (CLI) mode for flexible integration.
- Decrypts Aegis encrypted backup files
- Imports 2FA accounts into 2FAuth
- Supports REST API server mode and CLI mode
- Provides detailed import reports
Ensure you have the following installed:
- Docker
- Docker Compose
- Clone this repository:
git clone https://github.com/shalak/aegis-2fauth-importer.git
cd aegis-2fauth-importer
- Build the Docker image:
docker-compose build
Create an aegis.env
file with the following environment variables:
AEGIS_PASS=your_aegis_password
URL_2FAUTH=https://your-2fauth-instance.com
BEARER_2FAUTH=your_personal_access_token
To run the application as a REST API server:
docker-compose up aegis-2fauth-importer-server
Example API call:
curl -X POST http://localhost:5000/upload \
-F "file=@path/to/encrypted/backup.json" \
-F "url=$URL_2FAUTH" \
-F "token=$BEARER_2FAUTH" \
-F "password=$AEGIS_PASS" \
-H "Content-Type: multipart/form-data"
To run in CLI mode and import a backup file:
- Place the backup file in
./vaults/aegis-backup.json
. - Execute the following command:
docker-compose run --rm aegis-2fauth-importer
Variable | Description |
---|---|
AEGIS_PASS |
Password for the encrypted Aegis backup |
URL_2FAUTH |
URL of the 2FAuth instance |
BEARER_2FAUTH |
API token for 2FAuth authentication |
Environment variables are required only for CLI mode. In REST API mode, they are optional; if set, they won't need to be provided in API requests.
The tool generates a report with the following sections:
imported
: Successfully imported accountsskipped
: Accounts already existing in 2FAuthinvalid
: Invalid entries from the backuperrors
: Any errors encountered during the process
{
"imported": ["Google - [email protected]"],
"skipped": ["Facebook - [email protected] (already exists)"],
"invalid": [],
"errors": []
}
- Ensure environment variables are correctly set (CLI mode only).
- Check Docker logs for errors:
docker-compose logs
This project is licensed under the MIT License. See the LICENSE
file for details.