kindredgroup / puppet-forge-server

Private Puppet forge server supports local files and both v1 and v3 API proxies
69 stars 44 forks source link

Config option to disable user uploads [Feature Request] #55

Open bryanrossUK opened 7 years ago

bryanrossUK commented 7 years ago

First of all, excellent work on this!

Would it be possible to have a configuration option to disable the upload puppet module feature in the Web UI and API? I'd like to provide a 'read only' Forge that people can use to download and get more info on the internal puppet modules we have. We'll have a separate process for uploading content which will include a jenkins pipeline with some additional steps including testing, review, approvals, etc.

i11 commented 7 years ago

Hey,

Thanks! I'm glad it serves you well. It surely is possible to add that option without much work. I'll try to do that during next week. Otherwise anyone is more than welcome to PR it.

Here are some core places that need changing:

  1. Options: https://github.com/unibet/puppet-forge-server/blob/master/lib/puppet_forge_server/utils/option_parser.rb
  2. API part: a. https://github.com/unibet/puppet-forge-server/blob/master/lib/puppet_forge_server/server.rb#L64 b. https://github.com/unibet/puppet-forge-server/blob/master/lib/puppet_forge_server/app/version2.rb
  3. Web UI a. https://github.com/unibet/puppet-forge-server/blob/master/lib/puppet_forge_server/app/frontend.rb#L69-L77 b. https://github.com/unibet/puppet-forge-server/blob/master/lib/puppet_forge_server/app/views/layout.haml#L43