rename: loolconfig -> coolconfig

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ied23cb46a668f754931fc125745b674b546a0195
pull/3477/head
Mert Tumer 2021-11-15 16:47:53 +03:00 committed by Andras Timar
parent 50ab7c21fa
commit 78ccaa845e
16 changed files with 70 additions and 42 deletions

1
.gitignore vendored
View File

@ -80,6 +80,7 @@ loolconvert
loolsocketdump
loolstress
loolconfig
coolconfig
loolforkit-nocaps
loadtest
unittest

View File

@ -173,7 +173,7 @@
<enable desc="Enable the admin console functionality" type="bool" default="true">true</enable>
<enable_pam desc="Enable admin user authentication with PAM" type="bool" default="false">false</enable_pam>
<username desc="The username of the admin console. Ignored if PAM is enabled."></username>
<password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or loolconfig to set up a secure password."></password>
<password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or coolconfig to set up a secure password."></password>
</admin_console>
<monitors desc="Addresses of servers we connect to on start for monitoring">

View File

@ -17,7 +17,7 @@ export ENABLE_DEBUG
bin_PROGRAMS = \
loolforkit \
loolmount \
loolconvert loolconfig
loolconvert coolconfig
if ENABLE_LIBFUZZER
else
@ -30,7 +30,7 @@ dist_bin_SCRIPTS = loolwsd-systemplate-setup \
man_MANS = man/loolwsd.1 \
man/loolforkit.1 \
man/loolconvert.1 \
man/loolconfig.1 \
man/coolconfig.1 \
man/loolwsd-systemplate-setup.1 \
man/loolwsd-generate-proof-key.1 \
man/loolmount.1
@ -81,7 +81,7 @@ AM_LDFLAGS += -lssl -lcrypto
else
loolwsd_fuzzer_LDADD = -lssl -lcrypto
loolwsd_LDADD = -lssl -lcrypto
loolconfig_LDADD = -lssl -lcrypto
coolconfig_LDADD = -lssl -lcrypto
endif
loolwsd_fuzzer_CPPFLAGS = -DKIT_IN_PROCESS=1 -DFUZZER=1 -DTDOC=\"$(abs_top_srcdir)/test/data\" $(AM_CPPFLAGS)
@ -232,7 +232,7 @@ loolstress_SOURCES = tools/Stress.cpp \
common/DummyTraceEventEmitter.cpp \
$(shared_sources)
loolconfig_SOURCES = tools/Config.cpp \
coolconfig_SOURCES = tools/Config.cpp \
common/DummyTraceEventEmitter.cpp \
common/Crypto.cpp \
common/Log.cpp \

View File

@ -103,7 +103,7 @@ echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/loolwsd
/usr/bin/loolwsd-generate-proof-key
/usr/bin/loolforkit
/usr/bin/loolconvert
/usr/bin/loolconfig
/usr/bin/coolconfig
/usr/bin/loolmount
/usr/share/loolwsd/discovery.xml
/usr/share/loolwsd/favicon.ico
@ -116,7 +116,7 @@ echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/loolwsd
/usr/share/man/man1/loolwsd.1.gz
/usr/share/man/man1/loolforkit.1.gz
/usr/share/man/man1/loolconvert.1.gz
/usr/share/man/man1/loolconfig.1.gz
/usr/share/man/man1/coolconfig.1.gz
/usr/share/man/man1/loolwsd-systemplate-setup.1.gz
/usr/share/man/man1/loolwsd-generate-proof-key.1.gz
/usr/share/man/man1/loolmount.1.gz

View File

@ -205,7 +205,7 @@
<enable desc="Enable the admin console functionality" type="bool" default="true">true</enable>
<enable_pam desc="Enable admin user authentication with PAM" type="bool" default="false">false</enable_pam>
<username desc="The username of the admin console. Ignored if PAM is enabled."></username>
<password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or loolconfig to set up a secure password."></password>
<password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or coolconfig to set up a secure password."></password>
</admin_console>
<monitors desc="Addresses of servers we connect to on start for monitoring">

27
man/coolconfig.1 100644
View File

