rcpanel 0.2.0
OpenBSD administration in the terminal

rcpanel brings a function-organized system map, service controls, package
management, kernel settings, configuration files, and your usual editor into
one terminal application. It uses Python's standard library and the system's
native tools. There is no web server, remote API, or resident panel daemon.

The Doall-style map has 12 top-level categories, 295 nodes, and 251 endpoints.
It includes 47 fixed read-only reports and links to services, files, manuals,
forms, installed programs, and package management. The configuration catalog
contains 47 default paths. Broad coverage comes from native documentation and
explicit command review; this release does not provide a custom form for every
program or command-line flag.

QUICK START

Target system: OpenBSD 7.8. Python 3.10 or newer with curses is required.
Use a terminal of at least 60 columns by 16 rows. Live mode is refused on
other operating systems. The isolated demo and portable tests also run on Linux.

If Python is not installed:

    doas pkg_add python

Choose a Python 3 branch of version 3.10 or newer if pkg_add offers a choice.
Use its installed executable, for example python3.12. Replace python3 below
when necessary; the installed launcher needs no unversioned python3 symlink.

From the extracted source directory:

    python3 ./rcpanel --demo
    python3 ./rcpanel --demo --map network
    python3 ./rcpanel --demo --programs
    python3 ./rcpanel --demo --packages
    python3 ./rcpanel --demo --status

Demo services, package data, kernel values, and reports are simulated. Its
configuration files are temporary and its program inventory is illustrative.
No native administration commands run. Opening $EDITOR still runs your actual
chosen editor on a temporary draft. Demo changes disappear on exit.

INSTALLING OR UPGRADING

On OpenBSD, using your actual Python executable:

    doas /usr/local/bin/python3.12 ./install.py

The installer records that interpreter and installs:

    /usr/local/sbin/rcpanel
    /usr/local/libexec/rcpanel/0.2.0/
    /usr/local/man/man8/rcpanel.8
    /usr/local/share/doc/rcpanel/

The launcher is replaced after the new version is installed. Upgrading from
0.1.0 keeps its old version directory and points the same launcher at 0.2.0.
Identical reinstallation is allowed. Different application code at an already
installed version is refused; changed code must receive a new version.
The launcher uses Python's -I isolated import mode.

Launch with the full path:

    /usr/local/sbin/rcpanel
    doas /usr/local/sbin/rcpanel

An ordinary account uses its native permissions; explicitly invoked programs
can perform writes those permissions allow. Service changes, configuration
installation, kernel changes, and package previews and changes require root.
The panel does not alter doas policy or elevate itself.
The installer does not register a native OpenBSD package; retain the Python
interpreter recorded in the launcher when managing installed packages.

TEXT OUTPUT

These mutually exclusive options print information without opening curses:

    --status             Service boot and runtime status.
    --map [QUERY]        Static system map, optionally filtered by search.
    --programs [QUERY]   Installed executable paths, optionally filtered.
    --packages           Installed package names and comments.

Each may be combined with --demo. --version and --help are also available.
Quotes group a multiword QUERY using your invoking shell's ordinary rules.

NAVIGATING THE MAP

The categories are System, Services, Network, Security, Storage, Users and
access, Software, Servers, Hardware, Files and schedules, Programs, and
Help/About. Selection and scroll position are remembered separately for each
menu during the session. The interface uses normal terminal colors and reverse
video for selection; no function keys are required.

    8 / 2                 Move up / down (also arrows or k / j).
    5 / 6                 Open the selection (also Enter or Right).
    4                     Return to the parent (also Escape or Left).
    0                     Return to the top-level map.
    /                     Search the static map from a map menu.
    :                     Enter a static map path, for example 3*1*1#.

The final # in a path is optional. A path only navigates to an entry; it never
executes the entry's action. Endpoint pages explain the action before offering
it. Numeric keys are ordinary text in input fields. In text viewers, Left and
Right scroll long lines horizontally; Escape or 4 returns. Home/End and
Page Up/Down help with long lists. Returning to the map discards an uninstalled
draft. Screen hints distinguish menu controls from field editing.

PROGRAMS AND NATIVE MANUALS

Programs discovers executable files in ten groups:

    /bin                 /sbin                 /usr/bin
    /usr/sbin            /usr/libexec          /usr/games
    /usr/X11R6/bin        /usr/local/bin        /usr/local/sbin
    /usr/local/libexec

