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: For comment 4 Created June 2, 2018, 9:04 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,14 @@
# System users that should be created and added to the group that has
# write permissions for the repository directory
#
+# [*auth_file*]
+# Overwrite the default options of the authentication file used for basic
+# http authentication for nginx.
+#
define adblockplus::web::fileserver::repository (
$ensure = 'present',
$users = {},
+ $auth_file = undef,
){
$repositories_directory = "$adblockplus::directory/fileserver"
@@ -30,6 +35,19 @@
'www' => "$adblockplus::web::fileserver::domain",
default => "$name.$adblockplus::web::fileserver::domain",
}
+ $auth_filename = "${::adblockplus::directory}/htpasswd/${name}"
+
+ nginx::hostconfig {"$repository_host":
+ 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',
+ }
+
+ ensure_resource('file', $auth_filename, merge({
+ ensure => ensure_file_state($ensure),
+ }, $auth_file))
mathias 2018/06/05 15:02:58 This might be undef now, to indicate that there's
f.lopez 2018/06/05 18:00:44 Acknowledged.
group {"$group_name":
ensure => $ensure,

Powered by Google App Engine
This is Rietveld