Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add config encrypt #36

Merged
merged 10 commits into from
Mar 8, 2024
Merged

add config encrypt #36

merged 10 commits into from
Mar 8, 2024

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
3 checks passed
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