Only the two libexec trees are searched recursively, to three levels below
their roots. A scan examines at most 50,000 directory entries and returns at
most 20,000 programs; omissions and access failures are reported. A minimal
installation may have no X11, games, or local-package directory.

A discovered program's identity is its full executable path. Dynamic inventory
entries do not receive invented static map numbers. Open an entry to read its
native synopsis or manual, supply arguments and an absolute working directory,
and review the exact command before running it. Arguments use shell-like
quoting without panel evaluation of pipes, substitutions, or wildcard expansion.
The program then owns the terminal and keeps its native prompts and controls.

This invocation can change the system according to the selected program and
arguments, with the panel's current privileges. It is distinct from the 47
fixed read-only reports. Discovery does not execute programs to probe their
flags, and a missing manual or executable is reported as such.

SERVICES

Services shows independent Boot and Now columns. Enable and disable change
startup configuration; start, stop, restart, and reload affect the current
daemon. Boot-only settings without an rc.d script have no daemon actions.
The panel shows unavailable or failed status queries as unknown. Runtime
classification follows rcctl's own checks; it does not independently diagnose
why an individual service script's check did not report a running daemon.

Actions require confirmation and show their command, exit status, and output.
The panel does not use rcctl -f to force disabled daemons to start. Commands
have output and time limits. A timeout can follow partial work: refresh actual
state before another action. There is no silent retry or rollback.

Service pages include rcctl settings and relevant configuration shortcuts.
Catalog paths are defaults. If daemon flags select an alternate file, inspect
those flags and open that file explicitly in an allowed configuration tree.

KERNEL SETTINGS

The kernel browser builds a searchable hierarchy from current sysctl names.
Read a value or explicitly confirm one runtime assignment. Presence in the
list does not mean that a value is writable; native read-only, invalid-value,
and permission failures are displayed without claiming success.

A runtime change does not edit /etc/sysctl.conf. That file has a separate
staged editor for persistent startup settings. Saving it does not apply the
assignments to the running kernel. Choose runtime and persistent changes
separately and review both when persistence is intended.

PACKAGES

The package browser lists installed names and comments, searches the configured
repository, and shows an installed package's description, files, dependents,
and messages. It supports install, update one package, remove, upgrade all,
and remove unused dependencies. Install selects an exact name from the latest
repository search; remove and update select an exact installed name. Searches
accept a plain package-name fragment, not URLs, local archives, or options.

Every change first runs a native noninteractive dry run. Review its output and
the exact command, then confirm. Failed or truncated previews cannot be applied.
The plan records installed names/comments and manual-install tags and checks
them again before applying. Plans are one-use; changed inventory requires a new
preview. A private advisory lock serializes panel package operations.

A dry run is advisory: it does not freeze the repository or every package DB
record. Native dependency checks and package locking remain authoritative when
other package clients operate. Package tools use the system's /etc/installurl
configuration with a fixed clean environment and working directory /; ambient
PKG_PATH and PKG_DBDIR overrides are not inherited. The panel adds no force or
unsigned-package flags.

Progress is displayed while a package change runs. Package mutations have no
automatic kill timer, so a slow operation is not killed while writing the
package database. Capture remains bounded and truncation is identified. Native
exit status and ordinary package/script output are retained. Failure may leave
partial changes; the panel neither retries nor rolls back automatically.

CONFIGURATION EDITS AND FORMS

The catalog, file browser, and custom path support files below /etc,
/var/unbound/etc, and /var/nsd/etc. Editing opens a private staged copy in
$EDITOR. Saving in the editor leaves the live file unchanged. Back in the panel,
review the diff, validate where supported, and explicitly install. Installation
rechecks the live file and candidate, backs up an existing file, and atomically
replaces that one file while retaining its ownership and permission bits.

Fourteen catalogued default files have registered native syntax checkers:
httpd, smtpd, ntpd, sshd, pfctl, doas, iked, unwind, relayd, dhcpd, bgpd, ospfd,
unbound-checkconf, and nsd-checkconf. Other files state that no checker is
registered. Checking pf.conf does not load rules. The panel does not execute
rc.conf.local to validate it. Includes and referenced files are outside the
one-file transaction; syntax acceptance does not prove working runtime behavior.

Installing a file does not issue an automatic service reload, restart, enable,
or start. Its reader determines when the new bytes take effect. In particular,
cron automatically reloads /etc/crontab, so installing it can activate scheduled
commands within a minute. Programs may read doas.conf, hosts, or resolver
settings on their next use. Review the file's effect before confirming.

