Commit graph

17 commits

Author SHA1 Message Date
fusion44
6e3238a5a7
feat(api): implement GET /system/health readiness endpoint (#145)
Make /system/health unauthenticated, compute real readiness from the
shared startup state via build_health_info, and return 503 (body still a
SystemHealthInfo) when a subsystem is not ready. Drop the now-dead
per-backend get_system_health delegation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 18:41:18 +02:00
fusion44
a98e9372b0
refactor(api): Event enum + broadcast_msg over WebSocket
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 18:41:18 +02:00
fusion44
b8677cbbf1
fix(system): tolerate empty hardware Redis values on VM setups
Some checks failed
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
On VM installs (e.g. Proxmox) the RaspiBlitz monitor scripts don't
populate keys like system_cpu_load / system_ram_mb / system_temp_celsius,
so redis returns empty strings. get_hardware_info did int('')/float('')
and raised ValueError, which killed the _handle_gather_hardware_info
background task ('Task exception was never retrieved') - hardware SSE
updates then stopped until restart.

- parse the hardware Redis values via _safe_int/_safe_float, returning
  zero values instead of crashing (and guard the vram-percent division
  by zero)
- wrap the gatherer loop body in try/except so a single failure can no
  longer kill the task

Fixes #271

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 14:45:21 +02:00
fusion44
cf423f52c1
fix(system): stop native_python impl swallowing errors into None
@logger.catch defaults to reraise=False, so change_password and
get_debug_logs_raw - which raise NotImplementedError - silently
returned None. The service layer's 'except NotImplementedError -> 501'
never fired, yielding '200 null' or a response-model 500 instead.
login likewise turned unexpected errors into a None result.

Drop the pointless decorator from the two methods that only raise, and
let login reraise so failures surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 21:44:25 +02:00
fusion44
c4afca50e9
fix(system): stop leaking passwords via change-password endpoint
The change-password endpoint accepted old_password/new_password as bare
str parameters, i.e. query parameters, so the passwords ended up in
access logs, proxy logs and browser history. Accept them in a
ChangePasswordInput request body instead.

Also mark the RaspiBlitz blitz.passwords.sh check/set invocations
sensitive=True so the plaintext passwords are not written to the debug
log, and guard against a missing password type (was an AttributeError
-> 500).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 21:42:25 +02:00
fusion44
07d2bfbc76
feat: update Python and Devenv deps
- Updated all dependencies to their latest versions
- Vendored fastapi-plugins[redis] as it looks unmaintained
2026-02-03 11:04:41 +01:00
fusion44
2b98912796 feat: replace call_script func with better func
use exec_bash_command instead

refs #123
2025-05-06 09:16:46 +02:00
fusion44
25e4be8441 feat: make config loading more flexible
If the environment variable BAPI_ENV_PATH is set, the config system will
try to read configs from the given path instead of .env in pwd

If no file is found .env in pwd will be used as a fallback

Env variables will always override settings in .env files.
2025-03-23 17:43:39 +01:00
fusion44
40880154eb
feat: implement system/health endpoint
This currently does nothing but return true. This can be used
as a ping endpoint to see if the API is running and reachable.
2024-02-20 19:56:11 +01:00
pre-commit-ci[bot]
9bd14d161a
[pre-commit.ci] pre-commit autoupdate (#240)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.2.0](https://github.com/psf/black/compare/23.12.1...24.2.0)
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-18 12:11:15 +01:00
fusion44
adf472ac8b feat: implement Ruff as a linter; fix given errors 2023-06-25 07:17:00 +02:00
fusion44
71ad84e704
feat: improve logging and error handling 2023-04-21 22:58:29 +02:00
pre-commit-ci[bot]
3d1dfd919c
[pre-commit.ci] pre-commit autoupdate (#187)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-11 13:47:34 +01:00
/rootzoll
5703263b13
#179 add identity_uri to ln_info_lite (#183)
* #3260 allow selected special chars password check

* #179 add identity_uri

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-20 07:43:37 +01:00
/rootzoll
5b8901701b
#160 fix 500 TERM error (#175)
* #160 fix 500 TERM error

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-18 10:20:51 +01:00
fusion44
b1228e1f9e
feat: implement codeVersion field on RaspiBlitz
refs https://github.com/rootzoll/raspiblitz/issues/3429
2022-12-11 20:04:38 +01:00
fusion44
ba453e7bdb
refactor: switch to domain driven directory layout 2022-10-03 20:22:00 +02:00