2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-05 04:27:56 +00:00
Commit Graph

202 Commits

Author SHA1 Message Date
Jarrod Johnson a9da8ab3d3 Fix httpapi getaddrinfo
Another area that failed to get the positional arguments converted to keyword.
2026-08-19 11:24:41 -04:00
Jarrod Johnson ec64a6d46c Change to asyncio based name lookup in various places 2026-08-19 10:28:55 -04:00
Jarrod Johnson 985aff2c1a Allow ipv4 address extraction on web open with fe80::
If using fe80::, ask for more viable global addresses automatically.
2026-08-18 16:44:47 -04:00
Markus Hilger 8a3fce85c0 Fix undefined names (F821)
Every one of these raises NameError if its code path is reached:

- nodeapply: run_automation accumulated into an exitcode that only existed
  in run(), so any automation error crashed instead of being reported.  It
  now keeps and returns its own, tracked separately from the exit code of
  the ssh commands: the early exit after the spawn loop tests that one,
  and folding automation failures into it would exit with children already
  running and their pipes abandoned.  Both are reported at the real exits.
- nodeconsole: redraw() reads firstnodename, which was local to
  do_screenshot(); promote it to a module global like the other drawing
  state.
- nodedeploy: the redeploy path appended to a lockednodes list that did not
  exist yet.  The block that follows re-reads the same lock state and acts
  on it, so drop the dead duplicate.
- samples/nodeattrib_from_switch.py, misc/filterpasswd: missing import sys.
- xcc3: fixuuid was never imported.  xcc imports xcc3, so take a local copy
  the way the smm handler does instead of creating an import cycle.
- httpapi: the async session call still passed the WSGI-era env and an
  extra argument to handle_async(), which has taken only querydict since
  the aiohttp port.  Calling it correctly exposed that handle_async()
  registers an AsyncSession before raising on the discontinued long poll
  path, so every request to it would leak a session that is never reaped.
  It now only creates one when there is a websocket handler to yield it to.
- messages: the InputFirmwareUpdate.filename property checked
  self.filebynode[node] with no node in scope.  __init__ already validates
  every expanded path and nodefile() rechecks per node, so drop the checks.
- pam: drop the python2 branches referencing unicode and raw_input.  The
  server has been python3 only since the asyncio port.
- cooltera: the sensor-name listing referenced a nonexistent sensors dict.
  The available sensors depend on the model, which is only known after
  reading the device, so list them from the same status data the readings
  use.
- deltapdu, eatonpdu, geist: the not-implemented response in update() used
  node outside the loop, unlike retrieve() in the same files and unlike
  raritan/enlogic.
- confluentdbgcli: stray self. on a module-level socket connect.
2026-08-10 05:32:00 +02:00
Jarrod Johnson 5111652e01 Fix spurious log on impossible passkey requests 2026-07-29 09:03:56 -04:00
Markus Hilger ab6eeb3ced Merge branch 'master' into ruff 2026-07-14 05:28:53 +02:00
Markus Hilger 2af402b13c ruff auto fixes
Apply ruff's safe autofixes.
The changes are mechanical and behaviour-preserving. Issues fixed:

- F401: remove unused imports.
- F841: drop unused local variables and assignments, including discarded
  await/return values, unused "except ... as e" bindings, and unused
  "with ... as name" targets.
- F541: remove the f prefix from f-strings that contain no placeholders.
- E711: compare against None with "is"/"is not" instead of "=="/"!=".
- E712: test truthiness directly instead of comparing to True.
- E713: use "x not in y" instead of "not x in y".
- E714: use "is not" instead of "not ... is".
- E731: convert lambdas bound to a name into def statements.
- W291/W293: trim trailing whitespace on touched lines.
2026-07-14 05:03:58 +02:00
Markus Hilger ca6a54ab05 Fix asynchronous console control dispatch 2026-07-13 02:50:12 +02:00
Markus Hilger b5e0e9f9e4 Fix asynchronous console and shell contracts 2026-07-13 02:50:11 +02:00
Jarrod Johnson e41a844aa3 Further tighten routing for "special" cases
Mitigate risk of misdirection through more explicit routing rules.
2026-07-08 11:56:48 -04:00
Jarrod Johnson c9adc7690a http api fixes
Instead of returning a sessionless authdata if webauthn loaded and validation requested, raise a not found indicating missing webauthn module.

Fix str being passod to rsp_write for the 403 return.

Ensure the console and shell session logic triggers only for subordinates of nodes or noderange.

