Skip to content

Commit a16b070

Browse files
authored
Merge pull request #86 from lokeshbelwaltx/master
log_file_perm param added to modify log file permission as world read
2 parents 2bec3d4 + 2351cec commit a16b070

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

ModuleFile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name 'citops-repose'
2-
version '2.7.0'
2+
version '2.10.0'
33
description "Repose is an api middleware that provides authentication,
44
filtering, ratelimitting and several other features, this deploys it."
55
project_page 'https://github.com/rackerlabs/puppet-repose'

manifests/filter/container.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@
101101
# server.
102102
# Defaults to <tt>local0</tt>
103103
#
104+
# [*log_file_perm*]
105+
# String. This option can be used to provide world read access on repose logs.
106+
# if value='private' OR [not equals 'public'] will follow the os umap
107+
# permission of repose user.
108+
# if value='public' will provide world read access on log files.
109+
# Defaults to <tt>private</tt>
110+
#
104111
# [*log_use_log4j2*]
105112
# Boolean. This option will enable the use of log4j2 xml configuration files.
106113
# This will override <tt>logging_configuration</tt> to use <tt>log4j2.xml</tt>.
@@ -308,6 +315,7 @@
308315
$log_local_size = $repose::params::log_local_size,
309316
$log_local_rotation_count = $repose::params::log_local_rotation_count,
310317
$log_repose_facility = $repose::params::log_repose_facility,
318+
$log_file_perm = $repose::params::log_file_perm,
311319
$log_use_log4j2 = false,
312320
$logging_configuration = $repose::params::logging_configuration,
313321
$ssl_enabled = false,

manifests/params.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,7 @@
243243

244244
## use new namespace urls in configuration files
245245
$cfg_new_namespace = false
246+
247+
## default log file permissions
248+
$log_file_perm = 'private'
246249
}

puppet-module-repose.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%define base_name repose
33

44
Name: puppet-module-%{user}-%{base_name}
5-
Version: 2.9.0
5+
Version: 2.10.0
66
Release: 1
77
BuildArch: noarch
88
Summary: Puppet module to configure %{base_name}
@@ -30,6 +30,8 @@ cp -pr * %{buildroot}%{module_dir}/
3030
%{module_dir}
3131

3232
%changelog
33+
* Tue Jun 18 2019 Lokesh Belwal <Lokesh.Belwal@rackspace.com> - 2.10.0-1
34+
- Add log_file_perm param to provide world read access on logs if set to 'public'
3335
* Mon Dec 17 2018 Josh Bell <josh.bell@rackspace.com> - 2.9.0-1
3436
- Add via_header and repose_version options to container filter
3537
* Mon May 12 2018 Josh Bell <josh.bell@rackspace.com> - 2.8.0-1

templates/log4j2.xml.erb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
<%- elsif @log_local_policy == 'size' -%>
2727
<RollingFile name="defaultFile"
2828
filename="<%= @log_dir-%>/<%= @app_name -%>.log"
29-
filePattern="<%= @log_dir-%>/<%= @app_name -%>.log.%i">
29+
filePattern="<%= @log_dir-%>/<%= @app_name -%>.log.%i"
30+
<%- if @log_file_perm == 'public' -%>
31+
filePermissions="rw-r--r--"
32+
<%- end -%>
33+
>
3034
<PatternLayout>
3135
<Pattern>%d{yyyy-MM-dd HH:mm:ss} %-4r [%t] %-5p %c %x - %m%n</Pattern>
3236
</PatternLayout>
@@ -93,7 +97,11 @@
9397
<%- elsif @log_local_policy == 'size' -%>
9498
<RollingFile name="httpLocal"
9599
filename="<%= @log_dir-%>/<%= @log_access_local_name -%>.log"
96-
filePattern="<%= @log_dir-%>/<%= @log_access_local_name -%>.log.%i">
100+
filePattern="<%= @log_dir-%>/<%= @log_access_local_name -%>.log.%i"
101+
<%- if @log_file_perm == 'public' -%>
102+
filePermissions="rw-r--r--"
103+
<%- end -%>
104+
>
97105
<PatternLayout>
98106
<Pattern>%m%n</Pattern>
99107
</PatternLayout>

0 commit comments

Comments
 (0)