Download the PHP package code16/occulta without Composer
On this page you can find all versions of the php package code16/occulta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download code16/occulta
More information about code16/occulta
Files in code16/occulta
Package occulta
Short Description Store an encrypted with kms and versioned copy of .env
License MIT
Homepage https://github.com/code16/occulta
Informations about the package occulta
Occulta
Purpose
Save a versioned and encrypted copy of .env on a storage disk (eg: S3)
How it works
Occulta uses AWS KMS and Envelope encryption strategy to encrypt your .env file and store it on a given laravel disk (eg: S3).
It also keeps a versioned history of your encrypted .env files, so you can restore previous versions if needed.
Occulta will create an archive containing your encrypted environment file and an encrypted key file, which will be used by occulta to decrypt your env when needed.
Installation
This package requires Laravel 11.x or higher, php's extensions openssl and zip.
You can install the package via composer:
Next you should publish the config file :
and setup your values (especially the kms key_id and destination disk) in your config/occulta.php file :
Then, you should setup credentials to the proper aws user allowed to "use" the given kms key, by adding a kms section in your config/services.php file :
Now you should schedule tasks for backup and cleanup in app/Console/Kernel.php (bootstrap/app.php since Laravel 11) :
Decrypting an encrypted env archive
If you need to decrypt an encrypted env archive, you can use the occulta:decrypt command:
Occulta will use your KMS configuration and AWS access and secret keys to decrypt your env file.
[!IMPORTANT]
It is likely that these credentials where in your lost .env, then, you can follow the recovery procedure to restore your environment.
Testing
The package comes with a comprehensive test suite. To run the tests, you can use the following command:
The tests cover:
- The main
Occultaclass functionality for encrypting and decrypting values and files - The
EncryptFileWithKmsCommandfor encrypting .env files and storing them - The
DecryptFileWithKmsCommandfor extracting and decrypting .env files from zip archives - The
CleanupEncryptedDotenvsCommandfor managing the history of encrypted .env files
The tests use mocks for AWS KMS to avoid actual AWS calls during testing.
All versions of occulta with dependencies
ext-openssl Version *
ext-zip Version *
ext-zlib Version *
aws/aws-sdk-php Version ^3.222
illuminate/contracts Version ^11.0|^12.0|^13.0
laravel/prompts Version ^0.3.5
spatie/laravel-package-tools Version ^1.9.2