@ -0,0 +1,27 @@
.TH COOLCONFIG "1" "May 2018" "coolconfig" "User Commands"
.SH NAME
coolconfig \- Configuration tool for Collabora Online.
.SH SYNOPSIS
coolconfig COMMAND [OPTIONS]
.SH OPTIONS
Some options make sense only with a specific command.
.PP
.SS "Commands:"
.PP
set\-admin\-password
.PP
set <key> <value>
.PP
update\-system\-template
.SS "Options:"
\fB\-h\fR, \fB\-\-help\fR Show this usage information.
.PP
\fB\-\-config\-file\fR=\fIpath\fR Specify configuration file path manually.
.PP
\fB\-\-pwd\-salt\-length\fR=\fInumber\fR Length of the salt to use to hash password [set\-admin\-password].
.PP
\fB\-\-pwd\-iterations\fR=\fInumber\fR Number of iterations to do in PKDBF2 password hashing [set\-admin\-password].
.PP
\fB\-\-pwd\-hash\-length\fR=\fInumber\fR Length of password hash to generate [set\-admin\-password].
.SH "SEE ALSO"
loolforkit(1), loolconvert(1), loolwsd(1), loolwsd-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)

View File

@ -17,4 +17,4 @@ loolconvert OPTIONS FILE(S)
\fB\-\-no\-check\-certificate\fR Disable checking of SSL certs
.PP
.SH "SEE ALSO"
loolwsd(1), loolforkit(1), loolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)
loolwsd(1), loolforkit(1), coolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)

View File

@ -8,4 +8,4 @@ Single-threaded process that spawns LibreOfficeKit (LOK) instances.
.PP
\fBNote\fR: Running this standalone is not possible. It is spawned by loolwsd and is controlled via a pipe.
.SH "SEE ALSO"
loolwsd(1), loolconvert(1), loolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)
loolwsd(1), loolconvert(1), coolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)

View File

@ -8,4 +8,4 @@ This is a very tiny helper to allow overlay mounting.
.PP
\fBNote\fR: Running this standalone is not possible. It is used internally by loolwsd when it creates the jail for the document.
.SH "SEE ALSO"
loolwsd(1), loolconvert(1), loolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolforkit(1)
loolwsd(1), loolconvert(1), coolconfig(1), loolforkit-systemplate-setup(1), loolwsd-generate-proof-key(1), loolforkit(1)

View File

@ -6,4 +6,4 @@ loolwsd-generate-proof-key
.SH DESCRIPTION
loolwsd-generate-proof-key creates an RSA key pair in /etc/loolwsd for the WOPI Proof headers. The script is automatically run by the postinstall script of loolwsd package, but in case of failure sysadmins can run it manually.
.SH "SEE ALSO"
loolforkit(1), loolconvert(1), loolconfig(1), loolwsd(1), loolwsd-systemplate-setup(1), loolmount(1)
loolforkit(1), loolconvert(1), coolconfig(1), loolwsd(1), loolwsd-systemplate-setup(1), loolmount(1)

View File

@ -6,4 +6,4 @@ loolwsd-systemplate-setup <chroot template directory for system libs to create>
.SH DESCRIPTION
loolwsd-systemplate-setup creates a minimal system template for running the LibreOfficeKit in a chroot jail. The system template contains the bare minimum of system libraries to run LibreOfficeKit, and also fonts and locale data from the system.
.SH "SEE ALSO"
loolforkit(1), loolconvert(1), loolconfig(1), loolwsd(1), loolwsd-generate-proof-key(1), loolmount(1)
loolforkit(1), loolconvert(1), coolconfig(1), loolwsd(1), loolwsd-generate-proof-key(1), loolmount(1)

View File

@ -31,4 +31,4 @@ loolwsd OPTIONS
\fB\-\-nocaps\fR Use a non\-privileged forkit, with increase in security problems.
.PP
.SH "SEE ALSO"
loolforkit(1), loolconvert(1), loolconfig(1), loolwsd-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)
loolforkit(1), loolconvert(1), coolconfig(1), loolwsd-systemplate-setup(1), loolwsd-generate-proof-key(1), loolmount(1)

