Type a command, regret you typed so much before checking something else,
comment it out for later with Meta-# (Alt-Shift-3). The whole line is
now commented out and saved to history. Recall it later with Ctrl-P or
Up arrow, delete the leading # with Ctrl-D, and run it.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Previously the sys-cli group was for interactive shell access, but with
ever changing requirements this split has become necessary.
This commit introduces the 'sysrepo' group for low-level access to all
sysrepo commands, i.e., bootstrap only. For user-level shell access a
'klish' group is added which allows users to connect to the CLI. This
is now the only group users, including the default 'admin', are members
of, effectively making the new 'copy' tool the norm.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- The new SocketGroup setting allows for configurable /run/klishd.sock
- Also a bug fix for async commands, needed to fix regressions in the
klish-plugin-sysrepo commands 'change passwordk' and 'text-editor'
after the latest upgrade to sysrepo + libyang v4
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Fix by-word movement, detect word barrier using non-alphanum chars
- Fix delete word left/right, make sure to save word in kill buffer
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This update include more backports from Klish 3.1.0, including, but not
limited to:
- Syslog fixes
- Return code fixes
- Changed library and plugin paths (!)
- TTY raw mode fixes
- Use raw mode for interactive commands
- Allow single quotes (') as alternative to regular quotes for commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
As of KernelKit Klish @ 710a631 the script plugin has been refactored to
run all commands as the logged in user instead of as root. The default
admin user is member of the wheel group, which allows access to sysrepo
and sudo access to containers thanks to NOPASSWD rights.
The doas script is a dummy wrapper to silence 'sudo -n' output for users
without any privileges.
As of this commit, unprivileged users can no longer copy, show, or in
any other way manipulate the system configuraiton.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Replaces:
Error: Illegal command
with:
Error: Command not found, or incomplete. Try ? for help or Tab for completion.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With this patch, users not in the NACM admin group and a login shell set
to clish can now log in to the CLI. Prior to this change only members
of the UNIX group 'wheel' could open the klishd socket.
The patch adds another group, 'sys-cli', which acts as a capability for
users. An admin user (member of the admin group) will now be member of
both the UNIX 'wheel' and 'sys-cli' groups. A non-admin user that has
shell set to 'clish' will only be member of the 'sys-cli' group. Other
users will not be mapped to any UNIX group and have only permissions set
in NACM.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Also, add -S option to less, which causes lines longer than the screen
width to be chopped (truncated) rather than wrapped. With available
terminals supporting xterm a user can scroll right on really long lines.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For some reasone upstream changed the Pager (less) from -r to -R, to
explictly only allow ANSI color sequences. This caused the 'show
interfaces' command to output <EF><33><13> style replacement chars
instead of UTF8 line drawing characters.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Also renames all klix_SYM@klinfix to SYM@infix, this is fine since we're
always calling these symbols with @infix.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Lots of changes upstream for parsing help texts, running as different
user, etc. Was getting too difficult to backport to tags/3.0.0, so this
resets the clock on top of (almost) the latest. Experienced issues with
the admin user in configure mode on the latest commits (e4f65d5).
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit switches the klish package to use the kkit branch instead of
keeping a lot of patches from the v3.0.0 release.
Most of the changes made are for dragging tinyrl into the 21st century.
It now supports most of the basic features one have come to expect from
a readline replacement: line navigation, deleting words, erasing entire
line, kill and yank of lines/words and last argument on previous line.
The history has also gotten a bit of a stern talking to. It no longer
deletes lines matching existing old ones from the history, instead it
just checks if the previous command is repeated.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is not just for online viewing, these markdown documents are also
made available in the CLI itself from admin-exec as:
help [introduction | keybindings | tutorial]
With this commit we also add lowdown and the real less application to
be the Infix help system.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The documentation for klish mentions the file ptypes.xml, which defines
the ptype /STRING. So let's use that instead of defining our own types.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Infix integration of klish and klish-plugin-sysrepo.
Initially we add:
More flexible management of running vs. startup: Instead of always
committing changes both to running and startup, commit only modifies
running. To persist changes to startup, the copy command is
introduced. This lets the user copy from factory/startup/running to
startup/running at any time.
Well-known verbs like abort, leave, end, etc.