2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 06:35:33 +00:00
Commit Graph

3492 Commits

Author SHA1 Message Date
Markus Hilger f25d121fc5 Version the Python package rpms with ~dev as well
confluent_client and confluent_server rpms took the PEP 440 version
setup.py needs, 4.0.1.dev5+g..., which rpm sorts after 4.0.1: a
released package did not upgrade a development build of it. Stamp the
rpm with the ~dev form the other packages already use and keep .dev only
for setup.py and the sdist name. The debs already sort right, since
stdeb rewrites .dev to ~dev.
2026-10-15 19:20:16 +02:00
Markus Hilger b1ed925e40 Fall back to libcrypt when no crypt module imports
Python 3.13 dropped crypt from the stdlib, and openSUSE Leap 16 packages
neither legacycrypt nor crypt_r, so the server did not start there
without a pip install. Both of those only call crypt(3) from libcrypt,
which every distribution ships, so do that through ctypes as the last
resort, serialized because crypt(3) returns a static buffer. Its hashes
match the stdlib module byte for byte.

Move the import chain both callers carried into confluent.pwcrypt. The
legacycrypt Recommends is no longer needed.
2026-10-15 19:20:16 +02:00
Markus Hilger b86e0aa27f Make webauthn and eficompressor optional server dependencies
Neither is packaged by EPEL or Ubuntu, so the hard dependency made the
server uninstallable there without --nodeps or a stub package. Both are
already optional in the code: httpapi drops passkey support when
webauthn does not import, and the Lenovo IMM2 BIOS settings path reports
the missing module as unsupported functionality. Recommend them instead,
as the SUSE branch already does for webauthn.

See xcat2/confluent#192.
2026-10-15 19:20:16 +02:00
Jarrod Johnson 3bb3b48cd0 Remove directive ruff doesn't need or want 2026-10-14 09:07:30 -04:00
Jarrod Johnson 7460f66e23 Workaround some bad pysnmp assumptions about importing importlib 2026-10-14 09:04:43 -04:00
Markus Hilger 1b446f4773 Add empty nodegroup hint to ssh.trustnodes 2026-10-13 18:52:22 +02:00
Jarrod Johnson 28316ae9bd Make close async 2026-10-12 15:24:22 -04:00
Jarrod Johnson 3d805fa342 Fixup for closing vnc session 2026-10-12 13:27:56 -04:00
Jarrod Johnson eb6c026ac8 Enable aggressive rescan to specifically note Lenovo XCC 2026-10-09 16:58:02 -04:00
Jarrod Johnson a6e89c1543 Fix register
Ensure info_identifier is set if it was not set by way of safe_detected first.
2026-10-09 16:44:51 -04:00
Jarrod Johnson ea926aab12 Improve snoop behavior
For one, at the time an XCC emits a NOTIFY, it's DeviceDescription.json is also very sluggish.  Extend timeout
knowing this may be delayed.

Further, if snoop comes back with only one address family, do not
perturb existing address families.
2026-10-09 16:32:49 -04:00
Jarrod Johnson 5a201e1bde Handle pysnmp5 from ubuntu 24.04 repos 2026-10-09 15:26:41 -04:00
Laurence bf94c84da4 proxmox: pin the API certificate where it can be stored; accept API tokens
- A manager that is not a confluent node is pinned on the guest's node
  (pubkeys.tls_hardwaremanager), as the console already does.
- user@realm!tokenid with the token secret is accepted as the login;
  VNC needs a password login and says so.
2026-10-08 22:04:29 +01:00
Laurence 8c743b934c InputBootDevice: keep a per-node persistent flag as the persistent flag
A per-node request stored 'persistent' in bootmodebynode, so
persistent() stayed False and bootmode() returned a boolean.
2026-10-08 22:04:26 +01:00
Laurence 4fada65934 proxmox: fix the plugin's error handling, power and boot order
- Route every API call through one checked path: non-2xx answers raise
  with PVE's message, a 401 logs in again, a migrated guest is re-mapped.
- Report login failures other than 401 instead of a TypeError.
- Power changes are bounded and reported per node; 'on' when on is a
  no-op; every live QEMU state counts as on.
- Read and set the boot order in every form PVE accepts, keeping disks.
- Stop toggling Content-Type on the shared client headers.
- Inventory from the current config, all SMBIOS forms.
- Refuse ambiguous guest names; skip templates.
- Keep the serial console alive and report how it ends.
- Let the self-test run without a config manager.
2026-10-08 22:04:24 +01:00
Jarrod Johnson 1c1a56f764 Merge pull request #306 from Obihoernchen/proxmox-vnc-manager
Connect Proxmox VNC sessions through the manager
2026-10-08 14:35:35 -04:00
Jarrod Johnson 97ded65130 Avoid incurring some warnings
asyncssh relationship with cryptography can be messy, but it's not up to us, so discard those.

