Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/web/fileserver/repository.pp

Issue 29795567: #11371 - Password protection for fileserver repositories (Closed)
Patch Set: Uploaded a file by mistake Created June 1, 2018, 5:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/adblockplus/manifests/web/fileserver/repository.pp
===================================================================
--- a/modules/adblockplus/manifests/web/fileserver/repository.pp
+++ b/modules/adblockplus/manifests/web/fileserver/repository.pp
@@ -18,9 +18,13 @@
# System users that should be created and added to the group that has
# write permissions for the repository directory
#
+# [*auth_users*]
+# Array of users in the form of user:hash, used for http basic authentication
+#
define adblockplus::web::fileserver::repository (
$ensure = 'present',
$users = {},
+ $auth_users = [],
mathias 2018/06/01 21:14:41 This should be a Hash that allows for fine-tuning
f.lopez 2018/06/02 18:29:40 Acknowledged.
){
$repositories_directory = "$adblockplus::directory/fileserver"
@@ -30,6 +34,20 @@
'www' => "$adblockplus::web::fileserver::domain",
default => "$name.$adblockplus::web::fileserver::domain",
}
+ $auth_file = "$adblockplus::directory/${name}_htpasswd"
mathias 2018/06/01 21:14:41 I would prefer this to be either in `/var/www/${na
f.lopez 2018/06/02 18:29:40 Acknowledged.
+
+ nginx::hostconfig{ "$repository_host":
mathias 2018/06/01 21:14:42 Nit: The white-space around the curly bracket is i
f.lopez 2018/06/02 18:29:40 Acknowledged.
+ content => template("adblockplus/web/fileserver.conf.erb"),
+ is_default => false,
+ certificate => $adblockplus::web::fileserver::certificate,
+ private_key => $adblockplus::web::fileserver::private_key,
+ log => 'access_log_fileserver',
+ }
+
+ file {"$auth_file":
+ ensure => ensure_file_state($ensure),
+ content => inline_template('<%= @auth_users.join("\n") if @auth_users %>')
+ }
group {"$group_name":
ensure => $ensure,
« no previous file with comments | « modules/adblockplus/manifests/web/fileserver.pp ('k') | modules/adblockplus/templates/web/fileserver.conf.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld