tobymaxham/laravel-envcrypter
Composer 安装命令:
composer require tobymaxham/laravel-envcrypter
包简介
This package can be used to encrypt and decrypt your .env file.
README 文档
README
This package can be used to encrypt and decrypt your .env file in any Laravel Application.
Installation
You can install the package via composer:
composer require tobymaxham/laravel-envcrypter
Intro
In modern application we use the .env file to store sensitive data like Database-Credentials or API-Tokens in it.
The benefit of that is, that none of them exists in your application source code and not in version-control.
But when it comes to share these credentials it's quite hard to share it in a secure way. So when you add some new environment variables you have to share them with your team-mates or need them at least to update it on your production server.
That's where this package can help you.
With this package you can store your .env file encrypted in your repository and add any information you made in a secure way and share them with your team-mates.
When your local .env file needs to be updated, you can decrypt the file. Only the "Secret Token" will be needed to decrypt the file.
Usage
Lets assume you have a file .env.repository where you want to store all the variables of your
local .env file. You can use the following code to encrypt all the variables and store it in
the file you want to commit in your applications repository:
$crypter = new \TobyMaxham\LaravelEnvCrypter\EnvCrypter('Your-Secret-Token'); $content = $crypter->encryptFile('.env'); // encrypt the .env-File file_put_contents('.env.repository', $content);
No you can commit your file and share it to your team-mates or upload it to your server.
When someone need to update the local .env file, just use the following code to decrypt the variables:
$crypter = new \TobyMaxham\LaravelEnvCrypter\EnvCrypter('Your-Secret-Token'); $content = $crypter->decryptFile('.env.repository'); // decrypt the file file_put_contents('.env', $content); // update your local file
Also see the example file to use this package as very simple command-line tool for storing and loading your environment files.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
If you've found a bug regarding security please mail git@maxham.de instead of using the issue tracker.
Support me
Credits
License
The MIT License (MIT). Please see License File for more information.
tobymaxham/laravel-envcrypter 适用场景与选型建议
tobymaxham/laravel-envcrypter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 270 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「encrypt」 「decrypt」 「tobymaxham」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tobymaxham/laravel-envcrypter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tobymaxham/laravel-envcrypter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tobymaxham/laravel-envcrypter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Hashids for Yii2
Encrypted symfony entity's by verified and standardized libraries
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Encrypting fields in doctrine entities wit AES
♺ Laravel Nova Hashids card. Convert your ids.
A library for reading KeePass 2.x databases
统计信息
- 总下载量: 270
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-14