gpt4 book ai didi

continuous-integration - Travis-ci解密加密文件

转载 作者:行者123 更新时间:2023-12-04 00:18:06 25 4
gpt4 key购买 nike

我加密了我的 .env 文件,现在我有一个 .env.enc文件。我的团队如何解密?
我在加密文件时收到了这个响应,它存储在我的 .travis.yml 文件中

openssl aes-256-cbc -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv -in .env.enc -out .env -d

我在终端上试过了,我得到了:
iv undefined

我尝试用 travis-cli 解密:
travis encrypt-file .env.enc .env -d 

我只是得到这个:
key must be 64 characters long and a valid hex number

我用key和iv试过了
travis encrypt-file .env.enc .env -d -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv

我检查了 travis env 变量是否存在,他们做了:
encrypted_cf94abc85bdc_key=[secure]
encrypted_cf94abc85bdc_iv=[secure]

最佳答案

您的文件可能在 Travis 上的构建过程中在某处被解密。添加 deploy 可能最容易一步到构建,所以 .env文件上传到您可以自己下载的地方。

有关如何部署文件的详细信息,请查看 this link或此 one specifically for github

这是我所做的简短示例;)

.travis.yml

before_install:
// Somewhere your files are being decrypted
openssl aes-256-cbc -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv -in .env.enc -out .env -d

// Add a deploy step, which allows you which files to upload
deploy:
file:
- .env /* add the file here, so it will be pushed to github */
api_key: $apikey
on:
repo: <your github repo>

关于continuous-integration - Travis-ci解密加密文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39460636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com