Fix  str being passed to rsp.write for the successful console session
2026-07-08 11:27:26 -04:00
Jarrod Johnson ec0ab527b2 Fix exception name 2026-07-07 16:56:32 -04:00
Jarrod Johnson 25a6fb82d4 Correct exception name in passkey denial 2026-07-07 16:47:50 -04:00
Jarrod Johnson 8e75585f7d Fixes for shell session operation in select paths
The classic console interface is restored.
2026-07-07 16:39:35 -04:00
Jarrod Johnson 57a4c840cb Fix web shell sessions 2026-07-01 14:47:42 -04:00
Jarrod Johnson ac9fd075b9 Remove use of deprecated get_event_loop 2026-06-04 13:36:11 -04:00
Jarrod Johnson 2586393a45 Implement unix socket permission controls 2026-05-07 10:07:08 -04:00
Jarrod Johnson 75776b77a3 Provide mechanism for client session loss to trigger a teardown 2026-04-29 15:20:39 -04:00
Jarrod Johnson d2f23b475f Fix some failure to await 2026-04-29 11:47:55 -04:00
Jarrod Johnson ae5afc526a Fix missing rsp on return 2026-04-29 11:41:33 -04:00
Jarrod Johnson 1f969f2962 Fixes for accel redirect and port forwarding 2026-04-28 16:27:12 -04:00
Jarrod Johnson 16c99efda7 Correct firmware update through http api 2026-04-28 15:33:18 -04:00
Jarrod Johnson 83ac9af196 Fix for staging in async 2026-04-28 15:02:00 -04:00
Jarrod Johnson 17d3022caf Implement username by passkey 2026-04-24 15:31:16 -04:00
Jarrod Johnson 056d690db0 Fully fix webauthn as implemented 2026-04-23 17:46:34 -04:00
Jarrod Johnson bf6a097083 Simplify webauthn implementation
Stop tracking sign counters (which weren't used).

Remove various management of transient challenges.

Co-authored-by: Copilot <copilot@github.com>
2026-04-23 12:52:47 -04:00
Jarrod Johnson 82744c5d52 Simplify webauthn code in httpapi
Co-authored-by: Copilot <copilot@github.com>
2026-04-22 14:17:39 -04:00
Jarrod Johnson 96d368fda6 Push second part of the webauthn rework
Co-authored-by: Copilot <copilot@github.com>
2026-04-22 10:58:59 -04:00
Jarrod Johnson 3fecec7743 Change webauthn to aiohttp
Co-authored-by: Copilot <copilot@github.com>
2026-04-22 10:55:49 -04:00
Jarrod Johnson 2c9b2a93f3 Rework async session handling 2026-04-20 17:05:39 -04:00
Jarrod Johnson 6c6dbf9c2b Fix references to headers 2026-04-20 16:53:57 -04:00
Jarrod Johnson 2835e9e804 Fix references to start_response 2026-04-20 16:39:51 -04:00
Jarrod Johnson 2650b11421 Rework consolesessieon to async create function 2026-04-17 16:15:03 -04:00
Jarrod Johnson 2c75571a84 Fixes to allow a test deployment to complete under asyncio 2026-03-04 10:47:33 -05:00
Jarrod Johnson d5c85cdff9 Fix async bind handling 2026-02-04 09:51:10 -05:00
Jarrod Johnson 0dabccaec8 Corrections after some mistakes in the merge 2026-01-20 14:55:06 -05:00
Jarrod Johnson d89305ca42 Merge branch 'master' into async
Try to merge in 2025 work into async
2026-01-20 14:24:01 -05:00
Jarrod Johnson fca0119331 Amend URL shortening
302 works for iPXE, but not for more limited UEFI
http client.

If we are dealing with UefiHttpBoot, check for a header
from nginx config and use X-Accel-Redirect to induce proxy side
redirect transparent to client.

Otherwise, give an error indicating the issue with the profile
name length and incompatibility with Apache capabilities.
2025-05-13 11:41:11 -04:00
Jarrod Johnson d0ae7b46ae Disable the HTML API explorer
It may be the case that no one uses it.
2025-05-02 16:21:47 -04:00
Jarrod Johnson 57ada3728c Change default host to localhost only
Also, fix support for IPv4 addresses as bind_host
2025-05-02 16:18:28 -04:00
Jarrod Johnson 6402861f4c Provide custom node secret attributes
This allows for confluent to pass node secret data through.
2025-03-13 14:22:26 -04:00
Jarrod Johnson 9136341bda Tolerate different proxy pass configurations
The stock reverse proxy configuration strips the leading
'/confluent-api/' from the URL.

However, when doing a custom reverse proxy set up, one may preserve full
path without knowing which way to go.

Since '/confluent-api/' will never be used inside the api, just strip
it when detected to tolerate either of the likely proxy pass behaviors.
2025-03-11 11:38:05 -04:00
Jarrod Johnson b4b011663e Handle more forms of confluent headers
Some frameworks won't allow headers through, normalize case
and normalize _ presence.
2025-03-05 17:14:28 -05:00
Jarrod Johnson 9b59c2fadb Have httpapi support multiple shell sessions 2025-02-06 13:25:39 -05:00
Jarrod Johnson e3d70f351d Provide internal URL shortening service
Permit users to have very long profile names, and provide
a URL shortening service to bridge the gap for fixed-width
field limitations in DHCP/PXE.
2025-01-22 15:44:49 -05:00
Jarrod Johnson e2bb72cc14 Allow Unix socket for http socket
If service.cfg has:
[http]
bindhost = /var/run/confluent/httpapi

Then it will use the cited path to create a unix socket instead
of a network socket.
2025-01-08 15:59:48 -05:00
Jarrod Johnson d66df7ee4b Merge branch 'master' into async
Need to rework httpapi further for changes to the firmware staging.
2025-01-08 14:23:52 -05:00
Jarrod Johnson f1f433041c Restore underscore headers
Eventlet has "helpfully" stopped supporting headers with
underscores.  Restore them since we want to support
backwards compatibility and do not have the option to
just ignore existing clients.
2024-11-26 12:09:04 -05:00
Jarrod Johnson 5df30881f8 Provide resource to check if http has been initialized
This allows clients to know if they need to direct user to do
early setup procedures.
2024-11-11 15:31:12 -05:00
Jarrod Johnson b05b36484b Fix file staging in http api 2024-10-10 12:52:28 -04:00