Changes

no edit summary
Line 16: Line 16:  
  [<arbitrary-path>]/<service-name>.d/[<service-confile>]/<configuration-file>.conf
 
  [<arbitrary-path>]/<service-name>.d/[<service-confile>]/<configuration-file>.conf
   −
The {{Code|service-confile}} is optional and makes sense only if the configured service has several of them, e.g., Bind, or, if a singular configuration file was split at the Mace level into several parts to make it easy to configure, e.g., per IPTables table {{Code|service-confile}}s. The {{Code|configuration-file}} is a configuration file in a particular service configuration's syntax. All {{Code|configuration-file}} files will be merged by mace to the singular {{Code|service-confile}} file and placed in the appropriate distribution-specific directory.
+
The {{Code|service-confile}} is optional and makes sense only if the configured service has several of them, e.g., Bind, or, if a singular configuration file was split at the Mace level into several parts to make it easy to configure, e.g., per IPTables table {{Code|service-confile}}s. The {{Code|configuration-file}} is a configuration file in a particular service configuration's syntax. All {{Code|configuration-file}} files will be merged by mace to the singular {{Code|service-confile}} file and placed in the appropriate distribution-specific directory. The purpose in having {{Code|arbitrary-path}} is that there might be several directories with the same {{Code|service-name}}s to make the configuration more flexible, i.e., it allows having several high-level configuration components in a project that configure the same service.
   −
The purpose in having {{Code|arbitrary-path}} is that there might be several directories with the same {{Code|service-name}}s to make the configuration more flexible, i.e., it allows having several high-level configuration components in a project that configure the same service. Subsequent configuration might:
+
The following example shows how IPTables and Squid proxy might be configured:
   −
* supplement a previous configuration by adding new {{Code|configuration-file}}s,
+
<dir>      +010.net
* override a previous configuration by having the same {{Code|configuration-file}} name with new content,
+
<service>  | +iptables.d
* hide previous configurations by having empty files with the same {{Code|arbitrary-path}} or {{Code|service-name}} name.
+
<confile>  |   +nat
 +
<config>  |     +010.conf
 +
<dir>      +020.proxy
 +
<service>    +iptables.d
 +
<confile>    | +nat
 +
<config>    |   +020.squid.conf
 +
<service>    +squid.d
 +
<confile>      +access
 +
<config>          +010.acl.conf
   −
Such rules will be applied while walking within the root configuration directories tree when directory and file names are sorted alphabetically. The following example demonstrates the virtual tree of upstream configuration with several high-level components and shows how downstream tunes them:
+
See [http://git.sugarlabs.org/server/base/trees/master/etc sugar-server-base sources] for a more complex examples.
 
  −
<dir>    +upstrem
  −
<dir>    |  +0100.base
  −
<dir>    |  |  +iptables.d
  −
<config> |  |    +0100.conf
  −
<dir>    |  +0300.proxy
  −
<dir>    |    +iptables.d
  −
<config> |    |  +0300.squid.conf
  −
<dir>    |    +squid.d
  −
<dir>    +downstream
  −
<dir>      +0100.base
  −
<dir>      |  +iptables.d
  −
<config>    |    +0110.addons.conf
  −
<empty>    +0300.proxy
  −
 
  −
See [http://git.sugarlabs.org/server/base/trees/master/etc sugar-server-base sources] for a more complex example.
      
=== Configuration variables ===
 
=== Configuration variables ===
    
In addition to configuration files, Mace can process files with a {{Code|.env}} suffix. These files contain variable declarations in Bash syntax. The values of these variables might be entered in configuration files in the form of {{Code|@VARIABLE@}}, in which case they will be expanded to real values while applying the configuration.
 
In addition to configuration files, Mace can process files with a {{Code|.env}} suffix. These files contain variable declarations in Bash syntax. The values of these variables might be entered in configuration files in the form of {{Code|@VARIABLE@}}, in which case they will be expanded to real values while applying the configuration.
  −
There are several variables that once defined will have special meaning for Mace:
  −
  −
* {{Code|INCLUDE}}, a colon separated list of services to only include in the processing list while applying;
  −
* {{Code|EXCLUDE}}, a colon separated list of services to exclude from the processing list while applying.
      
== Configuration application ==
 
== Configuration application ==
Line 67: Line 54:     
If the sources path is not the default, {{Code|/etc/sugar-server}}, use the {{Code|--input}} argument to specify the right one.
 
If the sources path is not the default, {{Code|/etc/sugar-server}}, use the {{Code|--input}} argument to specify the right one.
 +
 +
== Templates ==
 +
 +
The project [[The_Server/sugar-server-base|sugar-server-base]] is intended to provide most of basic configurations that might be useful for schools servers. After installing it from packages, the final configuration might be composed by symlinking templates from {{Code|/usr/share/sugar-server-base}} directory to the directory where Mace will find it, by default in {{Code|/etc/sugar-server}}.
    
== Testing routines ==
 
== Testing routines ==