This file is indexed.

/usr/share/perl5/FCM/Admin/Config.pm is in fcm 2016.12.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# ------------------------------------------------------------------------------
# (C) British Crown Copyright 2006-16 Met Office.
#
# This file is part of FCM, tools for managing and building source code.
#
# FCM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FCM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FCM. If not, see <http://www.gnu.org/licenses/>.
# ------------------------------------------------------------------------------

use strict;
use warnings;

package FCM::Admin::Config;
use base qw{FCM::Class::HASH};

use FCM::Context::Locator;
use FCM::Util;
use File::Basename qw{dirname};
use File::Spec::Functions qw{catfile};
use FindBin;

our $UTIL = FCM::Util->new();

my $TRAC_LIVE_URL_TMPL = 'https://{host}/trac/{project}';
my $USER_ID = (getpwuid($<))[0];

__PACKAGE__->class({
    # Emails
    admin_email         => {isa => '$', default => $USER_ID},
    notification_from   => {isa => '$'},

    # Location for log files
    log_dir             => {isa => '$', default => '/var/log/fcm'},

    # FCM installation locations
    fcm_home            => {isa => '$', default => dirname($FindBin::Bin)},
    fcm_site_home       => {isa => '$', default => q{}},

    # FCM installation mirror locations
    mirror_dests        => {isa => '$', default => q{}},
    mirror_keys         => {isa => '$', default => q{}},

    # Subversion repositories settings
    svn_backup_dir      => {isa => '$', default => '/var/svn/backups'},
    svn_dump_dir        => {isa => '$', default => '/var/svn/dumps'},
    svn_group           => {isa => '$', default => q{}},
    svn_hook_path_env   => {isa => '$', default => q{}},
    svn_live_dir        => {isa => '$', default => '/srv/svn'},
    svn_passwd_file     => {isa => '$', default => q{}},
    svn_project_suffix  => {isa => '$', default => q{}},

    # Trac environments settings
    trac_admin_users    => {isa => '$', default => q{}},
    trac_backup_dir     => {isa => '$', default => '/var/trac/backups'},
    trac_group          => {isa => '$', default => q{}},
    trac_host_name      => {isa => '$', default => 'localhost'},
    trac_ini_file       => {isa => '$', default => 'trac.ini'},
    trac_live_dir       => {isa => '$', default => '/srv/trac'},
    trac_live_url_tmpl  => {isa => '$', default => $TRAC_LIVE_URL_TMPL},
    trac_passwd_file    => {isa => '$', default => q{}},

    # User information tool settings
    user_info_tool      => {isa => '$', default => 'passwd'},

    # User information tool, LDAP settings
    ldappw              => {isa => '$', default => '~/.ldappw'},
    ldap_uri            => {isa => '$', default => q{}},
    ldap_binddn         => {isa => '$', default => q{}},
    ldap_basedn         => {isa => '$', default => q{}},
    ldap_attrs          => {isa => '$', default => q{uid cn mail}},
    ldap_filter_more    => {isa => '$', default => q{}},

    # User information tool, passwd settings
    passwd_email_domain => {isa => '$', default => q{}},
    passwd_gid_max      => {isa => '$'},
    passwd_uid_max      => {isa => '$'},
    passwd_gid_min      => {isa => '$', default => 1000},
    passwd_uid_min      => {isa => '$', default => 1000},
});


# Returns a unique instance of this class.
my $INSTANCE;
sub instance {
    my ($class) = @_;
    if (!defined($INSTANCE)) {
        $INSTANCE = $class->new();
        # Load $FCM_HOME/etc/fcm/admin.cfg and $HOME/.metomi/fcm/admin.cfg
        $UTIL->cfg_init(
            'admin.cfg',
            sub {
                my $config_reader = shift();
                while (defined(my $entry = $config_reader->())) {
                    my $label = $entry->get_label();
                    if (exists($INSTANCE->{$label})) {
                        $INSTANCE->{$label} = $entry->get_value();
                    }
                }
            },
        );
    }
    return $INSTANCE;
}

1;
__END__

=head1 NAME

FCM::Admin::Config

=head1 SYNOPSIS

    $config = FCM::Admin::Config->instance();
    $dir = $config->get_svn_backup_dir();
    # ...

=head1 DESCRIPTION

This class is used to retrieve/store configurations required by FCM
admininstration scripts.

It is a sub-class of L<FCM::Class::HASH|FCM::Class::HASH>.

=head1 METHODS

=over 4

=item FCM::Admin::Config->instance()

Returns a unique instance of this class. On first call, creates the instance
with the configurations set to their default values; and loads from the
site/user configuration at $FCM_HOME/etc/fcm/admin.cfg and
$HOME/.metomi/fcm/admin.cfg.

=back

=head1 ATTRIBUTES

Email addresses.

=over 4

=item admin_email

The e-mail address of the FCM administrator.

=item notification_from

Notification email address (for the "From:" field in notification emails).

=back

Location for log files.

=over 4

=item log_dir

The location for log files.

=back

Locations of FCM installation.

=over 4

=item fcm_home

The source path of the default FCM distribution.

=item fcm_site_home

The source path of the default FCM site distribution.

=back

Settings on how to mirror FCM installation.

=over 4

=item mirror_dests

A space-delimited list of destinations to mirror FCM installation.

=item mirror_keys

A string containing a list of source keys. Each source key should point
to a source location in this $config. The source locations will be distributed
to the list of destinations in C<mirror_dests>.

=back

Subversion repositories settings.

=over 4

=item svn_backup_dir

The path to a directory containing the backups of SVN repositories.

=item svn_dump_dir

The path to a directory containing the revision dumps of SVN
repositories.

=item svn_group

The group name in which Subversion repositories should be created in.

=item svn_hook_dir

The path to a directory containing source files of SVN hook scripts.

=item svn_hook_path_env

The value of the PATH environment variable, in which SVN hook scripts
should run with.

=item svn_live_dir

The path to a directory containing the live SVN repositories.

=item svn_passwd_file

The base name of the SVN password file.

=item svn_project_suffix

The suffix added to the name of each SVN repository.

=back

Trac environment settings.

=over 4

=item trac_admin_users

A space-delimited list of admin users for all Trac environments.

=item trac_backup_dir

The path to a directory containing the backups of Trac environments.

=item trac_group

The group name in which Trac environment files should be created in.

=item trac_host_name

The host name of the Trac server, from the user's perspective.

=item trac_ini_file

The base name of the Trac INI file.

=item trac_live_dir

The path to a directory containing the live Trac environments.

=item trac_live_url_tmpl

The template string for determining the URL of the Trac environment of a
project.

=item trac_passwd_file

The base name of the Trac password file.

=back

=over 4

User information tool settings.

=item user_info_tool

The name of the tool for obtaining user information.

=back

LDAP settings, only relevant if C<user_info_tool = ldap>

=over 4

=item ldappw

File containing the password to the LDAP server, if required.

=item ldap_uri

The URI of the LDAP server.

=item ldap_binddn

The DN in the LDAP server to bind with to search the directory.

=item ldap_basedn

The DN in the LDAP server that is the base for a search.

=item ldap_attrs

The attributes for UID, common name and email in the LDAP directory.

=item ldap_filter_more

If specified, use the value as extra (AND) filters to an LDAP search.

=back

PASSWD settings, only relevant if user_info_tool = passwd

=over 4

=item passwd_email_domain

Domain name to suffix user IDs to create an email address.

=item passwd_gid_max

Maximum GID considered to be a normal user group.

=item passwd_uid_max

Maximum UID considered to be a normal user.

=item passwd_gid_min

Minimum GID considered to be a normal user group. (default=1000)

=item passwd_uid_min

Minimum UID considered to be a normal user. (default=1000)

=back

=head1 COPYRIGHT

E<169> Crown copyright Met Office. All rights reserved.

=cut