我正在使用Nginx设置基本身份验证,我想通过一本食谱来做到这一点。我目前拥有的方法是设置了一个bash块,除此之外没有其他东西。我不确定是否有办法使用厨师/红宝石输入我需要的东西,或者我需要做bash。
命令
sudo htpasswd -c /etc/nginx/.htpasswd <username>
重击块
bash 'create nginx login pasword' do
user 'root'
cwd '/tmp'
code <<-EOH
sudo htpasswd -c /etc/nginx/.htpasswd <username1>
sudo htpasswd /etc/nginx/.htpasswd <username2>
sudo htpasswd /etc/nginx/.htpasswd <username3>
EOH
action :run
end
答案 0 :(得分:0)
有一本完整的食谱来创建文件并添加用户。
https://supermarket.chef.io/cookbooks/htpasswd
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: `
<recaptcha
[(ngModel)]="myRecaptcha"
(scriptLoad)="onScriptLoad()"
(scriptError)="onScriptError()"
></recaptcha>
`
})
export class AppComponent {
myRecaptcha: boolean
onScriptLoad() {
console.log('Google reCAPTCHA loaded and is ready for use!')
}
onScriptError() {
console.log('Something went long when loading the Google reCAPTCHA')
}
}
您为什么不使用它?
答案 1 :(得分:0)
htpasswrd
输出相对静态的输出。在您的工作站上运行这些文件,然后使用现有的机密管理层(Hashicorp Vault,chef-vault等)分发文件数据。然后使用file
资源将其写出。