View File

@ -37,10 +37,10 @@ using Poco::Util::XMLConfiguration;
#define MIN_PWD_ITERATIONS 1000
#define MIN_PWD_HASH_LENGTH 20
class LoolConfig final: public XMLConfiguration
class CoolConfig final: public XMLConfiguration
{
public:
LoolConfig()
CoolConfig()
{}
};
@ -66,7 +66,7 @@ class Config: public Application
// Display help information on the console
void displayHelp();
LoolConfig _loolConfig;
CoolConfig _coolConfig;
AdminConfig _adminConfig;
@ -101,7 +101,7 @@ void Config::displayHelp()
HelpFormatter helpFormatter(options());
helpFormatter.setCommand(commandName());
helpFormatter.setUsage("COMMAND [OPTIONS]");
helpFormatter.setHeader("loolconfig - Configuration tool for Collabora Online.\n"
helpFormatter.setHeader("coolconfig - Configuration tool for Collabora Online.\n"
"\n"
"Some options make sense only with a specific command.\n\n"
"Options:");
@ -224,7 +224,7 @@ int Config::main(const std::vector<std::string>& args)
int retval = EX_OK;
bool changed = false;
_loolConfig.load(ConfigFile);
_coolConfig.load(ConfigFile);
if (args[0] == "set-admin-password")
{
@ -289,10 +289,10 @@ int Config::main(const std::vector<std::string>& args)
std::stringstream pwdConfigValue("pbkdf2.sha512.", std::ios_base::in | std::ios_base::out | std::ios_base::ate);
pwdConfigValue << std::to_string(_adminConfig.getPwdIterations()) << '.';
pwdConfigValue << saltHash << '.' << passwordHash;
_loolConfig.setString("admin_console.username", adminUser);
_loolConfig.setString("admin_console.secure_password[@desc]",
_coolConfig.setString("admin_console.username", adminUser);
_coolConfig.setString("admin_console.secure_password[@desc]",
"Salt and password hash combination generated using PBKDF2 with SHA512 digest.");
_loolConfig.setString("admin_console.secure_password", pwdConfigValue.str());
_coolConfig.setString("admin_console.secure_password", pwdConfigValue.str());
changed = true;
#else
@ -324,7 +324,7 @@ int Config::main(const std::vector<std::string>& args)
else
{
std::cerr << "Valid for " << validDays << " days - setting to config\n";
_loolConfig.setString("support_key", supportKeyString);
_coolConfig.setString("support_key", supportKeyString);
changed = true;
}
}
@ -332,7 +332,7 @@ int Config::main(const std::vector<std::string>& args)
else
{
std::cerr << "Removing empty support key\n";
_loolConfig.remove("support_key");
_coolConfig.remove("support_key");
changed = true;
}
}
@ -343,12 +343,12 @@ int Config::main(const std::vector<std::string>& args)
{
// args[1] = key
// args[2] = value
if (_loolConfig.has(args[1]))
if (_coolConfig.has(args[1]))
{
const std::string val = _loolConfig.getString(args[1]);
const std::string val = _coolConfig.getString(args[1]);
std::cout << "Previous value found in config file: \"" << val << '"' << std::endl;
std::cout << "Changing value to: \"" << args[2] << '"' << std::endl;
_loolConfig.setString(args[1], args[2]);
_coolConfig.setString(args[1], args[2]);
changed = true;
}
else
@ -374,7 +374,7 @@ int Config::main(const std::vector<std::string>& args)
{
if (!AnonymizationSaltProvided)
{
const std::string val = _loolConfig.getString("logging.anonymize.anonymization_salt");
const std::string val = _coolConfig.getString("logging.anonymize.anonymization_salt");
AnonymizationSalt = std::stoull(val);
std::cout << "Anonymization Salt: [" << AnonymizationSalt << "]." << std::endl;
}
@ -393,7 +393,7 @@ int Config::main(const std::vector<std::string>& args)
if (changed)
{
std::cout << "Saving configuration to : " << ConfigFile << " ..." << std::endl;
_loolConfig.save(ConfigFile);
_coolConfig.save(ConfigFile);
std::cout << "Saved" << std::endl;
}

View File

@ -219,10 +219,10 @@ namespace Util
}
}
class LoolConfig final: public Poco::Util::XMLConfiguration
class CoolConfig final: public Poco::Util::XMLConfiguration
{
public:
LoolConfig()
CoolConfig()
{}
};
@ -238,7 +238,7 @@ int main (int argc, char **argv)
Log::initialize("WebSocketDump", "trace", true, false,
std::map<std::string, std::string>());
LoolConfig config;
CoolConfig config;
config.load("loolwsd.xml");
// read the port & ssl support

View File

@ -137,7 +137,7 @@ bool isConfigAuthOk(const std::string& userProvidedUsr, const std::string& userP
return false;
}
const char useLoolconfig[] = " Use loolconfig to configure the admin password.";
const char useCoolconfig[] = " Use coolconfig to configure the admin password.";
// do we have secure_password?
if (config.has("admin_console.secure_password"))
@ -145,7 +145,7 @@ bool isConfigAuthOk(const std::string& userProvidedUsr, const std::string& userP
const std::string securePass = config.getString("admin_console.secure_password", "");
if (securePass.empty())
{
LOG_ERR("Admin Console secure password is empty, denying access." << useLoolconfig);
LOG_ERR("Admin Console secure password is empty, denying access." << useCoolconfig);
return false;
}
@ -158,7 +158,7 @@ bool isConfigAuthOk(const std::string& userProvidedUsr, const std::string& userP
!tokens.equals(1, "sha512") ||
!Util::dataFromHexString(tokens[3], saltData))
{
LOG_ERR("Incorrect format detected for secure_password in config file." << useLoolconfig);
LOG_ERR("Incorrect format detected for secure_password in config file." << useCoolconfig);
return false;
}
@ -189,7 +189,7 @@ bool isConfigAuthOk(const std::string& userProvidedUsr, const std::string& userP
const std::string pass = config.getString("admin_console.password", "");
if (pass.empty())
{
LOG_ERR("Admin Console password is empty, denying access." << useLoolconfig);
LOG_ERR("Admin Console password is empty, denying access." << useCoolconfig);
return false;
}

View File

@ -1520,8 +1520,8 @@ void LOOLWSD::innerInitialize(Application& self)
if (supportKeyString.empty())
{
LOG_WRN("Support key not set, please use 'loolconfig set-support-key'.");
std::cerr << "Support key not set, please use 'loolconfig set-support-key'." << std::endl;
LOG_WRN("Support key not set, please use 'coolconfig set-support-key'.");
std::cerr << "Support key not set, please use 'coolconfig set-support-key'." << std::endl;
LOOLWSD::OverrideWatermark = "Unsupported, the support key is missing.";
}
else
@ -1530,8 +1530,8 @@ void LOOLWSD::innerInitialize(Application& self)
if (!key.verify())
{
LOG_WRN("Invalid support key, please use 'loolconfig set-support-key'.");
std::cerr << "Invalid support key, please use 'loolconfig set-support-key'." << std::endl;
LOG_WRN("Invalid support key, please use 'coolconfig set-support-key'.");
std::cerr << "Invalid support key, please use 'coolconfig set-support-key'." << std::endl;
LOOLWSD::OverrideWatermark = "Unsupported, the support key is invalid.";
}
else
@ -1539,8 +1539,8 @@ void LOOLWSD::innerInitialize(Application& self)
int validDays = key.validDaysRemaining();
if (validDays <= 0)
{
LOG_WRN("Your support key has expired, please ask for a new one, and use 'loolconfig set-support-key'.");
std::cerr << "Your support key has expired, please ask for a new one, and use 'loolconfig set-support-key'." << std::endl;
LOG_WRN("Your support key has expired, please ask for a new one, and use 'coolconfig set-support-key'.");
std::cerr << "Your support key has expired, please ask for a new one, and use 'coolconfig set-support-key'." << std::endl;
LOOLWSD::OverrideWatermark = "Unsupported, the support key has expired.";
}
else