module Ketrew_configuration:sig
..end
type
t
typeplugin =
[ `Compiled of string | `OCamlfind of string ]
`Compiled path
: path to a `.cma` or `.cmxs` compiled file.`OCamlfind package
: name of a Findlib package.type
explorer_defaults
val default_explorer_defaults : explorer_defaults
val explorer : ?request_targets_ids:[ `All | `Younger_than of [ `Days of float ] ] ->
?targets_per_page:int ->
?targets_to_prefetch:int -> unit -> explorer_defaults
request_targets_ids
: is used to restrict how many targets are
visible to the Explorer.
The default value is `Younger_than (`Days 1.5)
.targets_per_page
: how many targets to display in a given
“page” (default 6
).targets_to_prefetch
: how many additional targets the Explorer
should prefetch to speed-up navigation (default 6
).type
ui
val ui : ?with_color:bool ->
?explorer:explorer_defaults ->
?with_cbreak:bool -> unit -> ui
with_color
: ask Ketrew to use ANSI colors (default: true
).explorer
: the configuration of The Explorer (cf. Ketrew_configuration.explorer
).with_cbreak
: should the UI use “cbreak
” or not. When
false
, it reads from stdin
classically (i.e. it waits for
the return
key to be pressed); when true
, it gets the
key-presses directly (it's the default but requires a compliant
terminal).type
engine
val engine : ?database_parameters:string ->
?turn_unix_ssh_failure_into_target_failure:bool ->
?host_timeout_upper_bound:float ->
?maximum_successive_attempts:int -> unit -> engine
engine
configuration:
database_parameters
: the path to the database file/directory
(the default is "~/.ketrew/database"
).turn_unix_ssh_failure_into_target_failure
: when an
SSH or system call fails it may not mean that the command in
your workflow is wrong (could be an SSH configuration or
tunneling problem). By default (i.e. false
), Ketrew tries to
be clever and does not make targets fail. To change this
behavior set the option to true
.host_timeout_upper_bound
: every connection/command timeout
will be “≤ upper-bound” (in seconds, default is 60.
).maximum_successive_attempts
: number of successive non-fatal
failures allowed before declaring a target dead (default is 10
).
Tokens have a name and a value; the value is the one checked
against the "token"
argument of the HTTP queries.
name:string -> string -> authorized_tokens
: name
and
a value directly.string -> authorized_tokens
:
The file uses the SSH
authorized_keys
format.
I.e. whitespace-separated lines of the form:
<name> <token> <optional comments ...>
type
server
val server : ?ui:ui ->
?engine:engine ->
?authorized_tokens:authorized_tokens list ->
?return_error_messages:bool ->
?command_pipe:string ->
?daemon:bool ->
?log_path:string ->
[ `Tls of string * string * int ] ->
[> `Server of server ]
Ketrew_configuration.create
function).
authorized_tokens
: cf. Ketrew_configuration.authorized_token
and
Ketrew_configuration.authorized_tokens_path
.return_error_messages
: whether the server should return explicit error
messages to clients (default false
).command_pipe
: path to a named-piped for the server to listen to
commands (this is optional but highly recommended).daemon
: whether to daemonize the server or not (default
false
). If true
, the server will detach from the current
terminal and change the process directory to "/"
; hence if you
use this option it is required to provide absolute paths for all
other parameters requiring paths.log_path
: if set together with daemonize
, ask the server to
redirect logs to this path (if not set, daemon logs go to "/dev/null"
).`Tls ("certificate.pem", "privatekey.pem", port)
: configure the OpenSSL
server to listen on port
.type
standalone
val standalone : ?ui:ui ->
?engine:engine ->
unit -> [> `Standalone of standalone ]
type
client
val client : ?ui:ui ->
token:string -> string -> [> `Client of client ]
ui
: the configuration of the user-interface, cf. Ketrew_configuration.ui
.token
: the authentication token to use to connect to the
server (the argument is optional but nothing interesting can
happen without it)."https://example.com:8443"
.typemode =
[ `Client of client
| `Server of server
| `Standalone of standalone ]
val create : ?debug_level:int ->
?plugins:plugin list ->
mode -> t
debug_level
: integer specifying the amount of verbosity
(current useful values: 0
for quiet, 1
for verbose, 2
for
extremely verbose —- ~debug_level:2
will slow down the engine
noticeably).plugins
: cf. Ketrew_configuration.plugin
.mode
: cf. Ketrew_configuration.standalone
, Ketrew_configuration.client
, and Ketrew_configuration.server
.type
profile
val profile : string -> t -> profile
val output : profile list -> unit
stdout
.val to_json : profile list -> string
val default_database_path : string
val database_parameters : engine -> string
val is_unix_ssh_failure_fatal : engine -> bool
val maximum_successive_attempts : engine -> int
val plugins : t -> plugin list
val mode : t -> mode
val standalone_engine : standalone -> engine
val server_engine : server -> engine
val server_configuration : t -> server option
server ->
[ `Inline of string * string | `Path of string ] list
: authorized_tokens
file.val listen_to : server -> [ `Tls of string * string * int ]
val return_error_messages : server -> bool
return_error_messages
.val command_pipe : server -> string option
val daemon : server -> bool
val log_path : server -> string option
val log : t -> Ketrew_pervasives.Log.t
val connection : client -> string
val token : client -> string
val standalone_of_server : server -> standalone
val with_color : t -> bool
val request_targets_ids : t -> [ `All | `Younger_than of [ `Days of float ] ]
val targets_per_page : t -> int
val targets_to_prefetch : t -> int
val use_cbreak : unit -> bool
with_cbreak
.val load_exn : ?and_apply:bool ->
?profile:string ->
[ `From_path of string
| `Guess
| `In_directory of string
| `Override of t ] -> t
If and_apply
is true
(the default), then global settings are applied
and plugins are loaded.
When the configuration comes from a file, the argument profile
allows to load a given profile. If None
then the loading process
will try the "KETREW_PROFILE"
environment variable, or use the name
"default"
.
The last argument tells the functions how to load the configuration:
`Override c
: use c
as configuration`From_path path
: parse the file path
`In_directory root
: look for configuration files in the root
directory`Guess
: use environment variables and/or default values to
find the configuration file.