Title: apps/ssh - JSON Config Structure
URL Source: https://caddyserver.com/docs/json/apps/ssh/
Markdown Content:
{▾ "grace_period": 0, "servers": {
"": {▾ "address": "", "localforward": {•••}, "reverseforward": {•••}, "pty": {•••}, "idle_timeout": 0, "max_timeout": 0, "authorize": {•••}, "subsystems": {•••}, "configs": [{▾ "match": [{•••}], "config": {•••} }], "actors": [{▾ "match": [{•••}], "act": {•••}, "final": false }] }
}}
Non-standardThis module does not come with Caddy. It can be added by using xcaddy or our download page. Non-standard modules may be developed by the community and are not officially endorsed or maintained by the Caddy project. The documentation is shown here only as a courtesy.
Code repository: https://github.com/kadeessh/kadeessh
Custom builds:xcaddy build --with github.com/kadeessh/kadeessh/internal
Description🔗
SSH is the app providing ssh services
🔗grace_period GracePeriod is the duration a server should wait for open connections to close during shutdown before closing them forcefully
Duration can be an integer or a string. An integer is interpreted as nanoseconds. If a string, it is a Go time.Duration value such as 300ms, 1.5h, or 2h45m; valid units are ns, us/µs, ms, s, m, h, and d.
🔗servers The set of ssh servers keyed by custom names
🔗servers/address Socket addresses to which to bind listeners. Accepts network addresses that may include port ranges. Listener addresses must be unique; they cannot be repeated across all defined servers. TCP is the only acceptable network (for now, perhaps).
🔗servers/localforward The configuration of local-forward permission module. The config structure is: "localforward": { "forward": "" ... config } defaults to: { "forward": "deny" }
Fulfilled by modules in namespace: ssh.ask.localforward
🔗servers/reverseforward The configuration of reverse-forward permission module. The config structure is: "reverseforward": { "forward": "" ... config } defaults to: { "reverseforward": "deny" }
Fulfilled by modules in namespace: ssh.ask.reverseforward
🔗servers/pty The configuration of PTY permission module. The config structure is: "pty": { "pty": "" ... config } defaults to: { "forward": "deny" }
Fulfilled by modules in namespace: ssh.ask.pty
🔗servers/idle_timeout connection timeout when no activity, none if empty
Duration can be an integer or a string. An integer is interpreted as nanoseconds. If a string, it is a Go time.Duration value such as 300ms, 1.5h, or 2h45m; valid units are ns, us/µs, ms, s, m, h, and d.
🔗servers/max_timeout absolute connection timeout, none if empty
Duration can be an integer or a string. An integer is interpreted as nanoseconds. If a string, it is a Go time.Duration value such as 300ms, 1.5h, or 2h45m; valid units are ns, us/µs, ms, s, m, h, and d.
🔗servers/authorize The configuration of the authorizer module. The config structure is: "authorize": { "authorizer": "" ... config } default to: { "authorizer": "public" }.
🔗servers/subsystems The list of defined subsystems in a json structure keyed by the arbitrary name of the subsystem. TODO: The current implementation is naive and can be expanded to follow the Authorzation and Actors model
ModuleMap is a map that can contain multiple modules, where the map key is the module's name. (The namespace is usually read from an associated field's struct tag.) Because the module's name is given as the key in a module map, the name does not have to be given in the json.RawMessage.
🔗servers/configs List of configurators that could configure the server per matchers and config providers
Configurator holds the set of matchers and configurators that will apply custom server configurations if matched
🔗servers/configs/match The set of matchers consulted to know whether the Actor should act on a session
ModuleMap is a map that can contain multiple modules, where the map key is the module's name. (The namespace is usually read from an associated field's struct tag.) Because the module's name is given as the key in a module map, the name does not have to be given in the json.RawMessage.
🔗servers/configs/config The config provider that shall configure the server for the matched session. "config": { "loader": "" ... config loader config }
Fulfilled by modules in namespace: ssh.config.loaders
🔗servers/actors The actors that can act on a session per the matching criteria
Actor is a collection of actor matchers and actors of an ssh session
🔗servers/actors/match The set of matchers consulted to know whether the Actor should act on a session
ModuleMap is a map that can contain multiple modules, where the map key is the module's name. (The namespace is usually read from an associated field's struct tag.) Because the module's name is given as the key in a module map, the name does not have to be given in the json.RawMessage.
🔗servers/actors/act The actor that shall act on the matched session. "act": { "action": "" ... actor config }
🔗servers/actors/final Whether the session shoul be closed upon execution of the actor