mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 22:46:20 -05:00
* Read-only SQL query endpoint for advanced users POST /api/db/query runs one read-only statement; GET /api/db/schema describes the tables. Both are refused unless `allow_database_query: true` is set in wrolpi.yaml (there is no UI for it). The connection is opened with mode=ro and an authorizer that allows only reads; queries are interrupted after 10 seconds, rows are capped, and long values are truncated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Database queries cannot be enabled through the API, and use bounded memory The config update API refuses to change `allow_database_query`; only an edit of wrolpi.yaml on the WROLPi can enable queries. Query connections refuse values over 32 MB and rows over 100 columns, rows are read one at a time, and the response stops at 5 million characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * The database query setting can be changed like any other config WROLPi is meant to be as secure as a bookshelf in your home; a LAN user who can reach the API is trusted, so gating one key in the config API adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Database queries can search FTS5 tables on SQLite 3.46 FTS5 reads `PRAGMA data_version` through the authorizer when it opens a table on SQLite 3.46 (Debian 13), so every MATCH and the schema endpoint failed with "vtable constructor failed". A denied VACUUM INTO also explains itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A config status test attaches the shared context it reads It passed only when an earlier test in the same worker had attached it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| fixtures/configs | ||
| __init__.py | ||
| common.py | ||
| test_api_fixtures.py | ||
| test_api_utils.py | ||
| test_bookmarks.py | ||
| test_captions.py | ||
| test_cmd.py | ||
| test_common.py | ||
| test_config_api.py | ||
| test_config_backup_import.py | ||
| test_config_partial_import.py | ||
| test_contexts.py | ||
| test_cross_config_disaster_recovery.py | ||
| test_dates.py | ||
| test_db.py | ||
| test_db_bootstrap.py | ||
| test_db_query.py | ||
| test_downloader.py | ||
| test_downloads_config.py | ||
| test_events.py | ||
| test_extensions.py | ||
| test_flags.py | ||
| test_fts.py | ||
| test_jobs.py | ||
| test_json_encoder.py | ||
| test_model_repr.py | ||
| test_perpetual.py | ||
| test_request_db.py | ||
| test_root_api.py | ||
| test_rss.py | ||
| test_serializers.py | ||
| test_speedtest.py | ||
| test_switches.py | ||
| test_tags.py | ||
| test_upgrade.py | ||