36 Commits
Author SHA1 Message Date
Joachim Wiberg 4cb2d28e3c package/klish: only show banner in interactive mode
Meaning, skip the CLI help message in non-interactive mode, allowing for:

admin@gateway:~$ klish -c 'show mdns'
Enabled         : yes
Domain          : local
Deny            : wan

HOSTNAME           ADDRESS        LAST SEEN  SERVICES
Living-Room.local  192.168.0.139  18:50:52   trel(57249) sleep-proxy(61936) raop(7000) srpl-tls(853)
firefly-4.local    192.168.0.122  18:50:46   workstation(9)
gimli.local        192.168.0.200  18:50:46   device-info(0)
infix.local        192.168.0.1    18:50:47   https(443) workstation(9) ssh(22) https(443)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-03-22 20:23:43 +01:00
Joachim Wiberg 4bc08e7323 Drop useless logger processes, these services already use syslog
Note, rousette does not support SIGHUP, so let's mark it as such.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-03-20 16:18:04 +01:00
Joachim Wiberg 98a39d989c package/klish: add support for insert-comment
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>
2026-02-01 10:40:44 +01:00
Joachim Wiberg f5c6ac3905 package/klish: bump for new command line mark/kill and quote chars
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-01-24 18:08:30 +01:00
Joachim Wiberg b58550367c sys: rename sys-cli -> sysrepo + klish
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>
2026-01-22 22:44:14 +01:00
Joachim Wiberg 77e81e60d8 package/klish: bump for new SocketGroup setting and bugfix
- 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>
2026-01-22 22:39:53 +01:00
Joachim Wiberg b0aaf8fd89 package/klish: fix integer size bug on 32-bit systems
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-11-24 11:34:21 +01:00
Joachim Wiberg fe031f1a10 package/klish: fix by-word movement and kill buffer support
- 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>
2025-06-24 13:54:54 +02:00
Mattias Walström f4e75dfecb Update the name in hash file for the packages for fetched from git
Buildroot have change the named for the tar-package
created for a package created from a git repo.
2025-03-17 19:45:03 +01:00
Joachim Wiberg cbcd39cdd6 package/klish: bump for raw mode fixes, alternate quotes, etc.
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>
2024-11-17 14:31:18 +01:00
Joachim Wiberg f9a0c71b1f package/klish: make sure to select bin tools (copy, erase)
Fix #735

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 14:13:45 +02:00
Joachim Wiberg fb00719069 package/klish: bump for droprivs refactor of script plugin
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>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 3670d80034 package/klish: bump to ensure foreground daemon logs to syslog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 3269175118 package/klish: fix annoying freeze if pressing any key before prompt
Backport upstream fix, https://src.libcode.org/pkun/klish/commit/a1ecbdc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 4c3a46b288 package/klish: bump for improved error message on missing command
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>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 173e6040fe confd: allow non-admin users to use the CLI, NACM rules apply
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>
2024-06-25 17:22:36 +02:00
Joachim Wiberg b3e6a38d76 package/klish: bump for motd-like Banner="" extension for klish.conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 10:04:19 +01:00
Joachim Wiberg 257636d997 package/klish: bump for __ptype -> xml param.name fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Tobias Waldekranz f4a604f63c Prevent non-essential services from running in runlevels > 6
In case failure-config fails to load, we park the system in runlevel
9. In this state, we only want the most essential services running.
2023-11-30 11:39:42 +01:00
Joachim Wiberg 64aa3b544c package/klish-plugin-sysrepo: fix regression in release cycle
Fix regression in line-drawing characters, introduced in c38c8a4.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-11-27 14:04:45 +01:00
Joachim Wiberg c38c8a46ce package/klish: simplify, drop confusing comments
Also, change socket file path from /tmp to /run, as is customary.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-11-21 08:06:06 +01:00
Joachim Wiberg b6b03e4903 package/klish: simplify, maintain local version of klish.conf
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>
2023-11-21 08:06:06 +01:00
Joachim Wiberg 30641cb243 package/klish: fix loss of Ctrl-C to abort current line edit
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-11-21 08:06:06 +01:00
Joachim Wiberg 7cbaebc435 klish: fix line drawing characters
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>
2023-11-08 11:17:41 +01:00
Joachim Wiberg 1f618a5193 Fix #111: upgrade Klish & C:o to fix inference callbacks
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-11-07 23:36:51 +01:00
Joachim WibergandTobias Waldekranz c94733f6bd package/klish: add missing faux dependency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-14 13:00:09 +02:00
Joachim WibergandTobias Waldekranz 83e5af33ff Fix #86: rename klinfix -> klish-plugin-infix
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>
2023-08-14 13:00:09 +02:00
Joachim WibergandTobias Waldekranz 8d79235436 package/klish: bump to kkit-next, based on latest upstream
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>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz b95a82207d package/klish: switch to kkit branch @kernelkit, new features
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>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz d913ce00e6 doc/cli: relocate and extend CLI docs with intro and keybindings
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>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 3a4097c741 package: switch faux and klish to KernelKit mirrors on GitHub
No need to go fishing every time we build when we have everything we
need in the pond next door.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz a5ad52e5eb package/klish: install default type definitions for klish plugin
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>
2023-08-08 16:35:18 +02:00
Joachim WibergandRichard Alpe d2f83ef1b3 package: fix LICENSE_FILESS for klish family of packages
The packages have a misspelled license file. Sneaky

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Tobias Waldekranz e729c82c32 klinfix: Initial add
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.
2023-03-31 17:31:34 +02:00
Joachim Wiberg 737f99e35e package/klish: make sure to enable libxml2 in configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:41 +02:00
Tobias WaldekranzandJoachim Wiberg 5d8e0ec123 package/klish: Add version 3.0.0
Extensible CLI application
2023-03-28 20:29:31 +02:00