$#! | |
-prefix of an entry, Cron | |
A | |
access, Access | |
access_entry, JMXAccess | |
address, Pg_Hba | |
address_re, Ntpd | |
admin, Gshadow | |
admin_list, Gshadow | |
alias | |
alias_entry, Sudoers | |
alias_entry_single, Sudoers | |
alias_field, Sudoers | |
alias_list, Sudoers | |
alias_name, Sudoers | |
all_flags, Chrony | |
any | |
any_opt | |
apid, Channels | |
application, Erlang | |
arroba, Channels | |
attr_changetype, Ldif | |
attr_description, Ldif | |
attr_dn, Ldif | |
attr_dn_value, Ldif | |
attr_include, Ldif | |
attr_modspec, Ldif | |
attr_option, Ldif | |
attr_type, Ldif | |
attr_val_spec, Ldif | |
attr_version, Ldif | |
auth, Puppet_Auth | |
authorized_key, Authorized_Keys | |
B | |
bare, Erlang | |
bcast, Chrony | |
blacklist, Modprobe | |
block | |
block_entry, Test_Build | |
block_generic, Build | |
block_newline, Build | |
block_newlines_spc, Build | |
block_setdefault, Build | |
body, Xinetd | |
bool | |
bool_warn, Host_Conf | |
boolean, Erlang | |
boot | |
boot_setting, Grub | |
brackets | |
by, Reprepro_Uploaders | |
by_key, Reprepro_Uploaders |
Allow (+) or deny (-) access
let access = label "access" . store /[+-]/
let access_entry = [ label "user" . [ label "username" . store Rx.word ] . Sep.space . [ label "access" . store /(readonly|readwrite)/i ] . Util.eol ]
let address = [ label "address" . store ipaddr_or_hostname ]
let address_re = Rx.ip | /\*/ | Rx.hostname
let admin = [ label "admin" . store word ]
the admin_list is a comma separated list of users allowed to change the group’s password and the member_list
let admin_list = Build.opt_list admin comma
let alias = let modulename = [ label "modulename" . sto_no_spaces ] in Build.key_value_line_comment "alias" sep_space (sto_no_spaces . sep_space . modulename) comment
let alias = [ label "alias" . store word_re ]
Every kind of Alias entry, see user_alias, runas_alias, host_alias and cmnd_alias
let alias = user_alias | runas_alias | host_alias | cmnd_alias
Alias entry, a list of comma-separated alias_entry_single fields
let alias_entry (kw:string) (field:string) (sto:lens) = [ indent . key kw . sep_cont . alias_entry_single field sto . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]
Single alias_entry, named using alias_name and listing alias_list
let alias_entry_single (field:string) (sto:lens) = [ label "alias" . alias_name . sep_eq . alias_list field sto ]
Generic alias field to gather all Alias definitions
let alias_field (kw:string) (sto:lens) = [ label kw . sto ]
List of alias_fields, separated by commas
let alias_list (kw:string) (sto:lens) = Build.opt_list (alias_field kw sto) sep_com
Name of an alias_entry_single
let alias_name = [ label "name" . store /[A-Z][A-Z0-9_]*/ ]
match all flags using Build.flag_line
let all_flags = Build.flag_line flags
A quoted value
let any = let body = store /[^\n]*/ in do_quote body
let any = [ label "any" . Quote.any ]
An optionaly quoted value Double or single quotes are not allowed in value Value cannot begin or end with spaces
let any_opt = let body = store any_opt_re in do_quote_opt body
let any_opt = [ label "any_opt" . Quote.any_opt ]
let apid = let codec = [ arroba . label "codec" . store Rx.integer ] in let options = equal . ( (langs . codec?) | codec ) in let apid_entry (lbl:string) = [ label lbl . store Rx.integer . options? ] in Build.opt_list (apid_entry "apid") comma . ( semicol . Build.opt_list (apid_entry "apid_dolby") comma )?
let application (name:regexp) (parameter:lens) = list name parameter
let arroba = Util.del_str "@"
let attr_changetype (t:regexp) = key /changeType/i . sep_colon . store t . eol
Attribute name, possibly with options
let attr_description = key attr_type . attr_option*
dn-spec = “dn:” (FILL distinguishedName / “:” FILL base64-distinguishedName)
let attr_dn = del /dn/i "dn" . ( attr_safe_string | attr_base64_string ) . eol
Parses an attribute line with a DN on the RHS Parameters: k:regexp - match attribute name as key
let attr_dn_value (k:regexp) = [ key k . ( attr_safe_string | attr_base64_string ) . eol ]
OpenLDAP extension, must be separated by blank lines
let attr_include = eol . [ key "include" . sep_colon . store /[^ \t\n][^\n]*/ . eol . comment* . eol ]
let attr_modspec = key /add|delete|replace/ . sep_colon . store attr_type . attr_option* . eol
options = option / (option “;” options)
let attr_option = Util.del_str ";" . [ label "@option" . store /[a-zA-Z0-9-]+/ ]
AttributeType = ldap-oid / (ALPHA *(attr-type-chars))
let attr_type = ldapoid_re | /[a-zA-Z][a-zA-Z0-9-]*/ - /dn/i - /changeType/i - /include/i
Generic attribute with a value
let attr_val_spec = [ attr_description . ( attr_safe_string | attr_base64_string | attr_url_string ) . eol ]
version-spec = “version:” FILL version-number
let attr_version = Build.key_value_line "version" sep_colon (store /[0-9]+/)
An authentication stanza
let auth = [ Util.indent . Build.xchg /auth(enticated)?/ "auth" "auth" . Sep.space . store /yes|no|on|off|any/ . Util.comment_or_eol ]
let authorized_key = [ label "key" . (key_options . Sep.space)? . key_type . Sep.space . store Rx.no_spaces . (Sep.space . key_comment)? . Util.eol ]
Store a bare Rx.word
let bare = store Rx.word
broadcast has specific syntax
let bcast = [ Util.indent . key "broadcast" . space . [ label "interval" . store integer ] . space . store_address . ( space . [ label "port" . store integer] | eol) ]
let blacklist = Build.key_value_line_comment "blacklist" sep_space sto_no_spaces comment
A block enclosed in brackets
let block (entry:lens) = block_setdelim entry block_ldelim_re block_rdelim_re block_ldelim_default block_rdelim_default
Map block enclosed in brackets recursively.
let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ]
A simple block with just a block title
let block (kw:regexp) (sto:lens) = lens_block (key kw) sto
A block containing simple entries
let block (entry : lens) = [ Util.indent . block_head . Build.block_newlines entry Util.comment . Util.eol ]
The block used for testing
let block = Build.block block_entry
The block entry used for testing
let block_entry = Build.key_value "test" Sep.equal (store Rx.word)
A block enclosed in brackets
let block_generic (entry:lens) (entry_noindent:lens) (entry_noeol:lens) (entry_noindent_noeol:lens) (comment:lens) (comment_noindent:lens) (ldelim_re:regexp) (rdelim_re:regexp) (ldelim_default:string) (rdelim_default:string) = let block_single = entry_noindent_noeol | comment_noindent in let block_start = entry_noindent | comment_noindent in let block_middle = (entry | comment)* in let block_end = entry_noeol | comment in del ldelim_re ldelim_default . ( ( block_start . block_middle . block_end ) | block_single ) . del rdelim_re rdelim_default
A block enclosed in brackets, with newlines forced and indentation defaulting to a tab.
let block_newlines (entry:lens) (comment:lens) = del block_ldelim_newlines_re block_ldelim_newlines_default . ((entry | comment) . (Util.empty | entry | comment)*)? . del block_rdelim_newlines_re block_rdelim_newlines_default
A block enclosed in brackets, with newlines forced and indentation defaulting to a tab.
let block_newlines_spc (entry:lens) (comment:lens) = del (/[ \t\n]/ . block_ldelim_newlines_re) block_ldelim_newlines_default . ((entry | comment) . (Util.empty | entry | comment)*)? . del block_rdelim_newlines_re block_rdelim_newlines_default
We would really like to say “the body can contain any of a list of a list of attributes, each of them at most once”; but that would require that we build a lens that matches the permutation of all attributes; with around 40 individual attributes, that’s not computationally feasible, even if we didn’t have to worry about how to write that down.
let body (attr:lens) = Build.block_newlines_spc (indent . attr . Util.eol) Util.comment
A boolean switch
let bool (kw:regexp) = Build.key_value_line kw Sep.space sto_bool
A boolean entry
let bool = [ key "PRUNE_BIND_MOUNTS" . Sep.space_equal . Quote.do_dquote (store /[01]|no|yes/) . Util.doseol ]
A boolean switch with extended values
let bool_warn (kw:regexp) = Build.key_value_line kw Sep.space sto_bool_warn
Store a boolean value
let boolean = store /true|false/
boot [image [-acds]] XXX: the last arguments are not always needed, so make them optional
let boot = let image = [ label "image" . store fspath ] in let arg = [ label "arg" . store word ] in Build.key_value_line "boot" space (image . space . arg)
let boot = let line = ((boot_setting|comment)* . boot_setting)? in [ label "title" . title . line ]
boot entries
let boot_setting = let boot_arg_re = "root" | "initrd" | "rootnoverify" | "uuid" | "findroot" | "bootfs" (* Solaris extensions *) in kw_boot_arg boot_arg_re | kernel | chainloader | kw_pres "quiet" (* Seems to be a Ubuntu extension *) | savedefault | configfile | module_line | map_line | kw_pres "lock" | kw_pres "makeactive" | password_arg
Put a lens inside brackets
let brackets (l:lens) (r:lens) (lns:lens) = l . lns . r
Test brackets
let brackets = [ Build.brackets Sep.lbracket Sep.rbracket (key Rx.word) ]
by statements define who is allowed to upload.
let by = [ key "by" . Sep.space . ( store ("anybody"|"unsigned") | by_key ) ]
When a key is used to authenticate packages, the value can either be a key ID or “any”:
let by_key = let any_key = [ store "any" . Sep.space . key "key" ] in let named_key = [ key "key" . Sep.space . store (Rx.word - "any") ] in value "key" . (any_key | named_key)