Skip to content

Conversation

pablokbs
Copy link

@pablokbs pablokbs commented Feb 3, 2016

Hello, I added a small block to the template, it's really simple but it works fine

@BarthV
Copy link
Owner

BarthV commented Feb 3, 2016

Thanks for your contribution !

Are you managing htpasswd file externally ? How can I test this with kitchen ?

Maybe you should use this cookbook (if it is still up2date) :
https://github.com/redguide/htpasswd ?

@BarthV
Copy link
Owner

BarthV commented Feb 3, 2016

I think this is the wrapper/webserver job to ensure this kind of security / ACL :)
But if sinopia conf supports natively htpasswd files, we should manage it completely !

metadata.rb Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not bump version in your PR

@pablokbs
Copy link
Author

pablokbs commented Feb 3, 2016

Yes, I'm doing this

settings = Chef::DataBagItem.load("sinopia", "settings")[node.chef_environment] rescue {}

users = settings['users'] rescue []

users.each do |user|
  htpasswd "#{user['username']} on #{node['sinopia']['datadir']}/.htpasswd" do
    file "#{node['sinopia']['datadir']}/.htpasswd"
    user user['username']
    password user['password']
    type "sha1"
    notifies :reload, 'service[sinopia]', :delayed
  end
end

@BarthV
Copy link
Owner

BarthV commented Feb 3, 2016

yep that's it !

I think this htpasswd call should be included into this cookbook since sinopia support natively this kind of setup.

@pablokbs
Copy link
Author

pablokbs commented Feb 3, 2016

Yeah, it should, I'll try to integrate it to this one, I'd need a few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants