App-Regather

 view release on metacpan or  search on metacpan

etc/regather.conf.sample  view on Meta::CPAN

 (objectClass=radiusObjectProfile)\
 (authorizedService=rad@*)\
)\
)
  scope        = sub
  log_base     = cn=umilog

[service ovpn]
#   uid              = openvpn
#   gid              = openvpn
  chmod            = 0640
  ns_attr     = cn
  ns_keyfile  = /usr/local/etc/regather.d/Kdhcpd.+157+43671.private
  ns_ttl      = 300
  ns_txt_pfx  = REGATHER:
#  ns_zone     = dev.vpn.foo.bar.ua
  out_path         = /tmp/2.kill/regather/out_ovpn
  tt_file          = ovpn.tt
#   out_ext         = .ovpn
  ctrl_attr        = umiOvpnCfgConfig
  ctrl_srv_re      = ^.*,authorizedService=ovpn@.*,ou=People,.*$

etc/regather.conf.sample  view on Meta::CPAN

  notafter     = umiUserCertificateNotAfter
  notbefore    = umiUserCertificateNotBefore
  state        = umiOvpnAddStatus

[service ovpn map m]
  iroute       = umiOvpnCfgIroute
  push         = umiOvpnCfgPush

[service sieve]
  chown	           = 1
  chmod            = 0400
  out_path         = /tmp/2.kill/regather/out_sieve
  tt_file          = sieve.tt
  out_file         = .sieve
  out_file_pfx     = homeDirectory
  ctrl_attr        = mu-sieveOnReceive
  ctrl_srv_re      = ^.*,authorizedService=mail@.*,ou=People,.*$
  plugin           = configfile

[service sieve map s]
  createdon         = createTimestamp
  gidNumber	    = gidNumber
  homeDirectory     = homeDirectory
  modifiedon        = modifyTimestamp
  mu_mailBox        = mu-mailBox
  mu_sieveOnReceive = mu-sieveOnReceive
  uid               = uid
  uidNumber	    = uidNumber

[service crl-ovpn]
  chmod            = 0644
  out_path         = /tmp/2.kill/regather/out_crl
  tt_file          = crl-ovpn.tt
  out_ext          = -crl.pem
#  skip             = 1
  ctrl_attr        = certificateRevocationList;binary
  ctrl_srv_re      = ^.*,ou=OpenVPN,.*$
  plugin           = configfile

[service crl-ovpn map s]
  certificateRevocationList = certificateRevocationList;binary

[service crl-rad]
  chmod            = 0644
  out_path         = /tmp/2.kill/regather/out_crl
  tt_file          = crl-rad.tt
  out_ext          = -rad-crl.pem
  ctrl_attr        = certificateRevocationList;binary
  ctrl_attr        = cACertificate;binary
  ctrl_srv_re      = ^.*,ou=servers,ou=RADIUS,.*$
  post_process     = service samba_server onerestart
  plugin           = configfile

[service crl-rad map s]

lib/App/Regather/Config.pm  view on Meta::CPAN

ciphers      = STRING
clientcert   = STRING
clientkey    = STRING
keydecrypt   = STRING
ssl          = STRING
sslversion   = STRING
verify       = STRING

[service ANY]
all_attr     = NUMBER :default 0
chmod        = OCTAL  :default 0640
chown	     = NUMBER :default 1
ctrl_attr    = STRING :mandatory :array
ctrl_srv_re  = STRING :mandatory
gid          = STRING
out_ext      = STRING
out_file     = STRING
out_file_pfx = STRING
out_path     = STRING :check=chk_dir
tt_file      = STRING :check=chk_file_tt
uid          = STRING

lib/App/Regather/Plugin/configfile.pm  view on Meta::CPAN

  ### DRYRUN
  if ( $self->cf->get(qw(core dryrun)) ) {

    $self->log->cc( pr => 'debug', fm => "%s: DRYRUN: %s -> %s",
	      ls => [ sprintf("%s:%s",__FILE__,__LINE__),
		     sprintf("%s/%s", $self->cf->get(qw(core tt_path)),
			     $self->cf->get('service', $self->service, 'tt_file')),
		     $dir. '/' . $out_file
		    ] );

    if ( $self->cf->is_set($self->service, 'chmod') ) {
      $self->log->cc( pr => 'err', fm => "%s: DRYRUN: chmod %s, %s",
		ls => [ sprintf("%s:%s",__FILE__,__LINE__), $self->cf->get('service', $self->service, 'chmod'), $out_to ] );
    } elsif ( $self->cf->is_set(qw(core chmod)) ) {
      $self->log->cc( pr => 'err', fm => "%s: DRYRUN: chmod %s, %s",
		ls => [ sprintf("%s:%s",__FILE__,__LINE__), $self->cf->get('core', 'chmod'), $out_to ] );
    }

    if ( $self->cf->is_set($self->service, 'chown') ) {
      $self->log->cc( pr => 'err', fm => "%s: DRYRUN: chown %s, %s, %s",
		ls => [ sprintf("%s:%s",__FILE__,__LINE__), $self->obj->get_value('uidNumber'),
			$self->obj->get_value('gidNumber'),
			$out_to ] );
    }
    return;
  }

lib/App/Regather/Plugin/configfile.pm  view on Meta::CPAN


  if ( $self->cf->get(qw(core dryrun)) ) {
    $self->log->cc( pr => 'debug', fm => "%s: DRYRUN: rename %s should be renamed to %s",
	      ls => [ sprintf("%s:%s",__FILE__,__LINE__), $tmp_fn, $out_file ] );
  } else {
    rename $tmp_fn, $out_to ||
      $self->log->cc( pr => 'err', fm => "%s: rename %s to %s, failed",
		ls => [ sprintf("%s:%s",__FILE__,__LINE__), $tmp_fn, $out_to ] );

    if ( -e $out_to ) {
      if ( $self->cf->is_set('service', $self->service, 'chmod') ) {
	chmod oct($self->cf->get('service', $self->service, 'chmod')), $out_to ||
	  $self->log->cc( pr => 'err', fm => "%s: chmod for %s failed",
		    ls => [ sprintf("%s:%s",__FILE__,__LINE__), $out_to ] );
      } elsif ( $self->cf->is_set(qw(core chmod)) ) {
	chmod oct($self->cf->(qw(core chmod))), $out_to ||
	  $self->log->cc( pr => 'err', fm => "%s: chmod for %s failed",
		    ls => [ sprintf("%s:%s",__FILE__,__LINE__), $out_to ] );
      }

      if ( $self->cf->is_set('service', $self->service, 'chown') ) {
	chown $self->obj->get_value('uidNumber'),
	  $self->obj->get_value('gidNumber'),
	  $out_to ||
	  $self->log->cc( pr => 'err', fm => "%s: chown (%s:%s) %s failed",
		    ls => [ sprintf("%s:%s",__FILE__,__LINE__), $self->obj->get_value('uidNumber'),
			    $self->obj->get_value('gidNumber'),



( run in 0.585 second using v1.01-cache-2.11-cpan-496ff517765 )