Change osdeploy to not use fork to avoid that deprecationwarning.
2026-10-08 14:10:45 -04:00
Jarrod Johnson 52fb5c42dd Offer boot.ipxe if boot.ipxe.shim does not exist. 2026-10-07 19:29:20 -04:00
Markus Hilger 6cc0567c2d Connect Proxmox VNC sessions through the manager
The vncwebsocket URL used the name of the Proxmox node running the
guest as host. That name often does not resolve on the management
node, and the fingerprint checked is the one of the manager anyway.
Connect to the manager instead, which forwards the websocket to the
right node.
2026-10-08 01:27:56 +02:00
Jarrod Johnson def5fa3753 Have a separate file for shim boot
Legacy boot with iPXE adapters will cause issues with the relatively new 'shim'
command.  It's useless for BIOS anyway, so omit it.
2026-10-07 19:10:46 -04:00
Jarrod Johnson dfe5627609 Fix askpass location 2026-10-07 18:53:19 -04:00
Jarrod Johnson 346bfa41b9 Remove cleanup for no longer existing directory 2026-10-07 17:36:10 -04:00
Jarrod Johnson fed7a2ba74 Change from a dynamically written askpass
/tmp can be hardened to noexec, /run is also sometimes noexeced.

However, we don't need a varying askpass, so just do one in a libexec directory.
o
2026-10-07 17:30:15 -04:00
Jarrod Johnson c0c5d39a8c After successful set of an attribute, clear any now-stale broken diagnostic infoa 2026-10-07 07:53:37 -04:00
Jarrod Johnson 33165fc750 Make sure parent directories to a shim are world accessible for web server 2026-10-01 11:50:24 -04:00
Jarrod Johnson 8c4bddef7b Try to identify currently communicating redfish bmc in discovery
Some devices have multiple BMCs, but we don't know
the 'right' one.

In such a scenario, search for BMC NICs for any that match the address we are using.
2026-09-29 16:48:25 -04:00
Jarrod Johnson 838a017563 Allow cachied sensor readings up to a second old.
In the process of reworking cache logic, a temporary disabling was left in.

Before the logic change, 'cache' of '1' meant 'True', but the intent was a max age to decline to reply.  This allows very close together requests to be cached.
2026-09-28 16:10:12 -04:00
Jarrod Johnson 649eb107d7 Prevent async protocol violation
The callback registration can result in a callback before we send ASYNCID.

Guard by waiting for readiness to be signaled by loop.
2026-09-28 15:06:38 -04:00
Jarrod Johnson a7f1511c78 Provide method for user to query whether API keys are active.
We don't have a record of all API keys, but we can at least indicate whether any have been provisioned and are valid.
2026-09-28 14:59:13 -04:00
Jarrod Johnson a1df0c6939 Users can request and revoke API keys
Proivde support for API keys.  Users can register by doing a POST like:
/confluent-api/sessions/current/apikey/create with body of '{"expiration":null}

API keys can be reset by doing a POST to /confluent-api/sessions/current/apikey/revokeall

