gramps-webapi 3.26.0__tar.gz → 3.26.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.
Files changed (363) hide show
  1. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.devcontainer/Dockerfile +5 -0
  2. gramps_webapi-3.26.2/.devcontainer/devcontainer-lock.json +9 -0
  3. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.devcontainer/docker-compose.yml +20 -3
  4. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/CONTRIBUTING.md +2 -1
  5. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/PKG-INFO +3 -3
  6. gramps_webapi-3.26.2/ROADMAP.md +47 -0
  7. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/_version.py +1 -1
  8. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/file.py +39 -6
  9. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/media.py +20 -13
  10. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/media_importer.py +20 -9
  11. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/file.py +2 -2
  12. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/util/celery.py +4 -0
  13. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi.egg-info/PKG-INFO +3 -3
  14. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi.egg-info/SOURCES.txt +2 -0
  15. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi.egg-info/requires.txt +2 -2
  16. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/pyproject.toml +2 -2
  17. gramps_webapi-3.26.2/scripts/init_dev_trees.py +182 -0
  18. gramps_webapi-3.26.2/scripts/start_dev_container.sh +20 -0
  19. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_media_archive.py +7 -3
  20. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_upload.py +42 -4
  21. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_file.py +25 -1
  22. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_media_importer.py +19 -0
  23. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_object_query_parsing.py +5 -1
  24. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_task_error.py +11 -0
  25. gramps_webapi-3.26.0/ROADMAP.md +0 -73
  26. gramps_webapi-3.26.0/scripts/start_dev_container.sh +0 -33
  27. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.devcontainer/devcontainer.json +0 -0
  28. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.dockerignore +0 -0
  29. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.editorconfig +0 -0
  30. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.flake8 +0 -0
  31. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  32. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  33. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  34. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/workflows/base-image-pr.yml +0 -0
  35. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/workflows/base-image.yml +0 -0
  36. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/workflows/image.yml +0 -0
  37. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/workflows/pypi.yml +0 -0
  38. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.github/workflows/test.yml +0 -0
  39. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.gitignore +0 -0
  40. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.pre-commit-config.yaml +0 -0
  41. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.pylintrc +0 -0
  42. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.vscode/extensions.json +0 -0
  43. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.vscode/launch.json +0 -0
  44. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.vscode/settings.json +0 -0
  45. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/.vscode/tasks.json +0 -0
  46. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/AGENTS.md +0 -0
  47. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/CLAUDE.md +0 -0
  48. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/CODE_OF_CONDUCT.md +0 -0
  49. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/Dockerfile +0 -0
  50. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/Dockerfile.base +0 -0
  51. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/LICENSE +0 -0
  52. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/MANIFEST.in +0 -0
  53. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/README.md +0 -0
  54. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic.ini +0 -0
  55. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/README +0 -0
  56. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/env.py +0 -0
  57. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/script.py.mako +0 -0
  58. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/2082445b0769_add_oidc_accounts_table_for_secure_.py +0 -0
  59. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/22c8d1fba959_add_trees_enabled.py +0 -0
  60. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/4b7f9d2e6c01_add_web_push_subscriptions.py +0 -0
  61. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/66e56620891a_add_trees_table.py +0 -0
  62. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/6d8f3cb50b71_add_persistent_access_tokens_table.py +0 -0
  63. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/7b2e9f4c1a63_allow_several_access_tokens_per_scope.py +0 -0
  64. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/84960b7d968c_use_bigint_for_quota_media.py +0 -0
  65. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/9c4d2e7a5b18_track_task_lifecycle.py +0 -0
  66. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/a8e57fe0d82e_add_columns_for_ai_quota.py +0 -0
  67. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/b0582f54029c_use_bigint_for_usage_media.py +0 -0
  68. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/b2c3d4e5f6a7_add_tree_config_column.py +0 -0
  69. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/b6f1d3a9c2e4_add_token_version_to_user.py +0 -0
  70. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/c1d2e3f4a5b6_merge_task_tree_and_tree_config.py +0 -0
  71. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/c89728e71264_.py +0 -0
  72. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/d4e9a1c7b3f2_drop_unique_constraint_on_user_email.py +0 -0
  73. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/e176543c72a8_add_tree_column_to_user.py +0 -0
  74. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/e5e738d09fa7_added_configuration_table.py +0 -0
  75. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/alembic_users/versions/f3a1c8e92b47_add_task_tree_table.py +0 -0
  76. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/docker-entrypoint.sh +0 -0
  77. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/__init__.py +0 -0
  78. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/__main__.py +0 -0
  79. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/__init__.py +0 -0
  80. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/access/__init__.py +0 -0
  81. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/access/db.py +0 -0
  82. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/access/policy.py +0 -0
  83. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/access/sanitize.py +0 -0
  84. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/auth.py +0 -0
  85. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/backup.py +0 -0
  86. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/backup_store.py +0 -0
  87. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/blueprint.py +0 -0
  88. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/cache.py +0 -0
  89. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/check.py +0 -0
  90. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/deprecations.py +0 -0
  91. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/dna.py +0 -0
  92. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/dry_run.py +0 -0
  93. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/emails.py +0 -0
  94. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/export.py +0 -0
  95. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/faces.py +0 -0
  96. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/html.py +0 -0
  97. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/image.py +0 -0
  98. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/__init__.py +0 -0
  99. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/agent.py +0 -0
  100. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/deps.py +0 -0
  101. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/images.py +0 -0
  102. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/propose.py +0 -0
  103. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/render.py +0 -0
  104. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/llm/tools.py +0 -0
  105. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/people_families_cache.py +0 -0
  106. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/ratelimiter.py +0 -0
  107. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/report.py +0 -0
  108. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/__init__.py +0 -0
  109. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/access_tokens.py +0 -0
  110. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/anniversaries.py +0 -0
  111. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/backups.py +0 -0
  112. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/base.py +0 -0
  113. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/bookmarks.py +0 -0
  114. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/bulk_edit.py +0 -0
  115. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/chat.py +0 -0
  116. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/citations.py +0 -0
  117. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/config.py +0 -0
  118. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/db_backend.py +0 -0
  119. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/delete.py +0 -0
  120. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/dna.py +0 -0
  121. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/emit.py +0 -0
  122. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/events.py +0 -0
  123. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/export_media.py +0 -0
  124. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/exporters.py +0 -0
  125. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/face_detection.py +0 -0
  126. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/facts.py +0 -0
  127. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/families.py +0 -0
  128. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/filter_param_types.py +0 -0
  129. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/filters.py +0 -0
  130. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/history.py +0 -0
  131. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/holidays.py +0 -0
  132. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/import_media.py +0 -0
  133. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/importers.py +0 -0
  134. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/living.py +0 -0
  135. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/match.py +0 -0
  136. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/media.py +0 -0
  137. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/merge.py +0 -0
  138. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/metadata.py +0 -0
  139. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/name_formats.py +0 -0
  140. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/name_groups.py +0 -0
  141. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/notes.py +0 -0
  142. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/object_query.py +0 -0
  143. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/objects.py +0 -0
  144. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/ocr.py +0 -0
  145. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/oidc.py +0 -0
  146. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/oidc_accounts.py +0 -0
  147. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/people.py +0 -0
  148. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/places.py +0 -0
  149. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/push_subscriptions.py +0 -0
  150. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/relations.py +0 -0
  151. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/reports.py +0 -0
  152. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/repositories.py +0 -0
  153. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/restore.py +0 -0
  154. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/schemas.py +0 -0
  155. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/search.py +0 -0
  156. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/sort.py +0 -0
  157. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/sources.py +0 -0
  158. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/tags.py +0 -0
  159. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/tasks.py +0 -0
  160. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/timeline.py +0 -0
  161. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/token.py +0 -0
  162. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/transactions.py +0 -0
  163. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/translations.py +0 -0
  164. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/trees.py +0 -0
  165. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/types.py +0 -0
  166. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/user.py +0 -0
  167. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/user_merge.py +0 -0
  168. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/util.py +0 -0
  169. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/verify.py +0 -0
  170. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/resources/ydna.py +0 -0
  171. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/s3.py +0 -0
  172. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/search/__init__.py +0 -0
  173. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/search/indexer.py +0 -0
  174. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/search/query.py +0 -0
  175. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/search/schema.py +0 -0
  176. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/search/text.py +0 -0
  177. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/snapshot.py +0 -0
  178. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/tasks.py +0 -0
  179. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/telemetry.py +0 -0
  180. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/api/util.py +0 -0
  181. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/app.py +0 -0
  182. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/__init__.py +0 -0
  183. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/const.py +0 -0
  184. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/oidc.py +0 -0
  185. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/oidc_helpers.py +0 -0
  186. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/passwords.py +0 -0
  187. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/auth/sql_guid.py +0 -0
  188. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/celery.py +0 -0
  189. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/config.py +0 -0
  190. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/const.py +0 -0
  191. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/data/empty_gramps_auth.cfg +0 -0
  192. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/data/example_gramps_auth.cfg +0 -0
  193. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/data/face_detection_yunet_2023mar.onnx +0 -0
  194. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/data/test_auth.cfg +0 -0
  195. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/dbloader.py +0 -0
  196. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/dbmanager.py +0 -0
  197. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/future_gramps/__init__.py +0 -0
  198. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/future_gramps/alive.py +0 -0
  199. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/future_gramps/raw_data_many.py +0 -0
  200. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/future_gramps/relationship.py +0 -0
  201. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/future_gramps/relationship_path.py +0 -0
  202. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/logging_utils.py +0 -0
  203. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/profiler.py +0 -0
  204. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/sentry.py +0 -0
  205. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/static/index.html +0 -0
  206. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/templates/confirmation.html +0 -0
  207. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/templates/reset_password.html +0 -0
  208. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/templates/reset_password_base.html +0 -0
  209. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/templates/reset_password_error.html +0 -0
  210. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/translogger.py +0 -0
  211. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/types.py +0 -0
  212. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/undodb.py +0 -0
  213. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/util/__init__.py +0 -0
  214. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/util/task_state.py +0 -0
  215. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/verify_lib.py +0 -0
  216. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/webpush.py +0 -0
  217. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi/wsgi.py +0 -0
  218. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi.egg-info/dependency_links.txt +0 -0
  219. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/gramps_webapi.egg-info/top_level.txt +0 -0
  220. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/mypy.ini +0 -0
  221. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/requirements-dev.txt +0 -0
  222. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/scripts/s3_rename.py +0 -0
  223. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/scripts/search_benchmark.py +0 -0
  224. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/setup.cfg +0 -0
  225. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/setup.py +0 -0
  226. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/__init__.py +0 -0
  227. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/conftest.py +0 -0
  228. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_access.py +0 -0
  229. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_celery_logging.py +0 -0
  230. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_check.py +0 -0
  231. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_cli.py +0 -0
  232. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_close_db.py +0 -0
  233. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_db.py +0 -0
  234. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_delete.py +0 -0
  235. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_deprecations.py +0 -0
  236. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_dna_match_parser.py +0 -0
  237. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_dry_run.py +0 -0
  238. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/__init__.py +0 -0
  239. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/checks.py +0 -0
  240. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_access_tokens.py +0 -0
  241. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_anniversaries_ics.py +0 -0
  242. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_backups.py +0 -0
  243. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_bookmarks.py +0 -0
  244. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_chat.py +0 -0
  245. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_citations.py +0 -0
  246. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_config.py +0 -0
  247. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_db_handle.py +0 -0
  248. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_delete.py +0 -0
  249. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_dna.py +0 -0
  250. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_edit_by_handle.py +0 -0
  251. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_etag.py +0 -0
  252. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_events.py +0 -0
  253. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_exporters.py +0 -0
  254. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_facts.py +0 -0
  255. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_families.py +0 -0
  256. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_file.py +0 -0
  257. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_filters.py +0 -0
  258. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_history.py +0 -0
  259. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_holidays.py +0 -0
  260. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_import_media.py +0 -0
  261. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_importers.py +0 -0
  262. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_list_paging.py +0 -0
  263. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_living.py +0 -0
  264. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_media.py +0 -0
  265. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_media_usage_sync.py +0 -0
  266. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_merge.py +0 -0
  267. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_metadata.py +0 -0
  268. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_name_formats.py +0 -0
  269. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_name_groups.py +0 -0
  270. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_notes.py +0 -0
  271. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_object_query.py +0 -0
  272. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_ocr.py +0 -0
  273. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_oidc.py +0 -0
  274. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_oidc_accounts.py +0 -0
  275. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_oidc_link.py +0 -0
  276. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_paging_sort.py +0 -0
  277. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_people.py +0 -0
  278. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_people_query.py +0 -0
  279. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_place_coordinates.py +0 -0
  280. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_places.py +0 -0
  281. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_post.py +0 -0
  282. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_profiler.py +0 -0
  283. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_push_subscriptions.py +0 -0
  284. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_put.py +0 -0
  285. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_query_conformance.py +0 -0
  286. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_ready.py +0 -0
  287. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_relations.py +0 -0
  288. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_repair.py +0 -0
  289. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_reports.py +0 -0
  290. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_repositories.py +0 -0
  291. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_restore.py +0 -0
  292. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_s3.py +0 -0
  293. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_search.py +0 -0
  294. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_sources.py +0 -0
  295. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_tags.py +0 -0
  296. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_tasks.py +0 -0
  297. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_timelines.py +0 -0
  298. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_token.py +0 -0
  299. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_token_revocation.py +0 -0
  300. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_token_sync.py +0 -0
  301. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_transactions.py +0 -0
  302. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_translations.py +0 -0
  303. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_treeless_admin.py +0 -0
  304. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_trees.py +0 -0
  305. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_types.py +0 -0
  306. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_user.py +0 -0
  307. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_user_merge.py +0 -0
  308. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_user_set_password.py +0 -0
  309. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_verify.py +0 -0
  310. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_webpush_delivery.py +0 -0
  311. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/test_ydna.py +0 -0
  312. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_endpoints/util.py +0 -0
  313. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_face_detection.py +0 -0
  314. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_family_link_graph.py +0 -0
  315. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_future_gramps_alive.py +0 -0
  316. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_future_gramps_raw_data_many.py +0 -0
  317. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_future_gramps_relationship.py +0 -0
  318. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_future_gramps_relationship_path.py +0 -0
  319. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_image.py +0 -0
  320. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_import_util.py +0 -0
  321. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_jwt.py +0 -0
  322. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_limiter.py +0 -0
  323. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_agent.py +0 -0
  324. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_errors.py +0 -0
  325. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_history.py +0 -0
  326. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_images.py +0 -0
  327. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_propose.py +0 -0
  328. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_render.py +0 -0
  329. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_llm_tools.py +0 -0
  330. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_logging_utils.py +0 -0
  331. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_map_tile.py +0 -0
  332. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_media_prefix_tree.py +0 -0
  333. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_migrate_grampsdb.py +0 -0
  334. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_missing_references.py +0 -0
  335. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_oidc_auth.py +0 -0
  336. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_openapi_operation_ids.py +0 -0
  337. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_password.py +0 -0
  338. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_postgres_driver.py +0 -0
  339. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_privacy_canary.py +0 -0
  340. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_private_proxy.py +0 -0
  341. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_private_proxy_backlinks.py +0 -0
  342. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_proxy_fix.py +0 -0
  343. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_s3.py +0 -0
  344. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_search_api_updates.py +0 -0
  345. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_search_index.py +0 -0
  346. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_search_oracle.py +0 -0
  347. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_search_text.py +0 -0
  348. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_sentry.py +0 -0
  349. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_server_locale.py +0 -0
  350. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_shared_postgresql.py +0 -0
  351. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_snapshot.py +0 -0
  352. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_sort_raw_data.py +0 -0
  353. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_sort_sql.py +0 -0
  354. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_sqlauth.py +0 -0
  355. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_static_files.py +0 -0
  356. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_task_state.py +0 -0
  357. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_tasks.py +0 -0
  358. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_telemetry.py +0 -0
  359. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_undodb.py +0 -0
  360. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_user_db_migration.py +0 -0
  361. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_util.py +0 -0
  362. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_verify_lib.py +0 -0
  363. {gramps_webapi-3.26.0 → gramps_webapi-3.26.2}/tests/test_version.py +0 -0
