[podman-url] add podman url scheme

Related to #1184
pull/1205/head
Tim Stack 9 months ago
parent b561dd18c4
commit 38e5fa5945

@ -31,9 +31,9 @@ Features:
* Added support for custom URL schemes that are handled by an
lnav script. Schemes can be defined under
`/tuning/url-schemes`. See the main docs for more details.
* Added a `docker://` URL scheme that can be used to tail
the logs for containers (e.g. `docker://my-container`) or
files within a container (e.g.
* Added `docker://` and `podman://` URL schemes that can be
used to tail the logs for containers (e.g.
`docker://my-container`) or files within a container (e.g.
`docker://my-serv/var/log/dpkg.log`). Containers mentioned
in a "Compose" configuration file can be tailed by using
`compose` as the host name with the path to the configuration
@ -86,8 +86,11 @@ Features:
- `/ui/theme-defs/<theme_name>/syntax-styles/separators-references-accessors`
* Multi-line block comments (i.e. `/* ... */`) and strings
are now recognized and styled as appropriate.
* Added a `data` column to the `fstat()` table-valued-
function so the contents of a file can be read.
* Added `error` and `data` columns to the `fstat()`
table-valued-function. The `error` column is non-NULL
if there is a problem accessing the file. The `data`
contains the contents of the file, as such, it is
hidden by default.
* Added a log format for Redis.
* The `:eval` command will now treat its argument(s) as a
script, allowing multiple commands to be executed.

@ -7,16 +7,20 @@
],
"description": "The Redis database",
"regex": {
"v2.x": {
"pattern": "\\[(?<pid>\\d+)\\]\\s+(?<timestamp>\\d{1,2} [a-zA-Z]{3} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})\\s+(?<level>[\\.\\-\\*\\#])\\s+(?<body>.*)"
},
"v3.x": {
"pattern": "(?<pid>\\d+):(?<role>[XCSM])\\s+(?<timestamp>\\d{1,2} [a-zA-Z]{3} \\d{4} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})\\s+(?<level>[\\.\\0\\*\\#])\\s+(?<body>.*)"
"pattern": "(?<pid>\\d+):(?<role>[XCSM])\\s+(?<timestamp>\\d{1,2} [a-zA-Z]{3} \\d{4} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})\\s+(?<level>[\\.\\*\\#\\-])\\s+(?<body>.*)"
},
"sig": {
"pattern": "(?<pid>\\d+):signal-handler \\((?<timestamp>\\d+)\\) (?<body>.*)"
"pattern": "(?<pid>\\d+):(?<role>signal-handler) \\((?<timestamp>\\d+)\\) (?<body>.*)"
}
},
"timestamp-format": [
"%s",
"%d %b %Y %H:%M:%S.%L"
"%d %b %Y %H:%M:%S.%L",
"%d %b %H:%M:%S.%L"
],
"level": {
"debug": "^\\.$",
@ -45,6 +49,9 @@
},
{
"line": "1:signal-handler (1693279182) Received SIGTERM scheduling shutdown..."
},
{
"line": "[3574] 13 Apr 12:52:30.731 # Sentinel runid is 2e3b1eed9e95d760e1853e047a33bf4f8ac16c59"
}
]
}

@ -96,6 +96,9 @@
"docker": {
"handler": "docker-url-handler"
},
"podman": {
"handler": "docker-url-handler"
},
"docker-compose": {
"handler": "docker-compose-url-handler"
},

@ -1,9 +1,10 @@
#
# @synopsis: docker-url-handler
# @description: Internal script to handle opening docker URLs
# @description: Internal script to handle opening docker/podman URLs
#
;SELECT jget(url, '/host') AS docker_hostname,
;SELECT jget(url, '/scheme') AS docker_scheme,
jget(url, '/host') AS docker_hostname,
jget(url, '/path') AS docker_path
FROM (SELECT parse_url($1) AS url)
@ -14,8 +15,10 @@
WHEN 'compose' THEN (
SELECT group_concat(
printf(
':sh --name=%s docker compose logs --no-log-prefix -f %s',
':sh --name=%s %s compose -f %s logs --no-log-prefix -f %s',
compose_services.key,
$docker_scheme,
$docker_relpath,
compose_services.key
),
char(10)
@ -36,8 +39,8 @@
)
ELSE CASE
$docker_path
WHEN '/' THEN ':sh docker logs -f ' || $docker_hostname
ELSE ':sh docker exec ' || $docker_hostname || ' tail -n +0 -F "' || $docker_path || '"'
WHEN '/' THEN printf(':sh %s logs -f %s', $docker_scheme, $docker_hostname)
ELSE printf(':sh %s exec %s tail -n +0 -F "%s"', $docker_scheme, $docker_hostname, $docker_path)
END
END AS cmds

@ -113,6 +113,9 @@
},
"piper": {
"handler": "piper-url-handler"
},
"podman": {
"handler": "docker-url-handler"
}
}
},

@ -48,10 +48,11 @@
/tuning/remote/ssh/config/ConnectTimeout -> root-config.json:35
/tuning/remote/ssh/start-command -> root-config.json:37
/tuning/remote/ssh/transfer-command -> root-config.json:38
/tuning/url-scheme/docker-compose/handler -> root-config.json:100
/tuning/url-scheme/docker-compose/handler -> root-config.json:103
/tuning/url-scheme/docker/handler -> root-config.json:97
/tuning/url-scheme/hw/handler -> {test_dir}/configs/installed/hw-url-handler.json:6
/tuning/url-scheme/piper/handler -> root-config.json:103
/tuning/url-scheme/piper/handler -> root-config.json:106
/tuning/url-scheme/podman/handler -> root-config.json:100
/ui/clock-format -> root-config.json:4
/ui/default-colors -> root-config.json:6
/ui/dim-text -> root-config.json:5

Loading…
Cancel
Save