定制 freebuu/laravel-vault 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

freebuu/laravel-vault

Composer 安装命令:

composer require freebuu/laravel-vault

包简介

Laravel package for HashiCorp Vault

README 文档

README

Get your .env from remote (HaspiCorp Vault) on deploy

Warning! This is very beginning alpha version without usable realise. Not recommended for using now

Quickstart

Install

composer require freebuu/laravel-vault
php artisan vendor:publish --tag=config --provider="FreeBuu\LaravelVault\LaravelVaultServiceProvider"

Configure

Add patches from Vault and variables to secrets in vault.php

'vars' => [
    'patches' => [
        '/secret/database/{env}'
    ],
    'patch_variables' => [
        'env' => 'production',
    ],
  ]

Override credentials

Make vault.json file with Vault options - structure MUST be same as vault.php

You can override here ALL options from vault.php

{
  "connections": {
    "vault": {
      "host": "http://vault",
      "role_id": "your_secret_id",
      "secret_id": "your_secret_id"
    }
  }
}

Use

base64 -w 0 vault.json | php artisan vault:get --stdin --b64

If all OK (credentials is actual and have access to secret patches), you see merged values from all patches:

+---------+------------+
| Key     | Value      |
+---------+------------+
| secret1 | value1     |
| secret2 | value2     |
+---------+------------+
  • For save this in .env - add option --output=currentEnv
  • For save this in .env.next - add option --output=nextEnv

Use in CI

Here is a shorthand command special from CI

  • On runner, obtain a token docs
  • Obtain .env with that token
php artisan vault:ci s.JYVfe67632rRDtyf --app=my_project --env=production
  • s.JYVfe67632rRDtyf - Vault one-time token
  • my_project - App name, set the 'app' patch variable. Optional.
  • production - App env, set the 'env' patch variable. Optional.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固