Writes require regular, single-linked files owned by the invoking user and
trusted parent directories. The panel refuses symbolic links, group/other
writable paths, filesystem flags, invalid UTF-8, NUL bytes, and text over 4 MiB.
Daemon-owned files or directories can therefore be outside the editor's
supported ownership policy even when their paths are catalogued.

The HTTP form describes one server name, listener, port, document root, and
directory-listing toggle. Defaults are 127.0.0.1:8080, /htdocs inside the explicit
/var/www chroot, and listing off. Supply site content separately. The mail form
provides mbox or Maildir delivery for local clients, a lo0 listener, and optional
direct outbound delivery, off by default. Existing aliases and .forward files
still need review. There are no forms for public-mail deployment, IMAP, TLS,
certificates, DNS records, or multiple HTTP virtual hosts.

Forms reopen only files matching their complete generated format. An unfamiliar
or manually changed file opens in the editor, or can be explicitly replaced
from form defaults with a complete diff and typed target-filename confirmation.
No approximate parser silently removes unrelated configuration.

EDITOR AND TERMINAL HANDLING

doas normally builds a new environment. To carry your selection through an
allowed administrative command:

    doas /usr/bin/env EDITOR="$EDITOR" /usr/local/sbin/rcpanel

An empty EDITOR uses /usr/bin/vi. Arguments and quoted paths are accepted without
shell evaluation or expansion. The editor runs with the panel's privileges and
must remain in the foreground until editing finishes; use its wait option when
needed. A malformed command, launch failure, or nonzero editor exit is reported
without installing the draft.

Ctrl+C exits an ordinary panel menu and works normally in the foreground
editor. During a panel-managed job it does not abandon the worker. SIGHUP and
SIGTERM are deferred until that job finishes, then the panel closes. This also
applies to package writes, which have no automatic deadline. A completed change
remains installed if the terminal disconnects before displaying its result;
inspect current state when reconnecting.

BACKUPS AND RECOVERY

Existing files are backed up beside the target in .rcpanel-backups. Directories
are private (0700), backup files are private (0600), and installation reports
the exact path. Backups are not expired automatically. A previously absent
file has no prior contents to back up. To restore, use the target's restore
action and enter its exact backup path; restoration is another reviewed and
validated installation with a fresh backup and the same file-reader effects.

Enable, disable, and flag changes back up an existing rc.conf.local before
rcctl runs. A failed rcctl result is shown without pretending this external
command was an atomic file transaction.

The configuration advisory lock coordinates panel instances, including edits
in the two DNS configuration trees. Other root programs need not honor it.
Observed conflicts stop installation, but another root process can still race
the final replacement. Backups do not snapshot runtime state or included files.
After a crash, private .rcpanel-stage-* directories may need inspection and
cleanup; do not remove one while another panel is editing it.

DEVELOPMENT AND NATIVE ACCEPTANCE

    python3 -m unittest discover -s tests -v

Tests use temporary files, simulated backends, and harmless child processes.
They cover transaction failures, argument handling, streaming, package-plan
freshness, forms, and navigation. Native OpenBSD behavior remains unverified
until the supplied docs/OPENBSD-CHECKLIST.txt is completed on a disposable test
machine. Portable test success is not native acceptance.

See docs/DESIGN.txt for boundaries, docs/SYSTEM-MAP.txt for the static map index, and
docs/rcpanel.8 for the command manual. Current test results are supplied in
docs/TEST-RESULTS.txt.

Primary OpenBSD 7.8 references:

https://man.openbsd.org/OpenBSD-7.8/rcctl.8
https://man.openbsd.org/OpenBSD-7.8/sysctl.8
https://man.openbsd.org/OpenBSD-7.8/sysctl.conf.5
https://man.openbsd.org/OpenBSD-7.8/pkg_info.1
https://man.openbsd.org/OpenBSD-7.8/pkg_add.1
https://man.openbsd.org/OpenBSD-7.8/pkg_delete.1
https://man.openbsd.org/OpenBSD-7.8/httpd.conf.5
https://man.openbsd.org/OpenBSD-7.8/smtpd.conf.5
https://man.openbsd.org/OpenBSD-7.8/cron.8
https://man.openbsd.org/OpenBSD-7.8/crontab.5
https://man.openbsd.org/OpenBSD-7.8/doas.1

Design by remfan1994. Published by ThatIAm.vip.
