corbosman/laravel-docker-secrets 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

corbosman/laravel-docker-secrets

最新稳定版本:3.0.0

Composer 安装命令:

composer require corbosman/laravel-docker-secrets

包简介

Use Docker Swarm Secrets in your Laravel config files

README 文档

README

Latest Version on Packagist Total Downloads Build

This package allows you to use docker swarm secrets in your Laravel config files. Note there are some limitations, see the usage below.

Installation

Via Composer

$ composer require corbosman/laravel-docker-secrets

Usage

This package provides two helper methods that you can use in your laravel config files. Due to the way Laravel parses the config files, you can only use them in the env() method. In practice this is almost always exactly what you want, as it allows you to override the secrets locally for development.

<?php return [ 'password' => env('PASSWORD', docker_secret('my-docker-secret')) ]; ?> 

You can also store encrypted docker secrets. Note that the secret must be encrypted using your app's key. This is useful if you share your swarm with a team. Other projects can't just mount your secrets and view them.

<?php return [ 'password' => env('PASSWORD', docker_secret_encrypted('my-encrypted-docker-secret')) ]; ?> 

Finally, you can also return a default value if the secret isn't available.

<?php return [ 'password' => env('PASSWORD', docker_secret_encrypted('my-docker-secret', 'my-default')) ]; ?> 

Creating encrypted secret

This package offers a command to easily generate an encrypted secret which you can then store in Docker Swarm. It uses the project's app secret for encryption so make sure that this same key is also used in the service that uses the Swarm secret. You can also simply use Tinker to create encrypted secrets.

$ artisan docker-secret:encrypt foobar eyJpdiI6ImY5dWdHeHJ2WkpZdUNTZFlVYUZpMFE9PSIsInZhbHVlIjoidmZPblk2eEIxNy8vdkl6OE5YSGF2dz09IiwibWFjIjoiZTdmYmVmNmQ5YzA5ZTI3YzI0NjFjOGJkOTY5ODhjNDkwMmMwYWVmMTkwYzcyNzMzN2ZlYWQ1NzlhNzlkM2RjZCJ9

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

Please see the license file for more information.

统计信息

  • 总下载量: 15.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固