Bot-Cobalt

 view release on metacpan or  search on metacpan

bin/cobalt2-installer  view on Meta::CPAN

    }
  } # MANIFEST
}


sub non_interactive {
  die "Non-interactive mode doesn't exist yet :(\n"
  # FIXME set up some default var replacements
  # FIXME env or command line opts for rc paths, basics?
  # FIXME call rc_write, build_dir_skeleton, copy_base_confs,
  #  read_format_write, chmod auth.conf
}


sub interactive_intro {
  say $_ for
    "This is the Bot::Cobalt install helper.",
    "This script will create a cobalt2rc file specifying the bot's paths.",
    "It will also help initialize some starter configuration files.",
    "",
    "Press ENTER to continue, Ctrl+C to quit." ;

bin/cobalt2-installer  view on Meta::CPAN

  my (undef, $etcdir) = rc_read($Rcfile);
  for my $kv ($conf_repl->kv->all) {
    my ($path_prefix, $repl_hash) = @$kv;
    my $actual = path( "${etcdir}/${path_prefix}.conf" );
    say " - Writing '$actual'";
    read_format_write($actual, $repl_hash);
  }

  my $authcf_path = path(join '/', $etcdir, 'auth.conf');
  say " - Adjusting permissions for 'auth.conf' (0600) ...";
  $authcf_path->chmod(0600);
}


$NonInteractive ? non_interactive : interactive;

# FIXME more informative quit msg? paths etc
say $_ for
  " - Completed, exiting",
  "Done!",
  "(You should check over the files mentioned above manually to verify",

lib/Bot/Cobalt/Plugin/Auth.pm  view on Meta::CPAN

  ## don't need to write empty access lists to disk ...
  return $authdb unless keys %$cloned;

  my $serializer = Bot::Cobalt::Serializer->new();

  return $authdb if try {
    $serializer->writefile($authdb, $cloned);

    my $p_cfg = plugin_cfg( $self );
    my $perms = oct( $p_cfg->{Opts}->{AuthDB_Perms} // '0600' );
    chmod($perms, $authdb);
    1
  };

  logger->error("writefile() failure; $authdb $_");
  return
}

1;
__END__

share/etc/cobalt.conf  view on Meta::CPAN

  UseSSL: '%CFG_USE_SSL%'

  ## BindAddr: <address>
  ##  A local address to bind to.
  #BindAddr:

  ## NickServPass: <passwd>
  ##  Attempt to autoidentify to NickServ if specified
  ##  There is an obvious security risk to specifying it here.
  ##  You probably want to check permissions for this configuration.
  ##    f.ex; sh$ chmod 600 cobalt.conf
  #NickServPass: 

  ## Umodes: <modestr>
  ##  Attempt to issue a user mode change on the bot at connect time.
  #Umodes: '+i'

Opts:
  ## CmdChar: <char>
  ##  Prefix character for bot commands
  ##  Most plugins look for cmdchar-prefixed command events.



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