@@ -27,5 +27,10 @@ RUN mkdir -p $GRAMPSHOME/gramps/gramps$GRAMPS_VERSION/plugins && \
27
27
  # fails
28
28
  RUN mkdir -p /home/vscode/.cache && chown -R vscode:vscode /home/vscode/.cache
29
29
 
30
+ # Mount points for the persistent Claude Code / Codex volumes (see
31
+ # docker-compose.yml). Creating them here makes fresh volumes owned by vscode.
32
+ RUN mkdir -p /home/vscode/.claude /home/vscode/.codex \
33
+ && chown vscode:vscode /home/vscode/.claude /home/vscode/.codex
34
+
30
35
  USER vscode
31
36
 
@@ -0,0 +1,9 @@
1
+ {
2
+ "features": {
3
+ "ghcr.io/devcontainers/features/github-cli:1": {
4
+ "version": "1.1.3",
5
+ "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2",
6
+ "integrity": "sha256:bd7ab48a832228f633239277552c30b353867fef2e5b037e064b4e64f0b843f2"
7
+ }
8
+ }
9
+ }
@@ -5,8 +5,18 @@ services:
5
5
  dockerfile: Dockerfile
6
6
  volumes:
7
7
  - ../..:/workspaces:cached
8
+ # Keep AI coding agent auth, settings and memory across container rebuilds
9
+ - claude-config:/home/vscode/.claude
10
+ - codex-config:/home/vscode/.codex
8
11
  command: sleep infinity
12
+ # Optional, gitignored file for secrets such as LLM API keys
13
+ env_file:
14
+ - path: .env
15
+ required: false
9
16
  environment:
17
+ # Store ~/.claude.json inside the persistent ~/.claude volume as well
18
+ CLAUDE_CONFIG_DIR: /home/vscode/.claude
19
+ CODEX_HOME: /home/vscode/.codex
10
20
  LANGUAGE: en
11
21
  GRAMPSWEB_BASE_URL: http://localhost:8001
12
22
  GRAMPSWEB_USER_DB_URI: sqlite:////workspaces/web-api/data/users.sqlite
@@ -19,13 +29,18 @@ services:
19
29
  GRAMPSWEB_BACKUP_DIR: /workspaces/web-api/data/backup
20
30
  GRAMPSHOME: /workspaces/web-api/data/
21
31
  GRAMPS_DATABASE_PATH: /workspaces/web-api/data/grampsdb
22
- GRAMPSWEB_TREE: "Gramps Web"
32
+ # Multi-tree mode; trees and users are set up by scripts/init_dev_trees.py
33
+ GRAMPSWEB_TREE: "*"
34
+ GRAMPSWEB_MEDIA_PREFIX_TREE: true
23
35
  # Do not use this value in production!!
24
36
  GRAMPSWEB_SECRET_KEY: QAVoeYDzkQves9iDZ5PkxfdUoVElVMVYPqz-QXha6yE
25
37
  GRAMPSWEB_CORS_ORIGINS: "*"
26
- # To test the AI assistant with a local model, see CONTRIBUTING.md
38
+ # The Mistral model needs MISTRAL_API_KEY in .devcontainer/.env.
39
+ # To test the AI assistant with a local model instead, see CONTRIBUTING.md
27
40
  # GRAMPSWEB_LLM_BASE_URL: http://ollama:11434/v1/
28
- # GRAMPSWEB_LLM_MODEL: qwen2.5:7b
41
+ GRAMPSWEB_LLM_ALLOW_WRITE_PROPOSALS: true
42
+ GRAMPSWEB_LLM_MODEL: mistral:mistral-medium-latest
43
+ GRAMPSWEB_LLM_VISION: true
29
44
  GRAMPSWEB_CELERY_CONFIG__broker_url: redis://redis:6379/0
30
45
  GRAMPSWEB_CELERY_CONFIG__result_backend: redis://redis:6379/0
31
46
  GRAMPSWEB_LOG_LEVEL: DEBUG
@@ -49,3 +64,5 @@ services:
49
64
 
50
65
  volumes:
51
66
  ollama-data:
67
+ claude-config:
68
+ codex-config:
@@ -64,10 +64,11 @@ The devcontainer includes an optional [Ollama](https://ollama.com/) service for
64
64
  docker compose -f .devcontainer/docker-compose.yml exec ollama ollama pull qwen2.5:7b
65
65
  ```
66
66
 
67
- 3. In `.devcontainer/docker-compose.yml`, uncomment the `GRAMPSWEB_LLM_*` lines:
67
+ 3. In `.devcontainer/docker-compose.yml`, uncomment `GRAMPSWEB_LLM_BASE_URL`, change the value of `GRAMPSWEB_LLM_MODEL` (do not add a second one), and turn off vision, which this model does not support:
68
68
  ```yaml
69
69
  GRAMPSWEB_LLM_BASE_URL: http://ollama:11434/v1/
70
70
  GRAMPSWEB_LLM_MODEL: qwen2.5:7b
71
+ GRAMPSWEB_LLM_VISION: false
71
72
  ```
72
73
 
73
74
  4. Restart the devcontainer to pick up the new environment variables.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gramps-webapi
3
- Version: 3.26.0
3
+ Version: 3.26.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>
@@ -56,7 +56,7 @@ Requires-Dist: httpx2!=2.16.1; extra == "ai"
56
56
  Provides-Extra: face
57
57
  Requires-Dist: opencv-python-headless<6,>=4.8; extra == "face"
58
58
  Provides-Extra: sentry
59
- Requires-Dist: sentry-sdk[flask]>=2.0.0; extra == "sentry"
59
+ Requires-Dist: sentry-sdk[flask]<3,>=2.0.0; extra == "sentry"
60
60
  Provides-Extra: test
61
61
  Requires-Dist: pytest; extra == "test"
62
62
  Requires-Dist: PyYAML; extra == "test"
@@ -64,7 +64,7 @@ Provides-Extra: all
64
64
  Requires-Dist: pydantic-ai-slim[anthropic,bedrock,google,groq,mistral,openai]<2.0.0,>=1.101.0; extra == "all"
65
65
  Requires-Dist: httpx2!=2.16.1; extra == "all"
66
66
  Requires-Dist: opencv-python-headless<6,>=4.8; extra == "all"
67
- Requires-Dist: sentry-sdk[flask]>=2.0.0; extra == "all"
67
+ Requires-Dist: sentry-sdk[flask]<3,>=2.0.0; extra == "all"
68
68
  Requires-Dist: pytest; extra == "all"
69
69
  Requires-Dist: PyYAML; extra == "all"
70
70
  Dynamic: license-file
@@ -0,0 +1,47 @@
1
+ # Roadmap
2
+
3
+ Release timing and breaking changes, for projects building on the API.
4
+ Features live in the issue tracker; dates here are estimates.
5
+
6
+ ## Versioning
7
+
8
+ Semver applies to the HTTP API, config options and env vars, not to Python internals.
9
+ Only majors break: minors add, patches fix. Deprecations are announced in a minor and
10
+ removed no earlier than the next major.
11
+
12
+ Exception: an optional feature can be removed in a minor, at the earliest one minor after
13
+ its deprecation, if neither clients nor deployments have to change. Its config options
14
+ and API parameters are then still accepted but ignored.
15
+
16
+ ## Releases
17
+
18
+ | Version | Target | Gramps | Breaking changes |
19
+ |---|---|---|---|
20
+ | 3.26.x | current | 6.0 | Gramps QL removed, `/query/` request body |
21
+ | 3.27.0 | end of November 2026 | 6.0 |
22
+ | 3.x | as needed | 6.0 | none |
23
+ | 4.0.0 | TBD | 6.1 | multi-tree by default, removals below |
24
+ | 5.0.0 | TBD | 6.2 | TBD |
25
+
26
+ ## Breaking in 3.27
27
+
28
+ TBD
29
+
30
+ ## Breaking in 4.0
31
+
32
+ > Note: Depending on the (unknown) release date of Gramps 6.1, these breaking changes may be moved to 5.0 instead.
33
+
34
+ Multi-tree mode becomes the default and single-tree mode goes away
35
+ ([#885](https://github.com/gramps-project/gramps-web-api/issues/885)).
36
+
37
+ | Removed | Replacement |
38
+ |---|---|
39
+ | Unprefixed env vars (`TREE`, `SECRET_KEY`, …) | `GRAMPSWEB_*` |
40
+ | `SEARCH_INDEX_DIR` | `SEARCH_INDEX_DB_URI` |
41
+ | `EMAIL_USE_TLS` | `EMAIL_USE_SSL` / `EMAIL_USE_STARTTLS` |
42
+ | `GET /api/token/create_owner/` | `POST` on same endpoint |
43
+ | `tree` arg on `GET /api/oidc/login/` | Tree selection after login |
44
+
45
+ Support for the `PostgreSQL` backend will be dropped in 4.0, because it is not compatible with multi-tree mode. Note that both the `SharedPostgreSQL` and `SQLite` backends will continue to be fully supported.
46
+
47
+ Configuration via the database is removed in 4.0, so that all configuration is in env vars or config files. The `config` table will be dropped, and the `config` API endpoints will return 404.
@@ -19,4 +19,4 @@
19
19
 
20
20
  """Version information."""
21
21
 
22
- __version__ = "3.26.0"
22
+ __version__ = "3.26.2"
@@ -28,7 +28,7 @@ from io import BytesIO
28
28
  from pathlib import Path
29
29
  from typing import IO, Any, BinaryIO, Optional, Tuple, Union
30
30
 
31
- from flask import jsonify, make_response, send_file, send_from_directory, current_app
31
+ from flask import current_app, jsonify, make_response, send_file, send_from_directory
32
32
  from gramps.gen.db.base import DbReadBase
33
33
  from gramps.gen.errors import HandleError
34
34
  from gramps.gen.lib import Media
@@ -187,6 +187,38 @@ class FileHandler:
187
187
  return data
188
188
 
189
189
 
190
+ def normalize_media_path(path: str) -> str:
191
+ """Return a media object's path with `/` as the only separator.
192
+
193
+ Gramps stores media paths as written on the computer that added them,
194
+ so paths added on Windows use backslashes. The database keeps them that
195
+ way, so that syncing with that computer sees no change; code that turns
196
+ a media path into a name (a ZIP member, a download, a comparison with
197
+ one) uses this function, and code looking for the file on disk uses
198
+ `media_path_to_fs`.
199
+ """
200
+ return path.replace("\\", "/")
201
+
202
+
203
+ def media_path_to_fs(base_dir: FilenameOrPath, path: str) -> str:
204
+ """Return the file system path of a media file, relative to the base dir.
205
+
206
+ Backslashes are read as separators, so `a\\b.jpg` is the file `b.jpg` in
207
+ the folder `a`. A backslash is a valid character in POSIX file names,
208
+ though, and earlier versions stored such files under their literal name.
209
+ If there is no file at the converted path but one at the literal path,
210
+ the literal path is returned.
211
+ """
212
+ converted = normalize_media_path(path)
213
+ if converted == path:
214
+ return path
215
+ if not os.path.lexists(os.path.join(base_dir, converted)) and os.path.lexists(
216
+ os.path.join(base_dir, path)
217
+ ):
218
+ return path
219
+ return converted
220
+
221
+
190
222
  class LocalFileHandler(FileHandler):
191
223
  """Handler for local files."""
192
224
 
@@ -194,12 +226,13 @@ class LocalFileHandler(FileHandler):
194
226
  """Initialize self given a handle and media base directory."""
195
227
  super().__init__(handle, db_handle=db_handle)
196
228
  self.base_dir = base_dir
197
- if os.path.isabs(self.path):
198
- self.path_abs = self.path
199
- self.path_rel = os.path.relpath(self.path, self.base_dir)
229
+ fs_path = media_path_to_fs(self.base_dir, self.path)
230
+ if os.path.isabs(fs_path):
231
+ self.path_abs = fs_path
232
+ self.path_rel = os.path.relpath(fs_path, self.base_dir)
200
233
  else:
201
- self.path_abs = os.path.join(self.base_dir, self.path)
202
- self.path_rel = self.path
234
+ self.path_abs = os.path.join(self.base_dir, fs_path)
235
+ self.path_rel = fs_path
203
236
 
204
237
  def _check_path(self) -> None:
205
238
  """Check whether the file path is contained within the base dir.
@@ -38,7 +38,13 @@ from gramps.gen.utils.file import expand_media_path
38
38
  from ..auth import get_tree_usage, set_tree_usage
39
39
  from ..types import FilenameOrPath
40
40
  from ..util import get_extension
41
- from .file import FileHandler, LocalFileHandler, upload_file_local
41
+ from .file import (
42
+ FileHandler,
43
+ LocalFileHandler,
44
+ media_path_to_fs,
45
+ normalize_media_path,
46
+ upload_file_local,
47
+ )
42
48
  from .util import (
43
49
  abort_with_message,
44
50
  close_db,
@@ -106,11 +112,14 @@ def get_local_archive_dir(tree: str | None = None) -> str:
106
112
  return os.path.abspath(os.path.join(archive_dir, tree))
107
113
 
108
114
 
109
- def get_contained_path(base_dir: FilenameOrPath, path: FilenameOrPath) -> Path | None:
110
- """Return the resolved path of a media file, or None if outside the base dir."""
115
+ def get_contained_path(base_dir: FilenameOrPath, path: str) -> Path | None:
116
+ """Return the resolved path of a media file, or None if outside the base dir.
117
+
118
+ `path` is a media object's path; see `media_path_to_fs`.
119
+ """
111
120
  try:
112
121
  base_path = Path(base_dir).resolve()
113
- file_path = Path(base_path, path).resolve()
122
+ file_path = Path(base_path, media_path_to_fs(base_path, path)).resolve()
114
123
  except (OSError, RuntimeError, ValueError):
115
124
  return None # e.g. symlink loop or NUL byte
116
125
  if base_path not in file_path.parents:
@@ -211,13 +220,10 @@ class MediaHandlerLocal(MediaHandlerBase):
211
220
  ) -> None:
212
221
  """Upload a file from a stream."""
213
222
  if path is not None:
214
- if Path(path).is_absolute():
215
- # Don't allow absolute paths! This will raise
216
- # if path is not relative to base_dir
217
- rel_path: FilenameOrPath = Path(path).relative_to(self.base_dir)
218
- else:
219
- rel_path = path
220
- upload_file_local(self.base_dir, rel_path, stream)
223
+ file_path = get_contained_path(self.base_dir, str(path))
224
+ if file_path is None:
225
+ raise ValueError(f"File {path} is not within the base directory.")
226
+ upload_file_local(self.base_dir, file_path, stream)
221
227
  else:
222
228
  rel_path = self.get_default_filename(checksum, mime)
223
229
  upload_file_local(self.base_dir, rel_path, stream)
@@ -276,7 +282,8 @@ class MediaHandlerLocal(MediaHandlerBase):
276
282
  # name the file as the media object does, e.g. not after
277
283
  # a symlink's target, unless that name would escape the archive
278
284
  rel_path = os.path.relpath(
279
- os.path.join(self.base_dir, obj.path), self.base_dir
285
+ os.path.join(self.base_dir, normalize_media_path(obj.path)),
286
+ self.base_dir,
280
287
  )
281
288
  if is_parent_path(rel_path):
282
289
  rel_path = str(path.relative_to(Path(self.base_dir).resolve()))
@@ -423,7 +430,7 @@ class MediaHandlerS3(MediaHandlerBase):
423
430
  continue
424
431
  if obj.checksum not in remote_keys:
425
432
  continue
426
- media_path = os.path.normpath(obj.path)
433
+ media_path = os.path.normpath(normalize_media_path(obj.path))
427
434
  if os.path.isabs(media_path) or is_parent_path(media_path):
428
435
  continue # ignore paths that would escape the archive
429
436
  if media_path in names_seen:
@@ -16,7 +16,7 @@ from gramps.gen.lib import Media
16
16
 
17
17
  from ..auth import set_tree_usage
18
18
  from ..types import FilenameOrPath
19
- from .file import get_checksum
19
+ from .file import get_checksum, normalize_media_path
20
20
  from .media import (
21
21
  MediaHandlerLocal,
22
22
  check_quota_media,
@@ -55,15 +55,21 @@ def match_members_to_paths(
55
55
  ) -> Dict[str, str]:
56
56
  """Map media paths to the names of the ZIP members holding their files.
57
57
 
58
- A member matches a path if its name equals the path. Failing that, it
59
- matches if the two have the same file name, ignoring case, and that file
60
- name occurs only once among the members and once among the paths not
61
- matched so far - otherwise there is no telling which file is which.
58
+ A member matches a path if its name equals the path, with backslashes
59
+ read as separators. Failing that, it matches if the two have the same file
60
+ name, ignoring case, and that file name occurs only once among the members
61
+ and once among the paths not matched so far - otherwise there is no
62
+ telling which file is which.
62
63
  """
63
64
  paths = list(paths)
64
65
  members = list(members)
65
66
  member_set = set(members)
66
- matches = {path: path for path in paths if path in member_set}
67
+ matches = {}
68
+ for path in paths:
69
+ for candidate in (path, normalize_media_path(path)):
70
+ if candidate in member_set:
71
+ matches[path] = candidate
72
+ break
67
73
  used = set(matches.values())
68
74
  members_by_name: Dict[str, List[str]] = {}
69
75
  for member in members:
@@ -203,10 +209,15 @@ class MediaImporter:
203
209
  _Match(obj, member, obj.checksum, obj.get_path(), False)
204
210
  )
205
211
  continue
206
- member = member_by_path.get(obj.get_path())
212
+ path = obj.get_path()
213
+ member = member_by_path.get(path)
207
214
  if member is not None:
208
- renamed = member != obj.get_path()
209
- matches.append(_Match(obj, member, checksums[member], member, renamed))
215
+ # a Windows path naming the member is kept: it is the same path
216
+ renamed = member not in (path, normalize_media_path(path))
217
+ new_path = member if renamed else path
218
+ matches.append(
219
+ _Match(obj, member, checksums[member], new_path, renamed)
220
+ )
210
221
  sizes = {name: info.file_size for name, info in infos.items()}
211
222
  return matches, sizes
212
223
 
@@ -38,7 +38,7 @@ from ...auth.const import PERM_EDIT_OBJ
38
38
  from ...util import get_extension
39
39
  from ..auth import require_permissions
40
40
  from ..blueprint import api_blueprint
41
- from ..file import process_file
41
+ from ..file import normalize_media_path, process_file
42
42
  from ..media import check_quota_media, get_media_handler
43
43
  from ..tasks import run_task, update_media_usage_task
44
44
  from ..util import (
@@ -98,7 +98,7 @@ class MediaFileResource(ProtectedResource):
98
98
  handle, db_handle=db_handle
99
99
  )
100
100
  download = bool(args.get("download"))
101
- filename = os.path.basename(obj.path)
101
+ filename = os.path.basename(normalize_media_path(obj.path))
102
102
  return handler.send_file(
103
103
  etag=obj.checksum, download=download, filename=filename
104
104
  )
@@ -58,6 +58,10 @@ def create_celery(app):
58
58
  class ContextTask(Task):
59
59
  """Celery task which is aware of the flask app context."""
60
60
 
61
+ # expected outcomes: logged at INFO without a traceback, still stored
62
+ # as a failure in the result backend
63
+ throws = (TaskRejection,)
64
+
61
65
  def __call__(self, *args, **kwargs):
62
66
  if self.request.called_directly:
63
67
  return self.run(*args, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gramps-webapi
3
- Version: 3.26.0
3
+ Version: 3.26.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>
@@ -56,7 +56,7 @@ Requires-Dist: httpx2!=2.16.1; extra == "ai"
56
56
  Provides-Extra: face
57
57
  Requires-Dist: opencv-python-headless<6,>=4.8; extra == "face"
58
58
  Provides-Extra: sentry
59
- Requires-Dist: sentry-sdk[flask]>=2.0.0; extra == "sentry"
59
+ Requires-Dist: sentry-sdk[flask]<3,>=2.0.0; extra == "sentry"
60
60
  Provides-Extra: test
61
61
  Requires-Dist: pytest; extra == "test"
62
62
  Requires-Dist: PyYAML; extra == "test"
@@ -64,7 +64,7 @@ Provides-Extra: all
64
64
  Requires-Dist: pydantic-ai-slim[anthropic,bedrock,google,groq,mistral,openai]<2.0.0,>=1.101.0; extra == "all"
65
65
  Requires-Dist: httpx2!=2.16.1; extra == "all"
66
66
  Requires-Dist: opencv-python-headless<6,>=4.8; extra == "all"
67
- Requires-Dist: sentry-sdk[flask]>=2.0.0; extra == "all"
67
+ Requires-Dist: sentry-sdk[flask]<3,>=2.0.0; extra == "all"
68
68
  Requires-Dist: pytest; extra == "all"
69
69
  Requires-Dist: PyYAML; extra == "all"
70
70
  Dynamic: license-file
@@ -22,6 +22,7 @@ requirements-dev.txt
22
22
  setup.cfg
23
23
  setup.py
24
24
  .devcontainer/Dockerfile
25
+ .devcontainer/devcontainer-lock.json
25
26
  .devcontainer/devcontainer.json
26
27
  .devcontainer/docker-compose.yml
27
28
  .github/ISSUE_TEMPLATE/bug_report.yml
@@ -209,6 +210,7 @@ gramps_webapi/templates/reset_password_error.html
209
210
  gramps_webapi/util/__init__.py
210
211
  gramps_webapi/util/celery.py
211
212
  gramps_webapi/util/task_state.py
213
+ scripts/init_dev_trees.py
212
214
  scripts/s3_rename.py
213
215
  scripts/search_benchmark.py
214
216
  scripts/start_dev_container.sh
@@ -44,7 +44,7 @@ httpx2!=2.16.1
44
44
  pydantic-ai-slim[anthropic,bedrock,google,groq,mistral,openai]<2.0.0,>=1.101.0
45
45
  httpx2!=2.16.1
46
46
  opencv-python-headless<6,>=4.8
47
- sentry-sdk[flask]>=2.0.0
47
+ sentry-sdk[flask]<3,>=2.0.0
48
48
  pytest
49
49
  PyYAML
50
50
 
@@ -52,7 +52,7 @@ PyYAML
52
52
  opencv-python-headless<6,>=4.8
53
53
 
54
54
  [sentry]
55
- sentry-sdk[flask]>=2.0.0
55
+ sentry-sdk[flask]<3,>=2.0.0
56
56
 
57
57
  [test]
58
58
  pytest
@@ -60,9 +60,9 @@ dependencies = [
60
60
  # https://github.com/pydantic/httpx2/discussions/1345
61
61
  ai = ["pydantic-ai-slim[openai,anthropic,google,mistral,groq,bedrock]>=1.101.0,<2.0.0", "httpx2!=2.16.1"]
62
62
  face = ["opencv-python-headless>=4.8,<6"]
63
- sentry = ["sentry-sdk[flask]>=2.0.0"]
63
+ sentry = ["sentry-sdk[flask]>=2.0.0,<3"]
64
64
  test = ["pytest", "PyYAML"]
65
- all = ["pydantic-ai-slim[openai,anthropic,google,mistral,groq,bedrock]>=1.101.0,<2.0.0", "httpx2!=2.16.1", "opencv-python-headless>=4.8,<6", "sentry-sdk[flask]>=2.0.0", "pytest", "PyYAML"]
65
+ all = ["pydantic-ai-slim[openai,anthropic,google,mistral,groq,bedrock]>=1.101.0,<2.0.0", "httpx2!=2.16.1", "opencv-python-headless>=4.8,<6", "sentry-sdk[flask]>=2.0.0,<3", "pytest", "PyYAML"]
66
66
 
67
67
  [project.urls]
68
68
  homepage = "https://github.com/gramps-project/gramps-web-api"
@@ -0,0 +1,182 @@
1
+ """Set up the dev container's family trees and users (multi-tree mode).
2
+
3
+ Creates two trees with fixed IDs:
4
+
5
+ - ``example``: the Gramps example tree, including its media files
6
+ - ``empty``: an empty tree
7
+
8
+ and one user per role for each tree (password = user name), plus a
9
+ tree-less admin. Uses the Gramps Python API only; never the ``gramps``
10
+ executable, which can fall back to opening the GUI.
11
+
12
+ Runs on every container start and is safe to rerun:
13
+
14
+ - Complete trees and existing users are left alone.
15
+ - A tree whose setup was interrupted is deleted and set up again.
16
+ - Data from the old single-tree dev setup (a tree named "Gramps Web", users
17
+ ``owner`` etc. without a tree, media at the top of the media directory)
18
+ is moved over to multi-tree mode instead of being replaced.
19
+
20
+ Expects the dev container's environment (GRAMPSWEB_TREE="*",
21
+ GRAMPS_DATABASE_PATH, GRAMPSWEB_USER_DB_URI, GRAMPSWEB_MEDIA_BASE_DIR, ...).
22
+ """
23
+
24
+ import os
25
+ import shutil
26
+
27
+ from gramps.cli.clidbman import NAME_FILE
28
+ from gramps.gen.config import config
29
+
30
+ from gramps_webapi.api.resources.util import run_import
31
+ from gramps_webapi.app import create_app
32
+ from gramps_webapi.auth import User, add_user, modify_user, user_db
33
+ from gramps_webapi.auth.const import (
34
+ ROLE_ADMIN,
35
+ ROLE_CONTRIBUTOR,
36
+ ROLE_EDITOR,
37
+ ROLE_MEMBER,
38
+ ROLE_OWNER,
39
+ )
40
+ from gramps_webapi.dbmanager import WebDbManager
41
+
42
+ EXAMPLE_DIR = "/usr/local/share/doc/gramps/example/gramps"
43
+ EXAMPLE_FILE = os.path.join(EXAMPLE_DIR, "example.gramps")
44
+
45
+ TREES = {"example": "Example Tree", "empty": "Empty Tree"}
46
+
47
+ ROLES = {
48
+ "owner": ROLE_OWNER,
49
+ "editor": ROLE_EDITOR,
50
+ "contributor": ROLE_CONTRIBUTOR,
51
+ "member": ROLE_MEMBER,
52
+ }
53
+
54
+ # Name of the single tree created by the old dev setup
55
+ LEGACY_TREE_NAME = "Gramps Web"
56
+
57
+ # Present in a tree directory while the tree is being set up
58
+ SEEDING_MARKER = ".dev_seeding"
59
+
60
+
61
+ def import_example(tree_id: str) -> None:
62
+ """Import the Gramps example file into a tree."""
63
+ dbmgr = WebDbManager(dirname=tree_id, create_if_missing=False)
64
+ dbstate = dbmgr.get_db(readonly=False)
65
+ try:
66
+ # run_import deletes the file it imports, so import a copy
67
+ tmp_file = os.path.join(dbmgr.path, "example.gramps")
68
+ shutil.copy(EXAMPLE_FILE, tmp_file)
69
+ run_import(dbstate.db, tmp_file, extension="gramps", delete=True)
70
+ finally:
71
+ dbstate.db.close()
72
+
73
+
74
+ def is_complete(tree_path: str) -> bool:
75
+ """Tell whether a tree directory holds a fully set up tree.
76
+
77
+ WebDbManager writes the name file last when creating a tree, and the
78
+ seeding marker is only removed once the import and media copy are done.
79
+ """
80
+ return os.path.isfile(os.path.join(tree_path, NAME_FILE)) and not os.path.exists(
81
+ os.path.join(tree_path, SEEDING_MARKER)
82
+ )
83
+
84
+
85
+ def find_legacy_tree() -> str | None:
86
+ """Return the directory name of the old single-tree setup's tree, if any."""
87
+ try:
88
+ return WebDbManager(name=LEGACY_TREE_NAME, create_if_missing=False).dirname
89
+ except ValueError:
90
+ return None
91
+
92
+
93
+ def migrate_legacy_media(media_base_dir: str, tree_id: str, db_path: str) -> None:
94
+ """Move media files of the old single-tree setup into the tree's directory."""
95
+ target = os.path.join(media_base_dir, tree_id)
96
+ if os.path.exists(target) or not os.path.isdir(media_base_dir):
97
+ return # already migrated, or nothing to migrate
98
+ tree_dirs = set(os.listdir(db_path))
99
+ entries = [
100
+ entry
101
+ for entry in os.listdir(media_base_dir)
102
+ # leave the media directories of other trees alone
103
+ if not (
104
+ entry in tree_dirs and os.path.isdir(os.path.join(media_base_dir, entry))
105
+ )
106
+ ]
107
+ os.makedirs(target)
108
+ for entry in entries:
109
+ shutil.move(os.path.join(media_base_dir, entry), target)
110
+ print(f"Moved {len(entries)} media files/folders to {target}")
111
+
112
+
113
+ def setup_tree(tree_id: str, name: str, db_path: str, media_base_dir: str) -> None:
114
+ """Create one of the dev trees, unless it is already complete."""
115
+ tree_path = os.path.join(db_path, tree_id)
116
+ if os.path.isdir(tree_path):
117
+ if is_complete(tree_path):
118
+ print(f"Tree '{tree_id}' exists, skipping")
119
+ return
120
+ print(f"Setup of tree '{tree_id}' was interrupted, starting over")
121
+ shutil.rmtree(tree_path)
122
+ WebDbManager(dirname=tree_id, name=name, create_if_missing=True)
123
+ marker = os.path.join(tree_path, SEEDING_MARKER)
124
+ with open(marker, "w", encoding="utf8"):
125
+ pass
126
+ if tree_id == "example":
127
+ import_example(tree_id)
128
+ media_dir = os.path.join(media_base_dir, tree_id)
129
+ shutil.copytree(EXAMPLE_DIR, media_dir, dirs_exist_ok=True)
130
+ os.remove(marker)
131
+
132
+
133
+ def main() -> None:
134
+ """Create the dev trees and users."""
135
+ app = create_app()
136
+ with app.app_context():
137
+ db_path = config.get("database.path") # set by create_app
138
+ media_base_dir = app.config["MEDIA_BASE_DIR"]
139
+
140
+ # The old single-tree setup's tree plays the part of the example tree
141
+ legacy_tree = find_legacy_tree()
142
+ if legacy_tree:
143
+ print(
144
+ f"Found tree '{LEGACY_TREE_NAME}' of the old single-tree setup, "
145
+ "using it instead of the example tree"
146
+ )
147
+ migrate_legacy_media(media_base_dir, legacy_tree, db_path)
148
+
149
+ for tree_id, name in TREES.items():
150
+ if tree_id == "example" and legacy_tree:
151
+ continue
152
+ setup_tree(tree_id, name, db_path, media_base_dir)
153
+
154
+ user_db.create_all()
155
+ example_tree = legacy_tree or "example"
156
+ users: list[tuple[str, int, str | None]] = [("admin", ROLE_ADMIN, None)]
157
+ for tree_id in TREES:
158
+ # example tree users keep the short names used so far
159
+ prefix = "" if tree_id == "example" else f"{tree_id}_"
160
+ target = example_tree if tree_id == "example" else tree_id
161
+ users += [(f"{prefix}{r}", role, target) for r, role in ROLES.items()]
162
+ existing = dict(user_db.session.query(User.name, User.tree))
163
+ for username, role, user_tree in users:
164
+ if username not in existing:
165
+ add_user(
166
+ username,
167
+ username,
168
+ fullname=username.replace("_", " ").title(),
169
+ role=role,
170
+ tree=user_tree,
171
+ )
172
+ elif user_tree and not existing[username]:
173
+ # Users of the old single-tree setup have no tree, which
174
+ # locks them out in multi-tree mode
175
+ modify_user(username, tree=user_tree)
176
+ print(f"Assigned user '{username}' to tree '{user_tree}'")
177
+ else:
178
+ print(f"User '{username}' exists, skipping")
179
+
180
+
181
+ if __name__ == "__main__":
182
+ main()