A secret is provisioned per user to allow them to clear all keys, while remaining mostly stateless to avoid having to manage every key server side.
2026-09-28 11:34:17 -04:00
Jarrod Johnson dbe194d6fb Supersede generic behavior for SMM3
SMM3 puts everything on chassis, expose that.
2026-09-25 17:03:14 -04:00
Jarrod Johnson ae1afcabf8 Replace generic unsupported error with more specific
The generic error was unclear for a fairly common attempt to check power state.
2026-09-25 16:50:49 -04:00
Jarrod Johnson 03a3786f93 Fix webauthid keyname in user 2026-09-25 16:18:39 -04:00
Jarrod Johnson 2759404f4c Merge remote-tracking branch 'xcat/master' 2026-09-25 16:14:34 -04:00
Jarrod Johnson a31d1a9efa Stub out useless 'system' for SMMv3
SMMv3 is really a BMC without a 'system', reflect that by stubbing out the system information.
2026-09-25 16:13:40 -04:00
Markus Hilger 913029e19b Send If-Match only with the EUREKA discovery PATCH requests
The password change and the account update set If-Match: * on the
connection itself, and after a forced password change that connection
is handed back, so every later request carried it. Pass the header
with the PATCH alone. Also drop an unused asyncio import.
2026-09-25 19:22:38 +02:00
Markus Hilger 1bf8c01867 Report node health and unreachable nodes from EUREKA health
get_health looked only at each node's State, so an Enabled node whose
Health was Warning or Critical left the chassis reported as ok. It also
skipped a node whose resource could not be read, counting it as
healthy while an unreadable chassis was flagged. Report the node's
Health when it is not OK, and a node that cannot be read as
Unreachable.
2026-09-25 19:22:38 +02:00
Markus Hilger 38e94c73d6 Read EUREKA sensors with $expand when the firmware supports it
The sensor collection has 668 members, and reading each one on its own
takes about 92 seconds and rebuilds on every nodesensors call. Opt in
to $expand=. for that collection, checking once whether the firmware
really inlines the members, so firmware that ignores $expand keeps the
per-member reads.
2026-09-25 19:02:39 +02:00
Markus Hilger 859a8db873 Reseat EUREKA nodes with the Reseat reset type
ForceRestart only restarts the host, so the node BMC kept running and
a reseat did not recover a hung one. The EUREKA firmware provides a
Reseat reset type that removes all power from the slot.
2026-09-25 19:02:39 +02:00
Markus Hilger 7cc8972170 Skip CPU temperatures from unbooted EUREKA node BMCs
A node whose BMC is not reporting returns Reading 0 from its
temperature sensors, dragging averages down with meaningless
values. The ComputerSystem Oem data flags this via HasBMCMetrics;
skip such nodes, and keep collecting when the flag is absent.
2026-09-25 19:02:39 +02:00
Markus Hilger e59230c63a Pass rootinfo through to EUREKA OEM handler
The service root was already fetched by the caller; dropping it
forced OEMHandler.create to request /redfish/v1/ again.
2026-09-25 19:02:39 +02:00
Markus Hilger 4d952892b1 Report detail and severity from EUREKA health
get_health collected an issues list but returned it nowhere, and
flattened every problem to Warning. Return the findings as
badreadings using SensorReading, honor verbose, and map chassis
health through _healthmap so Critical is no longer downgraded.
2026-09-25 19:02:39 +02:00
Markus Hilger 5399ba25a0 Fix EUREKA CPU temperature readings
The sensor URL was built as BMC{N}CpuCPU{X}Temp instead of
BMC{N}CPU{X}Temp, so every request returned 404. The entries also
referenced const.SensorUnits, which does not exist, and used a
dict shape the only consumer, get_average_processor_temperature,
cannot read - it expects thermal-style dicts with ReadingCelsius.
2026-09-25 19:02:39 +02:00
Markus Hilger d8f4049115 Fix password change handling in EUREKA discovery
util.json_loads does not exist, so the PasswordChangeRequired flow
raised AttributeError on every 401, silently swallowed by the blanket
except. Use json.loads, which accepts the bytes body directly.
2026-09-25 19:02:39 +02:00
Jarrod Johnson a657c7d64c Merge pull request #304 from Obihoernchen/fix/redfish-health-and-manager
Redfish: tolerate a missing sensor Health and a missing manager
2026-09-25 13:00:16 -04:00
Markus Hilger 40b1bf5e3b Report a missing redfish manager instead of raising TypeError
ManagedBy is optional, and when a system does not link a manager
get_bmcurl() answers None. Most callers passed that straight into a
web request, which failed with "Constructor parameter should be str"
from the url library. Route those callers through bmcinfo(), which now
raises UnsupportedFunctionality so confluent reports it plainly. The
event log falls through to its system and chassis fallback, and
list_media lists nothing, since neither needs a manager.
2026-09-25 17:55:05 +02:00
Jarrod Johnson 4d2bb02ea1 Fix cooltera pdu sensor read 2026-09-25 09:33:01 -04:00
Markus Hilger 5050580bb8 Stop redfish sensor health from raising on a missing Health
SensorReading computed health and states with .get() and then
overwrote both with a strict lookup, so a sensor whose Status lacks
Health, or carries a value outside the health map, raised KeyError
and aborted the whole sensor listing. Keep the tolerant lookup, and
drop the states of a reading that is OK, as the copy in command.py
already does.
2026-09-24 21:47:41 +02:00
Jarrod Johnson 5aecc483e0 Fixup malformed UUID in redfishbmc
Now that redfishbmc is wired up, have it fixup odd formatting of UUID.
2026-09-23 16:03:29 -04:00
Jarrod Johnson 6650a33150 Fix generic-ssh for a number of scenarios 2026-09-23 15:20:39 -04:00