Razor2:...:Config(3)
π Razor2::Client::Config π
okay bestie, welcome to the Razor2:...:Config(3) page under User Contributed Perl Documentation. This is the manual for Razor2::Client::Config, and itβs giving config brain energy: config files, razorhome, identity files, auth vibes. π
β¨ NAME β¨
Razor2::Client::Config - Configuration management for Vipul's Razor. π«Ά
πΈ SYNOPSIS πΈ
# Typically used via Razor2::Client::Agent, not directly
use Razor2::Client::Agent;
my $agent = Razor2::Client::Agent->new('razor-check');
$agent->read_options() or die $agent->errstr;
$agent->do_conf() or die $agent->errstr;
# Access configuration values
my $debuglevel = $agent->{conf}{debuglevel};
π¦ DESCRIPTION π¦
So Razor2::Client::Config handles all the configuration file and identity management for the Razor2 client. It reads and writes the razor-agent.conf configuration file, resolves the razorhome directory, and manages user identity files used for authentication with Razor servers. Iconic. β¨
This module is a parent class of Razor2::Client::Agent, and itβs not typically instantiated directly. iykyk β usually the Agent is the main character here. π
π οΈ METHODS π οΈ
read_conf($params)
Reads the Razor configuration. Resolves which config file to use β command-line override, user home, or system default β then merges defaults with file values and command-line options, and stores the result in $self->{conf}. π
$params is an optional hash reference of additional overrides.
Returns the configuration hash reference on success.
compute_razorconf()
Determines the path to the razor-agent.conf file. Checks the user's razorhome first (~/.razor/razor-agent.conf), then the system default (/etc/razor/razor-agent.conf). Sets $self->{razorconf} and $self->{computed_razorconf}. π
write_conf($hash)
Writes configuration to the razor-agent.conf file. If $hash is not provided, reads the current file and merges with defaults. No cap. β¨
find_home($rhome)
Resolves the razorhome directory. Search order, bestie:
- command-line
-homeoption razorhomefrom config file$HOME/.razor/- config file directory
Sets $self->{razorhome}.
On VMS, uses _razor instead of .razor. π
create_home($rhome)
Creates the razorhome directory at $rhome with mode 0755. Slay. π
compute_identity()
Resolves the identity file path from command-line options, configuration, or the default (<razorhome>/identity). Follows symlinks. π¦
get_ident()
Reads and returns the identity file as a hash reference with "user" and "pass" keys. Warns if the file is world-readable. π
save_ident($ident)
Writes an identity hash ("user", "pass") to disk with mode 0600. Creates a symlink from identity to the user-specific file unless -i was specified. Falls back to file copy on systems without symlink support. π₯
Returns the identity file path on success.
read_file($filename, $defaults, $nothash)
General-purpose config file reader. In hash mode (the default), parses key = value lines into a hash reference, skipping comments. In array mode ($nothash true), returns an array reference of lines. π
$defaults provides initial values that file contents override.
write_file($filename, $data, $append, $header, $lock)
Writes data to a file. Accepts a hash reference (written as key = value), an array reference (one item per line), or a scalar reference (raw content). Supports append mode, a header string, and advisory file locking via flock(2). π
default_agent_conf()
Returns a hash reference of default agent configuration values. π
default_server_conf()
Returns a hash reference of default per-server configuration values. π
ποΈ FILES ποΈ
/etc/razor/razor-agent.confβ system-wide configuration file. ποΈ~/.razor/razor-agent.confβ per-user configuration file (takes precedence over system config). π~/.razor/identityβ symlink to the active identity file. π~/.razor/identity-<user>β identity file containing credentials for a registered user. πͺͺ
π SEE ALSO π
razor-agent.conf(5)Razor2::Client::AgentRazor2::Client::Core
βοΈ AUTHORS βοΈ
Vipul Ved Prakash, <mail@vipul.net> π
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
π cute sign-off: this page is from perl v5.44.0, dated 2026-10-17, and the manual page name is Razor2:...:Config(3). Bye bestie, go configure something iconic. π
β¨
π¦ where this page comes from
- arch rolling: razor 2.88-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms