gramps-webapi 3.25.0__tar.gz → 3.25.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/PKG-INFO +2 -2
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/ROADMAP.md +2 -20
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/env.py +42 -6
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/_version.py +1 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/__init__.py +12 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/cache.py +14 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/file.py +8 -5
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/image.py +6 -4
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/__init__.py +8 -3
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/agent.py +76 -18
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/tools.py +5 -3
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/media.py +4 -4
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/citations.py +1 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/dna.py +7 -2
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/s3.py +2 -2
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/search/text.py +3 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/util/celery.py +25 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/PKG-INFO +2 -2
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/SOURCES.txt +3 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/requires.txt +1 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/pyproject.toml +1 -1
- gramps_webapi-3.25.2/tests/test_celery_logging.py +53 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_etag.py +11 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_file.py +10 -1
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_post.py +26 -0
- gramps_webapi-3.25.2/tests/test_llm_history.py +217 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_search_text.py +9 -0
- gramps_webapi-3.25.2/tests/test_user_db_migration.py +101 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.devcontainer/Dockerfile +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.devcontainer/devcontainer.json +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.devcontainer/docker-compose.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.dockerignore +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.editorconfig +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.flake8 +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/workflows/base-image-pr.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/workflows/base-image.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/workflows/image.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/workflows/pypi.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.github/workflows/test.yml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.gitignore +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.pre-commit-config.yaml +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.pylintrc +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.vscode/extensions.json +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.vscode/launch.json +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.vscode/settings.json +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/.vscode/tasks.json +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/AGENTS.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/CLAUDE.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/CODE_OF_CONDUCT.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/CONTRIBUTING.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/Dockerfile +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/Dockerfile.base +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/LICENSE +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/MANIFEST.in +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/README.md +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic.ini +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/README +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/script.py.mako +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/2082445b0769_add_oidc_accounts_table_for_secure_.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/22c8d1fba959_add_trees_enabled.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/4b7f9d2e6c01_add_web_push_subscriptions.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/66e56620891a_add_trees_table.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/6d8f3cb50b71_add_persistent_access_tokens_table.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/7b2e9f4c1a63_allow_several_access_tokens_per_scope.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/84960b7d968c_use_bigint_for_quota_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/9c4d2e7a5b18_track_task_lifecycle.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/a8e57fe0d82e_add_columns_for_ai_quota.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/b0582f54029c_use_bigint_for_usage_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/b2c3d4e5f6a7_add_tree_config_column.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/b6f1d3a9c2e4_add_token_version_to_user.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/c1d2e3f4a5b6_merge_task_tree_and_tree_config.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/c89728e71264_.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/d4e9a1c7b3f2_drop_unique_constraint_on_user_email.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/e176543c72a8_add_tree_column_to_user.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/e5e738d09fa7_added_configuration_table.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/alembic_users/versions/f3a1c8e92b47_add_task_tree_table.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/docker-entrypoint.sh +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/__main__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/access/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/access/db.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/access/policy.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/access/sanitize.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/auth.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/backup.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/backup_store.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/blueprint.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/check.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/deprecations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/dna.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/emails.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/export.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/faces.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/html.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/deps.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/render.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/media_importer.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/people_families_cache.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/ratelimiter.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/report.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/access_tokens.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/anniversaries.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/backups.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/base.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/bookmarks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/chat.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/config.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/db_backend.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/delete.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/emit.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/events.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/export_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/exporters.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/face_detection.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/facts.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/families.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/file.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/filter_param_types.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/filters.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/history.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/holidays.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/import_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/importers.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/living.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/match.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/merge.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/metadata.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/name_formats.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/name_groups.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/notes.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/object_query.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/objects.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/ocr.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/oidc.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/oidc_accounts.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/people.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/places.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/push_subscriptions.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/relations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/reports.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/repositories.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/restore.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/schemas.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/search.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/sort.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/sources.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/tags.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/tasks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/timeline.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/token.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/transactions.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/translations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/trees.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/types.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/user.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/util.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/verify.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/ydna.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/search/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/search/indexer.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/search/query.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/search/schema.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/snapshot.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/tasks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/telemetry.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/api/util.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/app.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/const.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/oidc.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/oidc_helpers.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/passwords.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/auth/sql_guid.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/celery.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/config.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/const.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/data/empty_gramps_auth.cfg +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/data/example_gramps_auth.cfg +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/data/face_detection_yunet_2023mar.onnx +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/data/test_auth.cfg +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/dbloader.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/dbmanager.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/alive.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/relationship.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/logging_utils.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/profiler.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/sentry.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/static/index.html +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/templates/confirmation.html +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password.html +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password_base.html +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password_error.html +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/translogger.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/types.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/undodb.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/util/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/util/task_state.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/verify_lib.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/webpush.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi/wsgi.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/dependency_links.txt +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/top_level.txt +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/mypy.ini +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/requirements-dev.txt +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/scripts/s3_rename.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/scripts/search_benchmark.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/scripts/start_dev_container.sh +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/setup.cfg +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/setup.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/conftest.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_access.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_check.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_cli.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_close_db.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_db.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_delete.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_deprecations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_dna_match_parser.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/__init__.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/checks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_access_tokens.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_anniversaries_ics.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_backups.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_bookmarks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_chat.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_citations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_config.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_db_handle.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_delete.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_dna.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_events.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_exporters.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_facts.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_families.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_filters.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_history.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_holidays.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_import_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_importers.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_list_paging.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_living.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media_archive.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media_usage_sync.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_merge.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_metadata.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_name_formats.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_name_groups.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_notes.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_object_query.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_object_query_where_tree.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ocr.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc_accounts.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc_link.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_paging_sort.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_people.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_people_query.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_place_coordinates.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_places.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_profiler.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_push_subscriptions.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_put.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ready.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_relations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_repair.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_reports.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_repositories.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_restore.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_s3.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_search.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_sources.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_tags.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_tasks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_timelines.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token_revocation.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token_sync.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_transactions.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_translations.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_treeless_admin.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_trees.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_types.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_upload.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_user.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_verify.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_webpush_delivery.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ydna.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_endpoints/util.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_face_detection.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_file.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_future_gramps_alive.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_future_gramps_relationship.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_image.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_import_util.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_jwt.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_limiter.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_llm_agent.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_llm_errors.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_llm_render.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_llm_tools.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_logging_utils.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_map_tile.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_media_importer.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_media_prefix_tree.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_migrate_grampsdb.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_missing_references.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_object_query_parsing.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_oidc_auth.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_openapi_operation_ids.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_password.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_postgres_driver.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_privacy_canary.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_private_proxy.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_private_proxy_backlinks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_s3.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_search_api_updates.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_search_index.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_search_oracle.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_sentry.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_server_locale.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_shared_postgresql.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_snapshot.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_sort_raw_data.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_sort_sql.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_sqlauth.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_static_files.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_task_error.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_task_state.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_tasks.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_telemetry.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_undodb.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_util.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_verify_lib.py +0 -0
- {gramps_webapi-3.25.0 → gramps_webapi-3.25.2}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gramps-webapi
|
|
3
|
-
Version: 3.25.
|
|
3
|
+
Version: 3.25.2
|
|
4
4
|
Summary: A RESTful web API for the Gramps genealogical database.
|
|
5
5
|
Author: Gramps Development Team
|
|
6
6
|
Author-email: "David M. Straub" <straub@protonmail.com>
|
|
@@ -44,7 +44,7 @@ Requires-Dist: gramps-ql>=0.5.0
|
|
|
44
44
|
Requires-Dist: psycopg2-binary
|
|
45
45
|
Requires-Dist: requests
|
|
46
46
|
Requires-Dist: yclade>=0.5.0
|
|
47
|
-
Requires-Dist: Authlib>=1.
|
|
47
|
+
Requires-Dist: Authlib>=1.9.0
|
|
48
48
|
Requires-Dist: gramps-gedcom7>=0.4.0
|
|
49
49
|
Requires-Dist: flask-smorest
|
|
50
50
|
Requires-Dist: typing-extensions>=4.13.0
|
|
@@ -17,30 +17,12 @@ and API parameters are then still accepted but ignored.
|
|
|
17
17
|
|
|
18
18
|
| Version | Target | Gramps | Breaking changes |
|
|
19
19
|
|---|---|---|---|
|
|
20
|
-
| 3.
|
|
21
|
-
| 3.
|
|
20
|
+
| 3.25.x | current | 6.0 | semantic search removed |
|
|
21
|
+
| 3.26.0 | late November 2026 | 6.0 | none |
|
|
22
22
|
| 3.x | as needed | 6.0 | none |
|
|
23
23
|
| 4.0.0 | TBD | 6.1 | multi-tree by default, removals below |
|
|
24
24
|
| 5.0.0 | TBD | 6.2 | TBD |
|
|
25
25
|
|
|
26
|
-
## Notable in 3.24
|
|
27
|
-
|
|
28
|
-
- User database migrations for task locking (#1049) and web push (#1001)
|
|
29
|
-
- Configuration via the database is deprecated (#1050)
|
|
30
|
-
- The non-shared `PostgreSQL` backend is deprecated (#981)
|
|
31
|
-
- The server locale is always English, regardless of `LANG`/`LC_*` (#1042)
|
|
32
|
-
- Media archives are stored in `EXPORT_DIR/media_archives/<tree>/` (or the media bucket) and expire by age instead of being deleted on download (#1059)
|
|
33
|
-
- Search reindexing after import or restore runs as separate tasks, so the import task finishes before search is up to date (#1046)
|
|
34
|
-
- Remove support for Python 3.10 (#1067)
|
|
35
|
-
- Semantic search is deprecated, with a warning if `VECTOR_EMBEDDING_MODEL` is set
|
|
36
|
-
|
|
37
|
-
## Notable in 3.25
|
|
38
|
-
|
|
39
|
-
- Semantic search is removed (#1074). `VECTOR_EMBEDDING_MODEL`, the `semantic` parameter of
|
|
40
|
-
`/search/` and `/search/index/` and the `--semantic` option of the `search` CLI command
|
|
41
|
-
are still accepted but ignored. `server.semantic_search` in `/metadata/` is always false
|
|
42
|
-
- The Docker images no longer contain PyTorch, Sentence Transformers or an embedding model
|
|
43
|
-
|
|
44
26
|
## Breaking in 4.0
|
|
45
27
|
|
|
46
28
|
> Note: Depending on the (unknown) release date of Gramps 6.1, these breaking changes may be moved to 5.0 instead.
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
import os
|
|
4
4
|
from logging.config import fileConfig
|
|
5
5
|
|
|
6
|
-
from sqlalchemy import engine_from_config
|
|
7
|
-
from sqlalchemy import pool
|
|
8
|
-
|
|
9
6
|
from alembic import context
|
|
10
7
|
from flask import Flask
|
|
8
|
+
from sqlalchemy import engine_from_config, event, pool, text
|
|
9
|
+
from sqlalchemy.engine import make_url
|
|
11
10
|
|
|
12
|
-
from gramps_webapi.const import ENV_CONFIG_FILE
|
|
13
11
|
from gramps_webapi.auth import User
|
|
12
|
+
from gramps_webapi.const import ENV_CONFIG_FILE
|
|
14
13
|
from gramps_webapi.util import pin_postgres_driver
|
|
15
14
|
|
|
16
15
|
# this is the Alembic Config object, which provides
|
|
@@ -23,6 +22,12 @@ fileConfig(config.config_file_name)
|
|
|
23
22
|
|
|
24
23
|
target_metadata = User.metadata
|
|
25
24
|
|
|
25
|
+
# seconds a migration waits for another process's migration (SQLite)
|
|
26
|
+
SQLITE_LOCK_TIMEOUT = 300
|
|
27
|
+
|
|
28
|
+
# arbitrary key of the advisory lock that serializes migrations (PostgreSQL)
|
|
29
|
+
PG_MIGRATION_LOCK_KEY = 7302841965
|
|
30
|
+
|
|
26
31
|
# other values from the config, defined by the needs of env.py,
|
|
27
32
|
# can be acquired:
|
|
28
33
|
# my_important_option = config.get_main_option("my_important_option")
|
|
@@ -79,19 +84,50 @@ def run_migrations_online():
|
|
|
79
84
|
In this scenario we need to create an Engine
|
|
80
85
|
and associate a connection with the context.
|
|
81
86
|
|
|
87
|
+
Several processes can migrate at the same time, e.g. the web and the
|
|
88
|
+
Celery container of a Docker Compose setup, which run the same
|
|
89
|
+
entrypoint. All migrations therefore run in one transaction that first
|
|
90
|
+
takes a lock: a second process waits for the first one and then finds
|
|
91
|
+
the database already upgraded.
|
|
82
92
|
"""
|
|
83
93
|
configuration = config.get_section(config.config_ini_section)
|
|
84
|
-
|
|
94
|
+
url = get_url()
|
|
95
|
+
configuration["sqlalchemy.url"] = url
|
|
96
|
+
is_sqlite = make_url(url).get_backend_name() == "sqlite"
|
|
85
97
|
connectable = engine_from_config(
|
|
86
98
|
configuration,
|
|
87
99
|
prefix="sqlalchemy.",
|
|
88
100
|
poolclass=pool.NullPool,
|
|
101
|
+
# wait for another process's migration instead of failing with
|
|
102
|
+
# "database is locked" after the default of 5 seconds
|
|
103
|
+
connect_args={"timeout": SQLITE_LOCK_TIMEOUT} if is_sqlite else {},
|
|
89
104
|
)
|
|
105
|
+
if is_sqlite:
|
|
106
|
+
# Python's sqlite3 module only begins transactions before DML, so
|
|
107
|
+
# the DDL would run outside of them. Begin them here instead, taking
|
|
108
|
+
# the write lock right away.
|
|
109
|
+
@event.listens_for(connectable, "connect")
|
|
110
|
+
def _disable_implicit_begin(dbapi_connection, connection_record):
|
|
111
|
+
dbapi_connection.isolation_level = None
|
|
112
|
+
|
|
113
|
+
@event.listens_for(connectable, "begin")
|
|
114
|
+
def _begin_immediate(conn):
|
|
115
|
+
conn.exec_driver_sql("BEGIN IMMEDIATE")
|
|
90
116
|
|
|
91
117
|
with connectable.connect() as connection:
|
|
92
|
-
context.configure(
|
|
118
|
+
context.configure(
|
|
119
|
+
connection=connection,
|
|
120
|
+
target_metadata=target_metadata,
|
|
121
|
+
# SQLite supports transactional DDL, Alembic just doesn't assume it
|
|
122
|
+
transactional_ddl=True if is_sqlite else None,
|
|
123
|
+
)
|
|
93
124
|
|
|
94
125
|
with context.begin_transaction():
|
|
126
|
+
if connection.dialect.name == "postgresql":
|
|
127
|
+
connection.execute(
|
|
128
|
+
text("SELECT pg_advisory_xact_lock(:key)"),
|
|
129
|
+
{"key": PG_MIGRATION_LOCK_KEY},
|
|
130
|
+
)
|
|
95
131
|
context.run_migrations()
|
|
96
132
|
|
|
97
133
|
|
|
@@ -1033,6 +1033,16 @@ def get_thumbnail(args, handle, size):
|
|
|
1033
1033
|
return handler.send_thumbnail(size=size, square=args["square"])
|
|
1034
1034
|
|
|
1035
1035
|
|
|
1036
|
+
def _abort_if_invalid_crop(x1: int, y1: int, x2: int, y2: int) -> None:
|
|
1037
|
+
"""Abort unless the crop region (in percent) lies within the image.
|
|
1038
|
+
|
|
1039
|
+
Pillow pads crops outside the image, so unchecked coordinates could
|
|
1040
|
+
allocate an arbitrarily large image.
|
|
1041
|
+
"""
|
|
1042
|
+
if not (0 <= x1 < x2 <= 100 and 0 <= y1 < y2 <= 100):
|
|
1043
|
+
abort_with_message(400, "Crop region must lie within 0 and 100 percent")
|
|
1044
|
+
|
|
1045
|
+
|
|
1036
1046
|
@api_blueprint.route(
|
|
1037
1047
|
"/media/<string:handle>/cropped/<int:x1>/<int:y1>/<int:x2>/<int:y2>"
|
|
1038
1048
|
)
|
|
@@ -1049,6 +1059,7 @@ def get_thumbnail(args, handle, size):
|
|
|
1049
1059
|
@thumbnail_cache_decorator
|
|
1050
1060
|
def get_cropped(args, handle: str, x1: int, y1: int, x2: int, y2: int):
|
|
1051
1061
|
"""Get the thumbnail of a cropped file."""
|
|
1062
|
+
_abort_if_invalid_crop(x1, y1, x2, y2)
|
|
1052
1063
|
tree = get_tree_from_jwt()
|
|
1053
1064
|
db_handle = get_db_handle()
|
|
1054
1065
|
handler = get_media_handler(db_handle, tree=tree).get_file_handler(
|
|
@@ -1075,6 +1086,7 @@ def get_thumbnail_cropped(
|
|
|
1075
1086
|
args, handle: str, x1: int, y1: int, x2: int, y2: int, size: int
|
|
1076
1087
|
):
|
|
1077
1088
|
"""Get the thumbnail of a cropped file."""
|
|
1089
|
+
_abort_if_invalid_crop(x1, y1, x2, y2)
|
|
1078
1090
|
tree = get_tree_from_jwt()
|
|
1079
1091
|
db_handle = get_db_handle()
|
|
1080
1092
|
handler = get_media_handler(db_handle, tree=tree).get_file_handler(
|
|
@@ -141,8 +141,21 @@ def skip_cache_missing_media(*args, **kwargs) -> bool:
|
|
|
141
141
|
return g.cached_media is None
|
|
142
142
|
|
|
143
143
|
|
|
144
|
+
def is_cacheable_response(rv) -> bool:
|
|
145
|
+
"""Only cache successful responses.
|
|
146
|
+
|
|
147
|
+
Since Flask-Caching 2.5.0, an exception raised by `abort()` is cached as
|
|
148
|
+
well. An error can depend on the server rather than the tree (e.g. an addon
|
|
149
|
+
that isn't installed yet), so it must not be served until the tree changes.
|
|
150
|
+
The view may return something other than a `Response`, e.g. a string.
|
|
151
|
+
"""
|
|
152
|
+
return getattr(rv, "status_code", 200) < 400
|
|
153
|
+
|
|
154
|
+
|
|
144
155
|
_request_cached = request_cache.cached(
|
|
145
|
-
make_cache_key=make_cache_key_request,
|
|
156
|
+
make_cache_key=make_cache_key_request,
|
|
157
|
+
unless=skip_cache_condition_request,
|
|
158
|
+
response_filter=is_cacheable_response,
|
|
146
159
|
)
|
|
147
160
|
|
|
148
161
|
|
|
@@ -22,9 +22,11 @@
|
|
|
22
22
|
import hashlib
|
|
23
23
|
import json
|
|
24
24
|
import os
|
|
25
|
+
import shutil
|
|
26
|
+
import tempfile
|
|
25
27
|
from io import BytesIO
|
|
26
28
|
from pathlib import Path
|
|
27
|
-
from typing import Any, BinaryIO, Optional, Tuple, Union
|
|
29
|
+
from typing import IO, Any, BinaryIO, Optional, Tuple, Union
|
|
28
30
|
|
|
29
31
|
from flask import jsonify, make_response, send_file, send_from_directory, current_app
|
|
30
32
|
from gramps.gen.db.base import DbReadBase
|
|
@@ -326,7 +328,7 @@ class LocalFileHandler(FileHandler):
|
|
|
326
328
|
|
|
327
329
|
|
|
328
330
|
def upload_file_local(
|
|
329
|
-
base_dir: FilenameOrPath, rel_path: FilenameOrPath, stream:
|
|
331
|
+
base_dir: FilenameOrPath, rel_path: FilenameOrPath, stream: IO[bytes]
|
|
330
332
|
) -> None:
|
|
331
333
|
"""Upload a file from a stream to a path inside the base directory.
|
|
332
334
|
|
|
@@ -358,10 +360,11 @@ def get_checksum(fp) -> str:
|
|
|
358
360
|
return md5sum
|
|
359
361
|
|
|
360
362
|
|
|
361
|
-
def process_file(stream: Union[Any, BinaryIO]) -> Tuple[str, int,
|
|
363
|
+
def process_file(stream: Union[Any, BinaryIO]) -> Tuple[str, int, IO[bytes]]:
|
|
362
364
|
"""Process a file from a stream that has a read method."""
|
|
363
|
-
|
|
364
|
-
fp.
|
|
365
|
+
# copy in chunks, spilling to disk, instead of holding the body in memory twice
|
|
366
|
+
fp = tempfile.SpooledTemporaryFile(max_size=10 * 1024 * 1024)
|
|
367
|
+
shutil.copyfileobj(stream, fp)
|
|
365
368
|
fp.seek(0)
|
|
366
369
|
checksum = get_checksum(fp)
|
|
367
370
|
size = fp.tell()
|
|
@@ -75,11 +75,13 @@ def _fix_xmp(image: ImageType) -> None:
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def exif_transpose(image: ImageType) -> ImageType:
|
|
78
|
-
"""
|
|
78
|
+
"""Rotate the image in place according to its EXIF orientation and return it.
|
|
79
|
+
|
|
80
|
+
Pillow's default returns a full copy even when no rotation is needed.
|
|
81
|
+
"""
|
|
79
82
|
_fix_xmp(image)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return transposed
|
|
83
|
+
ImageOps.exif_transpose(image, in_place=True)
|
|
84
|
+
return image
|
|
83
85
|
|
|
84
86
|
|
|
85
87
|
def open_image(fp: Union[BinaryIO, FilenameOrPath]) -> ImageType:
|
|
@@ -240,7 +240,8 @@ def answer_with_agent(
|
|
|
240
240
|
|
|
241
241
|
messages: list[ModelMessage] = []
|
|
242
242
|
try:
|
|
243
|
-
|
|
243
|
+
# never log the prompt or the answer, they contain private chat content
|
|
244
|
+
logger.debug("Running Pydantic AI agent")
|
|
244
245
|
with capture_run_messages() as messages:
|
|
245
246
|
result = agent.run_sync(
|
|
246
247
|
prompt,
|
|
@@ -254,7 +255,7 @@ def answer_with_agent(
|
|
|
254
255
|
else None
|
|
255
256
|
),
|
|
256
257
|
)
|
|
257
|
-
logger.debug("Agent
|
|
258
|
+
logger.debug("Agent finished with reason: %s", result.response.finish_reason)
|
|
258
259
|
if result.response.finish_reason == "length":
|
|
259
260
|
logger.warning(
|
|
260
261
|
"AI answer cut off at the output token limit, see "
|
|
@@ -295,7 +296,11 @@ def answer_with_agent(
|
|
|
295
296
|
abort_with_message(
|
|
296
297
|
400, "The AI model's response exceeded its output token limit."
|
|
297
298
|
)
|
|
298
|
-
|
|
299
|
+
# str(e) can include the model's response body
|
|
300
|
+
logger.error(
|
|
301
|
+
"Pydantic AI error: %s",
|
|
302
|
+
e.message if isinstance(e, UnexpectedModelBehavior) else type(e).__name__,
|
|
303
|
+
)
|
|
299
304
|
abort_with_message(500, "Error communicating with the AI model")
|
|
300
305
|
except Exception:
|
|
301
306
|
logger.exception("Unexpected error in agent")
|
|
@@ -22,10 +22,17 @@
|
|
|
22
22
|
from __future__ import annotations
|
|
23
23
|
|
|
24
24
|
import warnings
|
|
25
|
+
from dataclasses import replace
|
|
25
26
|
|
|
26
27
|
from pydantic_ai import Agent, RunContext
|
|
27
28
|
from pydantic_ai.capabilities import ProcessHistory
|
|
28
|
-
from pydantic_ai.messages import
|
|
29
|
+
from pydantic_ai.messages import (
|
|
30
|
+
ModelMessage,
|
|
31
|
+
ModelRequest,
|
|
32
|
+
SystemPromptPart,
|
|
33
|
+
ToolReturnPart,
|
|
34
|
+
UserPromptPart,
|
|
35
|
+
)
|
|
29
36
|
from pydantic_ai.models.ollama import OllamaModel
|
|
30
37
|
from pydantic_ai.models.openai import OpenAIChatModel
|
|
31
38
|
from pydantic_ai.providers import infer_provider_class
|
|
@@ -58,33 +65,84 @@ def _part_chars(part) -> int:
|
|
|
58
65
|
return 0
|
|
59
66
|
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
OMITTED_TOOL_RESULT = (
|
|
69
|
+
"[Result omitted from history to save space. "
|
|
70
|
+
"Call the tool again if you need the details.]"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _compact_history(
|
|
62
75
|
ctx: RunContext[AgentDeps], messages: list[ModelMessage]
|
|
63
76
|
) -> list[ModelMessage]:
|
|
64
|
-
"""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
"""Keep the history within 3× the context budget.
|
|
78
|
+
|
|
79
|
+
First, tool results are replaced with a placeholder, oldest first, until
|
|
80
|
+
the history fits. The last message is left untouched, as it holds the
|
|
81
|
+
results the model is about to use. Only if that is not enough are the
|
|
82
|
+
oldest turns dropped. The system prompt and the current turn are always
|
|
83
|
+
kept, so the model keeps its instructions and the question it is
|
|
84
|
+
answering, and every tool call keeps its result.
|
|
69
85
|
"""
|
|
70
86
|
budget = ctx.deps.max_context_length * 3
|
|
87
|
+
total = sum(_part_chars(p) for msg in messages for p in msg.parts)
|
|
88
|
+
|
|
89
|
+
compacted = list(messages)
|
|
90
|
+
for i, msg in enumerate(messages[:-1]):
|
|
91
|
+
if total <= budget:
|
|
92
|
+
break
|
|
93
|
+
if not isinstance(msg, ModelRequest):
|
|
94
|
+
continue
|
|
95
|
+
parts = []
|
|
96
|
+
for part in msg.parts:
|
|
97
|
+
size = _part_chars(part)
|
|
98
|
+
if isinstance(part, ToolReturnPart) and size > len(OMITTED_TOOL_RESULT):
|
|
99
|
+
total -= size - len(OMITTED_TOOL_RESULT)
|
|
100
|
+
part = replace(part, content=OMITTED_TOOL_RESULT)
|
|
101
|
+
parts.append(part)
|
|
102
|
+
compacted[i] = replace(msg, parts=parts)
|
|
103
|
+
|
|
104
|
+
if total <= budget:
|
|
105
|
+
return compacted
|
|
106
|
+
return _drop_old_turns(compacted, total, budget)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _drop_old_turns(
|
|
110
|
+
messages: list[ModelMessage], total: int, budget: int
|
|
111
|
+
) -> list[ModelMessage]:
|
|
112
|
+
"""Drop the oldest complete turns until the history fits the budget.
|
|
71
113
|
|
|
114
|
+
A turn starts with a request containing a user prompt. The current turn is
|
|
115
|
+
never dropped, and the system prompt is moved to the first kept request.
|
|
116
|
+
"""
|
|
72
117
|
turn_starts = [
|
|
73
118
|
i
|
|
74
119
|
for i, msg in enumerate(messages)
|
|
75
120
|
if isinstance(msg, ModelRequest)
|
|
76
121
|
and any(isinstance(p, UserPromptPart) for p in msg.parts)
|
|
77
122
|
]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
123
|
+
start = 0
|
|
124
|
+
for turn_start in turn_starts[1:]:
|
|
125
|
+
if total <= budget:
|
|
126
|
+
break
|
|
127
|
+
total -= sum(
|
|
128
|
+
_part_chars(p)
|
|
129
|
+
for msg in messages[start:turn_start]
|
|
130
|
+
for p in msg.parts
|
|
131
|
+
if not isinstance(p, SystemPromptPart)
|
|
132
|
+
)
|
|
133
|
+
start = turn_start
|
|
134
|
+
if start == 0:
|
|
135
|
+
return messages
|
|
136
|
+
|
|
137
|
+
system_parts = [
|
|
138
|
+
p
|
|
139
|
+
for msg in messages[:start]
|
|
140
|
+
for p in msg.parts
|
|
141
|
+
if isinstance(p, SystemPromptPart)
|
|
142
|
+
]
|
|
143
|
+
first = messages[start]
|
|
144
|
+
assert isinstance(first, ModelRequest) # turns start with a request
|
|
145
|
+
return [replace(first, parts=[*system_parts, *first.parts]), *messages[start + 1 :]]
|
|
88
146
|
|
|
89
147
|
|
|
90
148
|
SEARCH_STRATEGY_FULLTEXT = """search_genealogy_database matches exact names or
|
|
@@ -200,7 +258,7 @@ def create_agent(
|
|
|
200
258
|
model,
|
|
201
259
|
deps_type=AgentDeps,
|
|
202
260
|
system_prompt=system_prompt,
|
|
203
|
-
capabilities=[ProcessHistory(
|
|
261
|
+
capabilities=[ProcessHistory(_compact_history)],
|
|
204
262
|
)
|
|
205
263
|
agent.tool(get_current_date)
|
|
206
264
|
agent.tool(search_genealogy_database)
|
|
@@ -143,7 +143,10 @@ def _apply_gramps_filter(
|
|
|
143
143
|
filter_dict["function"] = logic
|
|
144
144
|
|
|
145
145
|
filter_rules = json.dumps(filter_dict)
|
|
146
|
-
|
|
146
|
+
# rule values come from the chat, so only log the rule names
|
|
147
|
+
logger.debug(
|
|
148
|
+
"%s filter rules: %s", namespace, [rule["name"] for rule in rules]
|
|
149
|
+
)
|
|
147
150
|
|
|
148
151
|
args = {"rules": filter_rules}
|
|
149
152
|
matching_handles = apply_filter(
|
|
@@ -404,10 +407,9 @@ def search_genealogy_database(
|
|
|
404
407
|
if len(context_parts) < total:
|
|
405
408
|
result += f"\n\n---\nShowing {len(context_parts)} of {total} matches."
|
|
406
409
|
logger.debug(
|
|
407
|
-
"Tool search_genealogy_database returned %d results (%d chars)
|
|
410
|
+
"Tool search_genealogy_database returned %d results (%d chars)",
|
|
408
411
|
len(context_parts),
|
|
409
412
|
len(result),
|
|
410
|
-
query,
|
|
411
413
|
)
|
|
412
414
|
return result
|
|
413
415
|
|
|
@@ -26,7 +26,7 @@ import os
|
|
|
26
26
|
import time
|
|
27
27
|
import zipfile
|
|
28
28
|
from pathlib import Path
|
|
29
|
-
from typing import
|
|
29
|
+
from typing import IO, TYPE_CHECKING, Callable, List, Optional, Set
|
|
30
30
|
|
|
31
31
|
from flask import current_app
|
|
32
32
|
from flask_jwt_extended import get_jwt_identity
|
|
@@ -159,7 +159,7 @@ class MediaHandlerBase:
|
|
|
159
159
|
|
|
160
160
|
def upload_file(
|
|
161
161
|
self,
|
|
162
|
-
stream:
|
|
162
|
+
stream: IO[bytes],
|
|
163
163
|
checksum: str,
|
|
164
164
|
mime: str,
|
|
165
165
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -203,7 +203,7 @@ class MediaHandlerLocal(MediaHandlerBase):
|
|
|
203
203
|
|
|
204
204
|
def upload_file(
|
|
205
205
|
self,
|
|
206
|
-
stream:
|
|
206
|
+
stream: IO[bytes],
|
|
207
207
|
checksum: str,
|
|
208
208
|
mime: str,
|
|
209
209
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -347,7 +347,7 @@ class MediaHandlerS3(MediaHandlerBase):
|
|
|
347
347
|
|
|
348
348
|
def upload_file(
|
|
349
349
|
self,
|
|
350
|
-
stream:
|
|
350
|
+
stream: IO[bytes],
|
|
351
351
|
checksum: str,
|
|
352
352
|
mime: str,
|
|
353
353
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -50,7 +50,7 @@ class CitationResourceHelper(GrampsObjectResourceHelper):
|
|
|
50
50
|
"""Extend citation attributes as needed."""
|
|
51
51
|
if "profile" in args:
|
|
52
52
|
obj.profile = get_citation_profile_for_object(
|
|
53
|
-
self.db_handle, obj, args["profile"]
|
|
53
|
+
self.db_handle, obj, args["profile"], locale=locale
|
|
54
54
|
)
|
|
55
55
|
if "extend" in args:
|
|
56
56
|
obj.extended = get_extended_attributes(self.db_handle, obj, args)
|
|
@@ -87,8 +87,13 @@ class PersonDnaMatchesResource(ProtectedResource):
|
|
|
87
87
|
abort(404)
|
|
88
88
|
raise AssertionError # for type checker
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
# caching the whole tree is only worth it if there are matches to compute
|
|
91
|
+
if any(
|
|
92
|
+
association.get_relation() == "DNA"
|
|
93
|
+
for association in person.get_person_ref_list()
|
|
94
|
+
):
|
|
95
|
+
db_handle.cache_people()
|
|
96
|
+
db_handle.cache_families()
|
|
92
97
|
|
|
93
98
|
locale = get_locale_for_language(args["locale"], default=True)
|
|
94
99
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"""Object storage (e.g. S3) handling utilities."""
|
|
21
21
|
|
|
22
22
|
from io import BytesIO
|
|
23
|
-
from typing import BinaryIO, Dict, Optional
|
|
23
|
+
from typing import IO, BinaryIO, Dict, Optional
|
|
24
24
|
|
|
25
25
|
from flask import current_app, redirect, send_file
|
|
26
26
|
from gramps.gen.db.base import DbReadBase
|
|
@@ -210,7 +210,7 @@ class ObjectStorageFileHandler(FileHandler):
|
|
|
210
210
|
|
|
211
211
|
def upload_file_s3(
|
|
212
212
|
bucket_name: str,
|
|
213
|
-
stream:
|
|
213
|
+
stream: IO[bytes],
|
|
214
214
|
checksum: str,
|
|
215
215
|
mime: str,
|
|
216
216
|
prefix: Optional[str] = None,
|
|
@@ -241,7 +241,9 @@ def _collect(
|
|
|
241
241
|
spec = FIELD_SPECS[data["_class"]]
|
|
242
242
|
is_private = is_private or bool(data.get("private"))
|
|
243
243
|
strings = private if is_private else public
|
|
244
|
-
|
|
244
|
+
# Gramps does not enforce types, so data written by other tools can hold
|
|
245
|
+
# e.g. a postal code as a number
|
|
246
|
+
strings += [str(data[key]) for key in spec.text if data.get(key)]
|
|
245
247
|
strings += [_type_string(data.get(key), False) for key in spec.types]
|
|
246
248
|
strings += [_type_string(data.get(key), True) for key in spec.custom_types]
|
|
247
249
|
for key in spec.children:
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Utility functions for celery."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
4
|
+
|
|
3
5
|
from celery import Task
|
|
4
6
|
from celery import current_app as current_celery_app
|
|
5
7
|
from werkzeug.exceptions import HTTPException
|
|
@@ -22,8 +24,31 @@ class TaskRejection(TaskError):
|
|
|
22
24
|
"""
|
|
23
25
|
|
|
24
26
|
|
|
27
|
+
class HideTaskResultFilter(logging.Filter):
|
|
28
|
+
"""Hide task return values in Celery's "Task ... succeeded" log records.
|
|
29
|
+
|
|
30
|
+
Results can contain private tree data, e.g. OCR text or AI chat answers.
|
|
31
|
+
Celery has no setting for this, but passes the log context as ``data`` in
|
|
32
|
+
``extra`` for custom handlers, so the value is replaced there too.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
36
|
+
context = record.args
|
|
37
|
+
if isinstance(context, dict) and "return_value" in context:
|
|
38
|
+
context = {**context, "return_value": "<hidden>"}
|
|
39
|
+
record.args = context
|
|
40
|
+
if isinstance(getattr(record, "data", None), dict):
|
|
41
|
+
record.data = context
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_hide_task_result_filter = HideTaskResultFilter()
|
|
46
|
+
|
|
47
|
+
|
|
25
48
|
def create_celery(app):
|
|
26
49
|
"""App factory for celery."""
|
|
50
|
+
# no-op if already added, create_celery runs once per app
|
|
51
|
+
logging.getLogger("celery.app.trace").addFilter(_hide_task_result_filter)
|
|
27
52
|
celery = current_celery_app
|
|
28
53
|
celery.conf.name = app.import_name
|
|
29
54
|
celery.conf.update(app.config["CELERY_CONFIG"])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gramps-webapi
|
|
3
|
-
Version: 3.25.
|
|
3
|
+
Version: 3.25.2
|
|
4
4
|
Summary: A RESTful web API for the Gramps genealogical database.
|
|
5
5
|
Author: Gramps Development Team
|
|
6
6
|
Author-email: "David M. Straub" <straub@protonmail.com>
|
|
@@ -44,7 +44,7 @@ Requires-Dist: gramps-ql>=0.5.0
|
|
|
44
44
|
Requires-Dist: psycopg2-binary
|
|
45
45
|
Requires-Dist: requests
|
|
46
46
|
Requires-Dist: yclade>=0.5.0
|
|
47
|
-
Requires-Dist: Authlib>=1.
|
|
47
|
+
Requires-Dist: Authlib>=1.9.0
|
|
48
48
|
Requires-Dist: gramps-gedcom7>=0.4.0
|
|
49
49
|
Requires-Dist: flask-smorest
|
|
50
50
|
Requires-Dist: typing-extensions>=4.13.0
|
|
@@ -208,6 +208,7 @@ scripts/start_dev_container.sh
|
|
|
208
208
|
tests/__init__.py
|
|
209
209
|
tests/conftest.py
|
|
210
210
|
tests/test_access.py
|
|
211
|
+
tests/test_celery_logging.py
|
|
211
212
|
tests/test_check.py
|
|
212
213
|
tests/test_cli.py
|
|
213
214
|
tests/test_close_db.py
|
|
@@ -225,6 +226,7 @@ tests/test_jwt.py
|
|
|
225
226
|
tests/test_limiter.py
|
|
226
227
|
tests/test_llm_agent.py
|
|
227
228
|
tests/test_llm_errors.py
|
|
229
|
+
tests/test_llm_history.py
|
|
228
230
|
tests/test_llm_render.py
|
|
229
231
|
tests/test_llm_tools.py
|
|
230
232
|
tests/test_logging_utils.py
|
|
@@ -259,6 +261,7 @@ tests/test_task_state.py
|
|
|
259
261
|
tests/test_tasks.py
|
|
260
262
|
tests/test_telemetry.py
|
|
261
263
|
tests/test_undodb.py
|
|
264
|
+
tests/test_user_db_migration.py
|
|
262
265
|
tests/test_util.py
|
|
263
266
|
tests/test_verify_lib.py
|
|
264
267
|
tests/test_version.py
|