.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CME 1p" .TH CME 1p 2024-01-21 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME cme \- Check or edit configuration data with Config::Model .SH VERSION .IX Header "VERSION" version 1.040 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& # general synopsis \& cme [ global_options ] command application [ options ] [ file ] [ modification_instructions ] \& \& # edit dpkg config with GUI (and Config::Model::Dpkg) \& cme edit dpkg \& \& # read data from arbitrary file (for model read from alternate file) \& cme check dpkg\-copyright \-file path/to/file \& \& # edit /etc/sshd_config (with Config::Model::OpenSsh) \& sudo cme edit sshd \& \& # edit ~/.ssh/config (with Config::Model::OpenSsh) \& cme edit ssh \& \& # just check the validity of a file. Both commands are equivalent \& cme check multistrap file.conf \& cme check multistrap \-file file.conf \& \& # check dpkg files, update deprecated parameters and save \& cme migrate dpkg \& \& # like migrate, but also apply all suggested fixes \& cme fix dpkg \& \& # modify configuration with command line \& cme modify dpkg source \*(Aqformat="(3.0) quilt"\*(Aq \& \& # likewise with an application that accepts file override \& cme modify dpkg\-copyright \*(AqComment="Modified with cme"\*(Aq \& \& # edit a file (file name specification is mandatory here) \& cme edit multistrap my.conf \& \& # map conf data to a fuse file system \& cme fusefs multistrap my.conf \-d fuse_dir \& \& # likewise for dpkg data \& cme fusefs dpkg \-d fuse_dir \& \& # list all available applications (depends on your installation) \& cme list .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Depending on the command described below, \f(CW\*(C`cme\*(C'\fR program will use Config::Model configuration descriptions to check or modify or fix configuration files. .PP The 3rd parameter specify the application you want to work on. Most of the time, the relevant configuration file(s) will be found by cme. This is the most simple case. For instance: .PP .Vb 1 \& sudo cme check popcon .Ve .PP Some application like \f(CW\*(C`multistrap\*(C'\fR have no constraint on the configuration file name and will require you to specify your configuration file name: .PP .Vb 1 \& cme check multistrap raspbian.conf .Ve .PP or .PP .Vb 1 \& cme check multistrap \-file raspbian.conf .Ve .SH "Configuration file specification" .IX Header "Configuration file specification" The configuration of an application can take different forms. Either several files (like debian packages), a single file with a predefined file (popcon), or a single file with an arbitrary file name (multistrap). .PP When needed the configuration file name is specified as the 3rd command argument, i.e. \f(CW\*(C`cme command application file_name\*(C'\fR. This applies if the application requires a configuration file name (like multistrap), or if the application allows configuration file override. .SH "Main commands" .IX Header "Main commands" This section describes the main commands shipped with cme. Other Config::Model extensions can bring more command. Run \f(CW\*(C`cme help\*(C'\fR to get the list of available commands on your system. .SS list .IX Subsection "list" Show a list all applications where a model is available. This list depends on installed Config::Model modules. .SS edit .IX Subsection "edit" Edit a configuration. By default, a Tk GUI will be opened If Config::Model::TkUI is installed. See App::Cme::Command::edit. .SS shell .IX Subsection "shell" Edit the configuration with a shell like interface. See App::Cme::Command::shell. .SS check .IX Subsection "check" Checks the content of the configuration file of an application. See App::Cme::Command::check. .SS migrate .IX Subsection "migrate" Update deprecated parameters (old value are saved to new parameters) and save the new configuration. See App::Cme::Command::migrate. .SS fix .IX Subsection "fix" Migrate data and fix warnings. See App::Cme::Command::fix. .SS modify .IX Subsection "modify" Modify a configuration file with the values passed on the command line. See App::Cme::Command::modify. .SS update .IX Subsection "update" Update the content of the configuration file from external data. Currently, only dpkg-copyright model support update sub command. See App::Cme::Command::update. .SS search .IX Subsection "search" Search configuration data for a specific string. See App::Cme::Command::search. .SS fusefs .IX Subsection "fusefs" Map the configuration file content to a FUSE virtual file system on a directory specified with option \f(CW\*(C`\-fuse\-dir\*(C'\fR. Modifications done in the fuse file system are saved to the configuration file when the \&\f(CW\*(C`fusermount \-u\*(C'\fR is run. .SH "Global options" .IX Header "Global options" The following options are available for all commands: .IP \-create 4 .IX Item "-create" Perform the operation even if the configuration file is missing. This may be used to create a minimal configuration file. This option is disabled by default as a missing configuration file often indicates an error during the installation of the application. .IP \-file 4 .IX Item "-file" For model that support it, specify an alternate file to read and write the configuration. .Sp You can use this option for model that require the target file to be specified (e.g. multitrap model), but file can in this case be also specified with the 4th command argument. E.g. these 2 commands have the same effect: .Sp .Vb 2 \& cme check multistrap foo.conf \& cme check multistrap \-file foo.conf .Ve .IP \-force\-load 4 .IX Item "-force-load" Load file even if error are found in data. Bad data are discarded .IP \-canonical 4 .IX Item "-canonical" Write config data back using model order. By default, write items back using the order found in the configuration file. This feature is experimental and not supported by all backends. .IP \-backup 4 .IX Item "-backup" Create a backup of configuration files before saving. By default, \f(CW\*(C`old\*(C'\fR will be appended to the backup file. I.e. \f(CW\*(C`foo.conf\*(C'\fR will be backed up as \f(CW\*(C`foo.conf.old\*(C'\fR. You can specify an alternate suffix. For instance \f(CW\*(C`\-backup dpkg\-old\*(C'\fR. .IP \-save 4 .IX Item "-save" Force a save even if no change was done. Useful to reformat the configuration file. .IP \-strict 4 .IX Item "-strict" When set, cme will exit 1 if warnings are found during check (of left after fix) .IP \-verbose 4 .IX Item "-verbose" Show more information about what's going on. .IP \-quiet 4 .IX Item "-quiet" Suppress all output except error messages. .SH "Advanced options" .IX Header "Advanced options" .IP \-model\-dir 4 .IX Item "-model-dir" Specify an alternate directory to find model files. Mostly useful for tests. .IP \-root\-dir 4 .IX Item "-root-dir" Specify a pseudo root directory to read and write the configuration files. (Actual default directory and file names depends on the model (See \f(CW\*(C`\-model\*(C'\fR option). For instance, if you specify \f(CW\*(C`~/mytest\*(C'\fR, the \&\f(CW\*(C`/etc/ssh/sshd_config\*(C'\fR files will be written in \f(CW\*(C`~/mytest/etc/ssh/\*(C'\fR directory. .IP \-stack\-trace 4 .IX Item "-stack-trace" Provides a full stack trace when exiting on error. .IP \-try\-app\-as\-model 4 .IX Item "-try-app-as-model" When set, try to load a model using directly the application name specified as 3rd parameter on the command line. Experimental. .SH "Embedding cme" .IX Header "Embedding cme" You can use cme from another program by using \f(CW\*(C`\-ui simple\*(C'\fR option. This way you will be able to send command on the standard input of \f(CW\*(C`cme\*(C'\fR and get the results from the standard output. .SH Logging .IX Header "Logging" All Config::Model logging is now based on Log::Log4perl. Logging can be configured in the following files: .IP \(bu 4 .Sp .Vb 1 \& ~/.log4config\-model .Ve .IP \(bu 4 .Sp .Vb 1 \& /etc/log4config\-model.conf .Ve .PP A sample of a \f(CW\*(C`.log4config\-model\*(C'\fR is provided in contrib directory in \f(CW\*(C`Config::Model\*(C'\fR distribution of on github .PP Without these files, the following Log4perl config is used: .PP .Vb 3 \& log4perl.rootLogger=WARN, Screen \& log4perl.logger.Model.Legacy = INFO, SimpleScreen \& log4perl.additivity.Model.Legacy = 0 \& \& log4perl.appender.Screen = Log::Log4perl::Appender::Screen \& log4perl.appender.Screen.stderr = 0 \& log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout \& log4perl.appender.Screen.layout.ConversionPattern = %M %m (line %L)%n \& \& log4perl.appender.SimpleScreen = Log::Log4perl::Appender::Screen \& log4perl.appender.SimpleScreen.stderr = 0 \& log4perl.appender.SimpleScreen.layout = Log::Log4perl::Layout::PatternLayout \& log4perl.appender.SimpleScreen.layout.ConversionPattern = %p: %m%n \& \& log4perl.oneMessagePerAppender = 1 .Ve .PP Log4perl uses the following categories: .IP Anything 4 .IX Item "Anything" .PD 0 .IP Anything::Change 4 .IX Item "Anything::Change" .PD Trace change notification through configuration tree and instance. .IP Backend 4 .IX Item "Backend" .PD 0 .IP Backend::Debian::Dpkg 4 .IX Item "Backend::Debian::Dpkg" .IP Backend::Debian::Dpkg::Control 4 .IX Item "Backend::Debian::Dpkg::Control" .IP Backend::Debian::Dpkg::Copyright 4 .IX Item "Backend::Debian::Dpkg::Copyright" .IP Backend::Fstab 4 .IX Item "Backend::Fstab" .IP Backend::IniFile 4 .IX Item "Backend::IniFile" .IP Backend::PlainFile 4 .IX Item "Backend::PlainFile" .IP Backend::ShellVar 4 .IX Item "Backend::ShellVar" .IP Backend::Yaml 4 .IX Item "Backend::Yaml" .IP FuseUI 4 .IX Item "FuseUI" .IP Instance 4 .IX Item "Instance" .IP Loader 4 .IX Item "Loader" .IP Model::Searcher 4 .IX Item "Model::Searcher" .IP Tree::Element::CheckList 4 .IX Item "Tree::Element::CheckList" .IP Tree::Element::Id 4 .IX Item "Tree::Element::Id" .IP Tree::Element::Id::Hash 4 .IX Item "Tree::Element::Id::Hash" .IP Tree::Element::Id::List 4 .IX Item "Tree::Element::Id::List" .IP Tree::Element::Value 4 .IX Item "Tree::Element::Value" .IP Tree::Element::Value::Dependency 4 .IX Item "Tree::Element::Value::Dependency" .IP Tree::Node 4 .IX Item "Tree::Node" .IP Tree::Node::Warped 4 .IX Item "Tree::Node::Warped" .IP ValueComputer 4 .IX Item "ValueComputer" .IP Warper 4 .IX Item "Warper" .IP Iterator 4 .IX Item "Iterator" .IP Model 4 .IX Item "Model" .PD .PP More categories will come. .SH "EXIT CODE" .IX Header "EXIT CODE" cme exits 0 when no errors are found. Exit 1 otherwise. .SH BUGS .IX Header "BUGS" .SS "Files may be re-ordered" .IX Subsection "Files may be re-ordered" \&\f(CW\*(C`cme\*(C'\fR imposes a specific ordering of the parameters of a configuration file. This ordering is derived from the documentation of the configuration, like ssh_confg. \f(CW\*(C`cme\*(C'\fR writes back files using this ordering. .PP Thus, the diff between the original configuration files and the new version of the file may be more important than expected when \f(CW\*(C`cme\*(C'\fR is used the first time. .SS "Comments may be dropped" .IX Subsection "Comments may be dropped" Comments are not supported in some applidations (like the one that use YAML in configuration files). Comments are dropped when using \f(CW\*(C`cme\*(C'\fR to edit or modify such files. For more details, see Available backend page. .SS "Configuration models can lag behind the target application" .IX Subsection "Configuration models can lag behind the target application" If a configuration model is not up-to-date, you will get errors complaining about unknown parameters. In such a case, please file a bug on github or fix the model and send a pull request. You can see this example from OpenSsh to learn how to fix a model. .SH "FOR MORE INFORMATION" .IX Header "FOR MORE INFORMATION" For more information, please check: .IP \(bu 4 config-model wiki: .IP \(bu 4 Blogs about this project: .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" In alphabetical order: .PP .Vb 1 \& Ross Vandegrift .Ve .SH FEEDBACKS .IX Header "FEEDBACKS" Feedback from users are highly desired. If you find this module useful, please share your use cases, success stories with the author. .SH "SEE ALSO" .IX Header "SEE ALSO" Config::Model::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::WarpedNode, Config::Model::Value .SH AUTHOR .IX Header "AUTHOR" Dominique Dumont .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2014\-2022 by Dominique Dumont . .PP This is free software, licensed under: .PP .Vb 1 \& The GNU Lesser General Public License, Version 2.1, February 1999 .Ve