https://github.com/code16/occulta
https://github.com/code16/occulta
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/code16/occulta
- Owner: code16
- License: mit
- Created: 2022-05-04T16:22:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-13T07:35:50.000Z (16 days ago)
- Last Synced: 2025-06-13T08:38:52.547Z (16 days ago)
- Language: PHP
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Purpose
Save a versioned and encrypted copy of .env on aws s3
## Installation
This package requires Laravel 8.x or higher.
You can install the package via composer:
```bash
composer require code16/occulta
```Next you should publish the config file :
```bash
php artisan vendor:publish --provider="Code16\Occulta\OccultaServiceProvider"
```and setup your values (especially the kms `key_id` and `destination disk`) in your `config/occulta.php` file :
```php
'key_id' => '0904c439-ff1f-4e9d-8a26-4e32ced6fe0x',
'destination_disk' => 's3_backup',
];
```Then, you should setup credentials to the proper aws user [allowed](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-users) to "use" the given kms key, by adding a kms section in your `config/services.php` file :
```php
'kms' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => 'eu-central-1',
],
```Nom you should schedule tasks for backup and cleanup in `app/Console/Kernel.php` :
```php
protected function schedule(Schedule $schedule)
{
$schedule->command('occulta:encrypt')->dailyAt('01:00');
$schedule->command('occulta:clean')->dailyAt('02:00');
}
```