Skip to content

Conversation

@netyum
Copy link
Contributor

@netyum netyum commented Mar 8, 2024

开启配置文件加密
config/autoload/mineadmin.php

   // 是否开启加密
    'config_encryption' => false,
    'config_encryption_key' => 'oqye5o39exzj47LDFMT2oxRJUmy18Fwo0LB006Uo6fk=',
    'config_encryption_iv' => 'bQEvWfcM6xlt3ZtYgBoK/A==',

生成key和向量

$ swoole-cli bin/hyperf.php mine:config-crypt-gen
config encrypt key generator successfully:Y9ozU3eAzlCGVQgV6rr1tEZ/pHORcXO+Y3yIBOsrnGw=
config encrypt iv generator successfully:elvcz9OWCUQwhg/glhBSbA==

替换配置里的key 和iv

加密内容

$ swoole-cli bin/hyperf.php mine:config-crypt 127.0.0.1
config crypt string is: ENC(1d960HOueiIZycVRhSKcFA==)

替换.env
DB_HOST = "ENC(7qxSDf406CtEeNVo6D5q/w==)"

@zds-s zds-s merged commit 9188a63 into mineadmin:2.0 Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants