pygitweb 0.3.0__tar.gz → 0.3.1__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 (166) hide show
  1. {pygitweb-0.3.0 → pygitweb-0.3.1}/LICENSE +21 -21
  2. {pygitweb-0.3.0 → pygitweb-0.3.1}/PKG-INFO +134 -134
  3. {pygitweb-0.3.0 → pygitweb-0.3.1}/README.md +131 -131
  4. {pygitweb-0.3.0 → pygitweb-0.3.1}/pyproject.toml +3 -3
  5. {pygitweb-0.3.0 → pygitweb-0.3.1}/pyproject.toml.orig +31 -31
  6. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/__init__.py +22 -22
  7. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/__meta__.py +9 -9
  8. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/actions.py +1374 -1379
  9. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/addproject_permissions_test.py +113 -113
  10. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/action.py +21 -21
  11. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/plugins/project_zip.py +71 -71
  12. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/project.py +67 -67
  13. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/subpage.py +62 -62
  14. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/auth.py +961 -872
  15. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/auth_config.py +301 -301
  16. pygitweb-0.3.1/src/pygitweb/auth_keys_test.py +309 -0
  17. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/auth_oauth.py +342 -342
  18. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/auth_test.py +823 -802
  19. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/blog_routes_test.py +155 -155
  20. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/board_refs.py +154 -154
  21. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/board_refs_test.py +106 -106
  22. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/boards_permissions_test.py +143 -143
  23. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/capacity_config.py +79 -79
  24. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/change_queue.py +130 -130
  25. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/change_queue_routes_test.py +168 -168
  26. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/change_queue_test.py +126 -126
  27. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/comments_permissions_test.py +232 -232
  28. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/config.py +193 -193
  29. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/conftest.py +43 -43
  30. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/dependencies.py +166 -166
  31. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/formatting.py +182 -182
  32. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/formatting_test.py +68 -68
  33. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/git_helpers.py +513 -513
  34. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/git_helpers_test.py +267 -267
  35. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/gravatar.py +16 -16
  36. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/gravatar_test.py +10 -10
  37. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/hooks_install.py +323 -324
  38. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/hooks_install_test.py +383 -383
  39. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/hooks_permissions_test.py +115 -115
  40. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/main.py +998 -998
  41. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/merge_requests.py +233 -233
  42. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/merge_requests_test.py +103 -103
  43. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/mr_permissions_test.py +227 -227
  44. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/password_hash.py +89 -89
  45. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/password_hash_test.py +27 -27
  46. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/permissions.py +302 -286
  47. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/permissions_test.py +218 -201
  48. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/plugin_loader.py +156 -156
  49. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/plugin_loader_test.py +154 -154
  50. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/project_list_routes_test.py +58 -58
  51. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/projects.py +213 -213
  52. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/projects_test.py +186 -186
  53. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/sessions.py +73 -73
  54. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/settings.py +458 -458
  55. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/settings_config.py +122 -122
  56. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/settings_config_test.py +111 -111
  57. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/settings_permissions_test.py +97 -97
  58. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/settings_plugins_test.py +58 -58
  59. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/shutdown.py +63 -63
  60. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/smart_http.py +332 -280
  61. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/smart_http_test.py +992 -881
  62. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/addproject.js +119 -119
  63. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/blob-view.js +127 -127
  64. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/blog.js +377 -377
  65. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-cards.js +268 -268
  66. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-comments.js +164 -164
  67. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-context.js +121 -121
  68. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-dnd.js +154 -154
  69. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-markdown.js +75 -75
  70. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-popout.js +431 -431
  71. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board-refs.js +283 -283
  72. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/board.js +157 -157
  73. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/diff-view.js +43 -43
  74. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/dom.js +5 -5
  75. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/hook-install.js +53 -53
  76. pygitweb-0.3.1/src/pygitweb/static/login.js +19 -0
  77. pygitweb-0.3.1/src/pygitweb/static/logo.svg +54 -0
  78. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/main.css +1712 -1602
  79. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/navbar-auth.js +112 -112
  80. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/readme-render.js +172 -172
  81. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/search-page.js +135 -135
  82. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/summary-ref-switcher.js +120 -120
  83. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/theme.js +10 -10
  84. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/themes/solarized.css +34 -34
  85. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/user-keys.js +109 -109
  86. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/highlight-11.9.0.min.js +1212 -1212
  87. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/showdown-2.1.0.min.js +3 -3
  88. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/tabler-1.0.0-beta17.min.css +8 -8
  89. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/tabler-1.0.0-beta17.min.js +14 -14
  90. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/conftest.py +68 -68
  91. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/harness.js +322 -322
  92. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/js_runtime.py +277 -277
  93. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/pages.py +114 -114
  94. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_addproject.py +167 -167
  95. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_blob-view.py +83 -83
  96. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-cards.py +195 -195
  97. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-comments.py +132 -132
  98. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-context.py +143 -143
  99. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-dnd.py +115 -115
  100. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-markdown.py +76 -76
  101. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-popout.py +172 -172
  102. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board-refs.py +142 -142
  103. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_board.py +156 -156
  104. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_diff-view.py +77 -77
  105. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_dom.py +14 -14
  106. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_hook-install.py +89 -89
  107. pygitweb-0.3.1/src/pygitweb/static_tests/test_login.py +36 -0
  108. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_navbar-auth.py +131 -131
  109. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_readme-render.py +119 -119
  110. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_search-page.py +153 -153
  111. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static_tests/test_summary-ref-switcher.py +160 -160
  112. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/tasks.py +801 -801
  113. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/tasks_permissions_test.py +136 -136
  114. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/tasks_routes_test.py +598 -598
  115. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/team.py +183 -183
  116. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/team_routes_test.py +143 -143
  117. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/activity.html +44 -44
  118. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/addproject.html +62 -62
  119. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/base.html +109 -107
  120. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/blob.html +19 -19
  121. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/blobdiff.html +16 -16
  122. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/blog.html +79 -79
  123. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/board.html +52 -52
  124. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/board_card.html +96 -96
  125. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/commitdiff.html +16 -16
  126. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/hooks_summary_cell.html +37 -37
  127. pygitweb-0.3.1/src/pygitweb/templates/login.html +88 -0
  128. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/macros.html +31 -31
  129. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/merge_request_summary_cell.html +18 -18
  130. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/merge_request_tag.html +97 -97
  131. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/message.html +6 -6
  132. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/pagination.html +44 -44
  133. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/project_list.html +87 -87
  134. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/project_settings.html +16 -16
  135. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/pygit2_settings.html +16 -16
  136. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/pygitweb_settings.html +50 -50
  137. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/readme_card.html +9 -9
  138. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/search.html +81 -81
  139. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/settings_form_field.html +27 -27
  140. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/shutdown_ack.html +9 -9
  141. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/subpage.html +9 -9
  142. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/summary.html +87 -87
  143. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/table.html +15 -15
  144. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/table_page.html +35 -35
  145. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/tasks.html +27 -27
  146. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/team.html +50 -50
  147. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/team_capacity_form.html +29 -29
  148. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/tree.html +13 -13
  149. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates/user_profile.html +88 -85
  150. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates_env.py +107 -107
  151. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/templates_env_test.py +116 -116
  152. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/timeline_cache.py +243 -243
  153. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/validation.py +75 -75
  154. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/validation_test.py +167 -167
  155. pygitweb-0.3.0/src/pygitweb/static/logo.svg +0 -44
  156. pygitweb-0.3.0/src/pygitweb/templates/login.html +0 -45
  157. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/__init__.py +0 -0
  158. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/api/plugins/__init__.py +0 -0
  159. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud-down.svg +0 -0
  160. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud-exclamation.svg +0 -0
  161. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud-filled.svg +0 -0
  162. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud-storm.svg +0 -0
  163. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud-up.svg +0 -0
  164. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/icons/cloud.svg +0 -0
  165. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/diff2html-3.4.56-ui.min.js +0 -0
  166. {pygitweb-0.3.0 → pygitweb-0.3.1}/src/pygitweb/static/vendor/diff2html-3.4.56.min.css +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Will Bowers
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Will Bowers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygitweb
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Gitweb reimplementation with FastAPI and Pygit2
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
7
- Requires-Dist: pygittools>=0.2.0
7
+ Requires-Dist: pygittools>=0.3.1
8
8
  Requires-Dist: fastapi[standard-no-fastapi-cloud-cli]>=0.104.0
9
9
  Requires-Dist: uvicorn[standard]>=0.24.0
10
10
  Requires-Dist: python-multipart>=0.0.6
@@ -15,137 +15,137 @@ Requires-Dist: pydantic-settings>=2.13.0
15
15
  Requires-Dist: httpx>=0.27.0
16
16
  Requires-Dist: python-ripgrep==0.0.9
17
17
  Requires-Dist: abcreg>=0.2.0
18
- Requires-Python: >=3.11
18
+ Requires-Python: >=3.12
19
19
  Description-Content-Type: text/markdown
20
20
 
21
- # Pygitweb
22
-
23
- Gitweb reimplementation using **Python**, **FastAPI**, and **Pygit2**, ported from `git/gitweb/gitweb.perl`.
24
-
25
- ## Config
26
-
27
- Settings load from `~/.pygitweb/settings.json` (or `PYGITWEB_SETTINGS_CONFIG`), `PYGITWEB_*`
28
- environment variables, and optionally a `.env` file in the working directory via
29
- `pydantic-settings`. See `src/pygitweb/config.py` and `settings.schema.json` for the full schema. Common ones:
30
-
31
- - `PYGITWEB_PROJECTROOT` — absolute path to directory containing git repositories (default: `$HOME`)
32
- - `PYGITWEB_PROJECTS_LIST` — directory to scan, or path to a project-list file (default: `PROJECTROOT`)
33
- - `PYGITWEB_EXPORT_OK` — filename that must exist to allow export (e.g. `git-daemon-export-ok`); empty = no check
34
- - `PYGITWEB_SITE_NAME` — site name in titles (default: `PyGitWeb`)
35
- - `PYGITWEB_GIT` — path to the git executable (default: `git`)
36
- - `PYGITWEB_AUTH` — `0` / `false` / `off` disables auth; `1` / `true` / `on` enables it. If **unset or empty**, auth defaults to **on**.
37
- - `PYGITWEB_AUTH_CONFIG` — path to the auth JSON file (default: `~/.pygitweb/auth.json`). Generated to a reasonable default if not present.
38
- - `PYGITWEB_SETTINGS_CONFIG` — path to the settings JSON file (default: `~/.pygitweb/settings.json`). Created from the environment on first run if missing.
39
- - `PYGITWEB_ENABLED_PLUGINS` — installed plugins to load. The settings page can change this list and reload plugins immediately (`POST /settings/pygitweb/plugins`).
40
- - `PYGITWEB_API_KEY_MAX_COUNT` — maximum Smart HTTP API keys each local user may hold (default: `2`).
41
- - `PYGITWEB_API_KEY_EXPIRY_DAYS` — lifetime of a newly issued API key, in days. `0` means the key does not expire (the default).
42
- - Browser login: `GET /login` (optional `?next=/path`), `POST /login` with form fields `username`, `password`, `next`; sets an HttpOnly cookie with an opaque in-process session id (also accepted by protected routes via `Authorization: Bearer`). Sessions are wiped when the process exits. `GET /logout?next=/` revokes the session and clears the cookie.
43
- - Account and Smart HTTP keys (auth required): `GET /user` is the account page. `POST /user/keys` with JSON `{"id": "...", "readonly": false}` issues a key and returns the plaintext secret once; only its scrypt hash is stored. `readonly: true` allows fetch but not push. `DELETE /user/keys?id=<id>` revokes one key. Clone and push attempts are appended to `~/.pygitweb/smart_http.log`.
44
-
45
- ## Routes
46
-
47
- Load the `/docs` page for a detailed view of routes (below the readme).
48
-
49
- **No-project routes**
50
-
51
- - `GET /`: project list
52
- - `GET /index`: plain text project index (path, owner)
53
- - `GET /opml`: OPML feed list
54
- - `GET /project/{name}`: Project dispatch (See actions table)
55
-
56
- **Hook management routes**
57
-
58
- - `GET /project/{name}/hooks`: JSON `{hooks: [...samples...], bundles: [...]}` with current status (`installed`, `not_installed`, `different`) for every pygittools sample and bundle
59
- - `POST /project/{name}/hook?name=<sample-or-bundle>&op=<add|remove|check>`: install, remove, or check one sample or bundle. `name` may be a sample filename (e.g. `post-receive.notify`) or a bundle name (e.g. `update`, which expands to `post-commit.notify` + `post-receive.notify`). `add`/`remove` refuse to clobber a custom hook with different content (returns `409`)
60
-
61
- **Actions**
62
-
63
- | Action | Query parameters | URL | Description |
64
- |--------|------------------|-----|-------------|
65
- | summary | *(default)* or `a` | `GET /project/{project}` | Project summary (description, owner, HEAD, tree link). |
66
- | tree | `h`, `f` | `GET /project/{project}?a=tree&h=...&f=...` | Directory listing (tree). |
67
- | blob | `h`, `f` | `GET /project/{project}?a=blob&h=...&f=...` | File view (HTML). |
68
- | blob_plain | `h`, `f` | `GET /project/{project}?a=blob_plain&h=...&f=...` | Raw file download. |
69
- | log | `h`, `updates`, `pf` | `GET /project/{project}?a=log&h=...` | Commit log. Supports long-poll subscribe. |
70
- | shortlog | `h`, `updates`, `pf` | `GET /project/{project}?a=shortlog&h=...` | Shortlog. Supports long-poll subscribe. |
71
- | history | `h`, `f`, `updates`, `pf` | `GET /project/{project}?a=history&h=...&f=...` | History of a file or path. Supports long-poll subscribe. |
72
- | heads | `updates`, `pf` | `GET /project/{project}?a=heads` | List branch heads. Supports long-poll subscribe. |
73
- | tags | `updates`, `pf` | `GET /project/{project}?a=tags` | List all tags. Supports long-poll subscribe. |
74
- | tag | `h` | `GET /project/{project}?a=tag&h=...` | Single tag view (tag ref or hash). |
75
- | commit | `h` | `GET /project/{project}?a=commit&h=...` | Commit information. |
76
- | commitdiff | `h` | `GET /project/{project}?a=commitdiff&h=...` | Commit diff (unified diff rendered with [diff2html](https://github.com/rtfpessoa/diff2html)). |
77
- | patch | `h` | `GET /project/{project}?a=patch&h=...` | Single-commit patch (plain text). |
78
- | patches | `h`, `hb` | `GET /project/{project}?a=patches&h=...&hb=...` | Multi-commit patches for range `hb..h` (plain text). |
79
- | blobdiff | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobdiff&h=...&hb=...&f=...&fp=...` | Blob diff (two versions of a file) rendered with diff2html. |
80
- | blobpatch | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobpatch&h=...&hb=...&f=...&fp=...` | Blob diff as plain unified diff. |
81
- | remotes | — | `GET /project/{project}?a=remotes` | List repo remotes. |
82
- | object | `h` | `GET /project/{project}?a=object&h=...` | Show object by type (commit, tree, tag, or blob). |
83
- | blame_raw | `h`, `f` | `GET /project/{project}?a=blame_raw&h=...&f=...` | File blame as JSON: array of `{commit_id, commit_msg, commit_author, time, line_range}`. Contiguous lines from the same commit are merged. |
84
- | blame | `h`, `f` | `GET /project/{project}?a=blame&h=...&f=...` | File blame HTML view (syntax-highlighted source, line numbers, commit links per line range; hover shows author and date). |
85
- | blame_incremental | — | | TODO |
86
- | blame_data | — | | TODO |
87
- | rss | — | | TODO |
88
- | atom | — | | TODO |
89
- | search | `patterns`, `paths`, `globs`, `heading`, `sort`, `max_count`, `multiline` | `GET /project/{project}?a=search&patterns=...` | Ripgrep search (via `python-ripgrep`); returns JSON. `paths` are relative to the project tree and cannot escape it. |
90
- | search (page) | — | `GET /project/{project}/search` | Per-project search UI page. |
91
- | search_help | — | | TODO |
92
-
93
- **Blog, boards, and tasks**
94
-
95
- - `GET /project/{project}/blog/`: markdown blog page when `articles/manifest.json` exists at `HEAD`. Otherwise the summary link stays disabled.
96
- - `GET /project/{project}/blog/raw/{path}`: raw blob from `HEAD` for the blog viewer (markdown, manifest, and assets). Paths that escape the tree return `404`.
97
- - `POST /tasks/move?project=<name>&board=<source>&task=<ref>&target=<board>`: move a task onto another board, such as a sprint board. Column headers on the board page show a running points total. `points` on create and update accepts `0`, `1`, `2`, `3`, `5`, `8`, `13`, or `21`; any other value is stored as unestimated.
98
- - `POST /tasks/archive?project=<name>&board=<source>&task=<ref>`: move a task to the archive board.
99
- - `POST /tasks/delete?project=<name>&board=<source>&task=<ref>`: delete a task.
100
-
101
- ## Query parameter short names (CGI mapping)
102
-
103
- - `p` → project
104
- - `a` → action
105
- - `f` → file_name
106
- - `fp` → file_parent
107
- - `h` → hash
108
- - `hp` → hash_parent
109
- - `hb` → hash_base
110
- - `hpb` → hash_parent_base
111
- - `pg` → page
112
- - `o` → order
113
- - `s` → searchtext
114
- - `st` → searchtype
115
- - `sf` → snapshot_format
116
- - `opt` → extra_options
117
- - `sr` → search_use_regexp
118
- - `by_tag` → ctag
119
- - `ds` → diff_style
120
- - `pf` → project_filter
121
- - `updates` → long-poll subscription flag (`true` parks the request up to 30s; returns `200 OK` with an empty body on timeout/shutdown, or the action data when the queue is notified)
122
-
123
- ## Live updates (long polling)
124
-
125
- Supported actions (`history`, `log`, `shortlog`, `heads`, `tags`) accept `updates=true` to
126
- subscribe to the project's change queue. The request is held for up to 30 seconds:
127
-
128
- - A `POST /_internal/notify?project=<name>` (typically from a server-side git hook) wakes
129
- matching subscribers, who then receive the freshly-rendered action response.
130
- - If no notification arrives in 30 seconds (or the server is shutting down), the response is `200 OK` with an empty body.
131
- - Combine with `pf=<prefix>` to subscribe to every project under a path prefix instead of
132
- just the URL project (the action is still rendered for the URL project).
133
-
134
- The notify endpoint is intended for loopback use by `pygittools` post-receive hooks (see
135
- `pygittools/hook_samples/post-receive.notify`). The server enforces loopback-only access and
136
- rejects unknown projects; production deployments should still restrict it at the reverse proxy.
137
-
138
- ## Hook management
139
-
140
- The project summary page exposes a **Hooks** row that lists installed hooks and lets you
141
- install or remove pygittools samples, including the `update` bundle: `post-receive.notify`
142
- (feeds the change queue when refs are pushed) and `post-commit.notify` (feeds the change
143
- queue when a working clone of this repo records a local commit). Either is sufficient to
144
- wake long-poll subscribers; installing both covers server-side and client-side commit paths.
145
-
146
- The same operations are available programmatically via
147
- `POST /project/{name}/hook?name=<sample-or-bundle>&op=<...>`. Bundle status is
148
- `INSTALLED` only when every member is installed, `DIFFERENT` if any member's path holds
149
- a custom hook (the bundle then refuses to install or remove anything to preserve the
150
- custom hook), otherwise `NOT_INSTALLED`. When `PYGITWEB_AUTH` is enabled, `add` and `remove`
151
- require a valid access token (`Authorization: Bearer …` from `POST /token`, or the cookie from `POST /login`); `check` is always allowed.
21
+ # Pygitweb
22
+
23
+ Gitweb reimplementation using **Python**, **FastAPI**, and **Pygit2**, ported from `git/gitweb/gitweb.perl`.
24
+
25
+ ## Config
26
+
27
+ Settings load from `~/.pygitweb/settings.json` (or `PYGITWEB_SETTINGS_CONFIG`), `PYGITWEB_*`
28
+ environment variables, and optionally a `.env` file in the working directory via
29
+ `pydantic-settings`. See `src/pygitweb/config.py` and `settings.schema.json` for the full schema. Common ones:
30
+
31
+ - `PYGITWEB_PROJECTROOT` — absolute path to directory containing git repositories (default: `$HOME`)
32
+ - `PYGITWEB_PROJECTS_LIST` — directory to scan, or path to a project-list file (default: `PROJECTROOT`)
33
+ - `PYGITWEB_EXPORT_OK` — filename that must exist to allow export (e.g. `git-daemon-export-ok`); empty = no check
34
+ - `PYGITWEB_SITE_NAME` — site name in titles (default: `PyGitWeb`)
35
+ - `PYGITWEB_GIT` — path to the git executable (default: `git`)
36
+ - `PYGITWEB_AUTH` — `0` / `false` / `off` disables auth; `1` / `true` / `on` enables it. If **unset or empty**, auth defaults to **on**.
37
+ - `PYGITWEB_AUTH_CONFIG` — path to the auth JSON file (default: `~/.pygitweb/auth.json`). Generated to a reasonable default if not present.
38
+ - `PYGITWEB_SETTINGS_CONFIG` — path to the settings JSON file (default: `~/.pygitweb/settings.json`). Created from the environment on first run if missing.
39
+ - `PYGITWEB_ENABLED_PLUGINS` — installed plugins to load. The settings page can change this list and reload plugins immediately (`POST /settings/pygitweb/plugins`).
40
+ - `PYGITWEB_API_KEY_MAX_COUNT` — maximum Smart HTTP API keys each local user may hold (default: `2`).
41
+ - `PYGITWEB_API_KEY_EXPIRY_DAYS` — lifetime of a newly issued API key, in days. `0` means the key does not expire (the default).
42
+ - Browser login: `GET /login` (optional `?next=/path`), `POST /login` with form fields `username`, `password`, `next`; sets an HttpOnly cookie with an opaque in-process session id (also accepted by protected routes via `Authorization: Bearer`). Sessions are wiped when the process exits. `GET /logout?next=/` revokes the session and clears the cookie.
43
+ - Account and Smart HTTP keys (auth required): `GET /user` is the account page. `POST /user/keys` with JSON `{"id": "...", "readonly": false}` issues a key and returns the plaintext secret once; only its scrypt hash is stored. `readonly: true` allows fetch but not push. `DELETE /user/keys?id=<id>` revokes one key. Clone and push attempts are appended to `~/.pygitweb/smart_http.log`.
44
+
45
+ ## Routes
46
+
47
+ Load the `/docs` page for a detailed view of routes (below the readme).
48
+
49
+ **No-project routes**
50
+
51
+ - `GET /`: project list
52
+ - `GET /index`: plain text project index (path, owner)
53
+ - `GET /opml`: OPML feed list
54
+ - `GET /project/{name}`: Project dispatch (See actions table)
55
+
56
+ **Hook management routes**
57
+
58
+ - `GET /project/{name}/hooks`: JSON `{hooks: [...samples...], bundles: [...]}` with current status (`installed`, `not_installed`, `different`) for every pygittools sample and bundle
59
+ - `POST /project/{name}/hook?name=<sample-or-bundle>&op=<add|remove|check>`: install, remove, or check one sample or bundle. `name` may be a sample filename (e.g. `post-receive.notify`) or a bundle name (e.g. `update`, which expands to `post-commit.notify` + `post-receive.notify`). `add`/`remove` refuse to clobber a custom hook with different content (returns `409`)
60
+
61
+ **Actions**
62
+
63
+ | Action | Query parameters | URL | Description |
64
+ |--------|------------------|-----|-------------|
65
+ | summary | *(default)* or `a` | `GET /project/{project}` | Project summary (description, owner, HEAD, tree link). |
66
+ | tree | `h`, `f` | `GET /project/{project}?a=tree&h=...&f=...` | Directory listing (tree). |
67
+ | blob | `h`, `f` | `GET /project/{project}?a=blob&h=...&f=...` | File view (HTML). |
68
+ | blob_plain | `h`, `f` | `GET /project/{project}?a=blob_plain&h=...&f=...` | Raw file download. |
69
+ | log | `h`, `updates`, `pf` | `GET /project/{project}?a=log&h=...` | Commit log. Supports long-poll subscribe. |
70
+ | shortlog | `h`, `updates`, `pf` | `GET /project/{project}?a=shortlog&h=...` | Shortlog. Supports long-poll subscribe. |
71
+ | history | `h`, `f`, `updates`, `pf` | `GET /project/{project}?a=history&h=...&f=...` | History of a file or path. Supports long-poll subscribe. |
72
+ | heads | `updates`, `pf` | `GET /project/{project}?a=heads` | List branch heads. Supports long-poll subscribe. |
73
+ | tags | `updates`, `pf` | `GET /project/{project}?a=tags` | List all tags. Supports long-poll subscribe. |
74
+ | tag | `h` | `GET /project/{project}?a=tag&h=...` | Single tag view (tag ref or hash). |
75
+ | commit | `h` | `GET /project/{project}?a=commit&h=...` | Commit information. |
76
+ | commitdiff | `h` | `GET /project/{project}?a=commitdiff&h=...` | Commit diff (unified diff rendered with [diff2html](https://github.com/rtfpessoa/diff2html)). |
77
+ | patch | `h` | `GET /project/{project}?a=patch&h=...` | Single-commit patch (plain text). |
78
+ | patches | `h`, `hb` | `GET /project/{project}?a=patches&h=...&hb=...` | Multi-commit patches for range `hb..h` (plain text). |
79
+ | blobdiff | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobdiff&h=...&hb=...&f=...&fp=...` | Blob diff (two versions of a file) rendered with diff2html. |
80
+ | blobpatch | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobpatch&h=...&hb=...&f=...&fp=...` | Blob diff as plain unified diff. |
81
+ | remotes | — | `GET /project/{project}?a=remotes` | List repo remotes. |
82
+ | object | `h` | `GET /project/{project}?a=object&h=...` | Show object by type (commit, tree, tag, or blob). |
83
+ | blame_raw | `h`, `f` | `GET /project/{project}?a=blame_raw&h=...&f=...` | File blame as JSON: array of `{commit_id, commit_msg, commit_author, time, line_range}`. Contiguous lines from the same commit are merged. |
84
+ | blame | `h`, `f` | `GET /project/{project}?a=blame&h=...&f=...` | File blame HTML view (syntax-highlighted source, line numbers, commit links per line range; hover shows author and date). |
85
+ | blame_incremental | — | | TODO |
86
+ | blame_data | — | | TODO |
87
+ | rss | — | | TODO |
88
+ | atom | — | | TODO |
89
+ | search | `patterns`, `paths`, `globs`, `heading`, `sort`, `max_count`, `multiline` | `GET /project/{project}?a=search&patterns=...` | Ripgrep search (via `python-ripgrep`); returns JSON. `paths` are relative to the project tree and cannot escape it. |
90
+ | search (page) | — | `GET /project/{project}/search` | Per-project search UI page. |
91
+ | search_help | — | | TODO |
92
+
93
+ **Blog, boards, and tasks**
94
+
95
+ - `GET /project/{project}/blog/`: markdown blog page when `articles/manifest.json` exists at `HEAD`. Otherwise the summary link stays disabled.
96
+ - `GET /project/{project}/blog/raw/{path}`: raw blob from `HEAD` for the blog viewer (markdown, manifest, and assets). Paths that escape the tree return `404`.
97
+ - `POST /tasks/move?project=<name>&board=<source>&task=<ref>&target=<board>`: move a task onto another board, such as a sprint board. Column headers on the board page show a running points total. `points` on create and update accepts `0`, `1`, `2`, `3`, `5`, `8`, `13`, or `21`; any other value is stored as unestimated.
98
+ - `POST /tasks/archive?project=<name>&board=<source>&task=<ref>`: move a task to the archive board.
99
+ - `POST /tasks/delete?project=<name>&board=<source>&task=<ref>`: delete a task.
100
+
101
+ ## Query parameter short names (CGI mapping)
102
+
103
+ - `p` → project
104
+ - `a` → action
105
+ - `f` → file_name
106
+ - `fp` → file_parent
107
+ - `h` → hash
108
+ - `hp` → hash_parent
109
+ - `hb` → hash_base
110
+ - `hpb` → hash_parent_base
111
+ - `pg` → page
112
+ - `o` → order
113
+ - `s` → searchtext
114
+ - `st` → searchtype
115
+ - `sf` → snapshot_format
116
+ - `opt` → extra_options
117
+ - `sr` → search_use_regexp
118
+ - `by_tag` → ctag
119
+ - `ds` → diff_style
120
+ - `pf` → project_filter
121
+ - `updates` → long-poll subscription flag (`true` parks the request up to 30s; returns `200 OK` with an empty body on timeout/shutdown, or the action data when the queue is notified)
122
+
123
+ ## Live updates (long polling)
124
+
125
+ Supported actions (`history`, `log`, `shortlog`, `heads`, `tags`) accept `updates=true` to
126
+ subscribe to the project's change queue. The request is held for up to 30 seconds:
127
+
128
+ - A `POST /_internal/notify?project=<name>` (typically from a server-side git hook) wakes
129
+ matching subscribers, who then receive the freshly-rendered action response.
130
+ - If no notification arrives in 30 seconds (or the server is shutting down), the response is `200 OK` with an empty body.
131
+ - Combine with `pf=<prefix>` to subscribe to every project under a path prefix instead of
132
+ just the URL project (the action is still rendered for the URL project).
133
+
134
+ The notify endpoint is intended for loopback use by `pygittools` post-receive hooks (see
135
+ `pygittools/hook_samples/post-receive.notify`). The server enforces loopback-only access and
136
+ rejects unknown projects; production deployments should still restrict it at the reverse proxy.
137
+
138
+ ## Hook management
139
+
140
+ The project summary page exposes a **Hooks** row that lists installed hooks and lets you
141
+ install or remove pygittools samples, including the `update` bundle: `post-receive.notify`
142
+ (feeds the change queue when refs are pushed) and `post-commit.notify` (feeds the change
143
+ queue when a working clone of this repo records a local commit). Either is sufficient to
144
+ wake long-poll subscribers; installing both covers server-side and client-side commit paths.
145
+
146
+ The same operations are available programmatically via
147
+ `POST /project/{name}/hook?name=<sample-or-bundle>&op=<...>`. Bundle status is
148
+ `INSTALLED` only when every member is installed, `DIFFERENT` if any member's path holds
149
+ a custom hook (the bundle then refuses to install or remove anything to preserve the
150
+ custom hook), otherwise `NOT_INSTALLED`. When `PYGITWEB_AUTH` is enabled, `add` and `remove`
151
+ require a valid access token (`Authorization: Bearer …` from `POST /token`, or the cookie from `POST /login`); `check` is always allowed.
@@ -1,131 +1,131 @@
1
- # Pygitweb
2
-
3
- Gitweb reimplementation using **Python**, **FastAPI**, and **Pygit2**, ported from `git/gitweb/gitweb.perl`.
4
-
5
- ## Config
6
-
7
- Settings load from `~/.pygitweb/settings.json` (or `PYGITWEB_SETTINGS_CONFIG`), `PYGITWEB_*`
8
- environment variables, and optionally a `.env` file in the working directory via
9
- `pydantic-settings`. See `src/pygitweb/config.py` and `settings.schema.json` for the full schema. Common ones:
10
-
11
- - `PYGITWEB_PROJECTROOT` — absolute path to directory containing git repositories (default: `$HOME`)
12
- - `PYGITWEB_PROJECTS_LIST` — directory to scan, or path to a project-list file (default: `PROJECTROOT`)
13
- - `PYGITWEB_EXPORT_OK` — filename that must exist to allow export (e.g. `git-daemon-export-ok`); empty = no check
14
- - `PYGITWEB_SITE_NAME` — site name in titles (default: `PyGitWeb`)
15
- - `PYGITWEB_GIT` — path to the git executable (default: `git`)
16
- - `PYGITWEB_AUTH` — `0` / `false` / `off` disables auth; `1` / `true` / `on` enables it. If **unset or empty**, auth defaults to **on**.
17
- - `PYGITWEB_AUTH_CONFIG` — path to the auth JSON file (default: `~/.pygitweb/auth.json`). Generated to a reasonable default if not present.
18
- - `PYGITWEB_SETTINGS_CONFIG` — path to the settings JSON file (default: `~/.pygitweb/settings.json`). Created from the environment on first run if missing.
19
- - `PYGITWEB_ENABLED_PLUGINS` — installed plugins to load. The settings page can change this list and reload plugins immediately (`POST /settings/pygitweb/plugins`).
20
- - `PYGITWEB_API_KEY_MAX_COUNT` — maximum Smart HTTP API keys each local user may hold (default: `2`).
21
- - `PYGITWEB_API_KEY_EXPIRY_DAYS` — lifetime of a newly issued API key, in days. `0` means the key does not expire (the default).
22
- - Browser login: `GET /login` (optional `?next=/path`), `POST /login` with form fields `username`, `password`, `next`; sets an HttpOnly cookie with an opaque in-process session id (also accepted by protected routes via `Authorization: Bearer`). Sessions are wiped when the process exits. `GET /logout?next=/` revokes the session and clears the cookie.
23
- - Account and Smart HTTP keys (auth required): `GET /user` is the account page. `POST /user/keys` with JSON `{"id": "...", "readonly": false}` issues a key and returns the plaintext secret once; only its scrypt hash is stored. `readonly: true` allows fetch but not push. `DELETE /user/keys?id=<id>` revokes one key. Clone and push attempts are appended to `~/.pygitweb/smart_http.log`.
24
-
25
- ## Routes
26
-
27
- Load the `/docs` page for a detailed view of routes (below the readme).
28
-
29
- **No-project routes**
30
-
31
- - `GET /`: project list
32
- - `GET /index`: plain text project index (path, owner)
33
- - `GET /opml`: OPML feed list
34
- - `GET /project/{name}`: Project dispatch (See actions table)
35
-
36
- **Hook management routes**
37
-
38
- - `GET /project/{name}/hooks`: JSON `{hooks: [...samples...], bundles: [...]}` with current status (`installed`, `not_installed`, `different`) for every pygittools sample and bundle
39
- - `POST /project/{name}/hook?name=<sample-or-bundle>&op=<add|remove|check>`: install, remove, or check one sample or bundle. `name` may be a sample filename (e.g. `post-receive.notify`) or a bundle name (e.g. `update`, which expands to `post-commit.notify` + `post-receive.notify`). `add`/`remove` refuse to clobber a custom hook with different content (returns `409`)
40
-
41
- **Actions**
42
-
43
- | Action | Query parameters | URL | Description |
44
- |--------|------------------|-----|-------------|
45
- | summary | *(default)* or `a` | `GET /project/{project}` | Project summary (description, owner, HEAD, tree link). |
46
- | tree | `h`, `f` | `GET /project/{project}?a=tree&h=...&f=...` | Directory listing (tree). |
47
- | blob | `h`, `f` | `GET /project/{project}?a=blob&h=...&f=...` | File view (HTML). |
48
- | blob_plain | `h`, `f` | `GET /project/{project}?a=blob_plain&h=...&f=...` | Raw file download. |
49
- | log | `h`, `updates`, `pf` | `GET /project/{project}?a=log&h=...` | Commit log. Supports long-poll subscribe. |
50
- | shortlog | `h`, `updates`, `pf` | `GET /project/{project}?a=shortlog&h=...` | Shortlog. Supports long-poll subscribe. |
51
- | history | `h`, `f`, `updates`, `pf` | `GET /project/{project}?a=history&h=...&f=...` | History of a file or path. Supports long-poll subscribe. |
52
- | heads | `updates`, `pf` | `GET /project/{project}?a=heads` | List branch heads. Supports long-poll subscribe. |
53
- | tags | `updates`, `pf` | `GET /project/{project}?a=tags` | List all tags. Supports long-poll subscribe. |
54
- | tag | `h` | `GET /project/{project}?a=tag&h=...` | Single tag view (tag ref or hash). |
55
- | commit | `h` | `GET /project/{project}?a=commit&h=...` | Commit information. |
56
- | commitdiff | `h` | `GET /project/{project}?a=commitdiff&h=...` | Commit diff (unified diff rendered with [diff2html](https://github.com/rtfpessoa/diff2html)). |
57
- | patch | `h` | `GET /project/{project}?a=patch&h=...` | Single-commit patch (plain text). |
58
- | patches | `h`, `hb` | `GET /project/{project}?a=patches&h=...&hb=...` | Multi-commit patches for range `hb..h` (plain text). |
59
- | blobdiff | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobdiff&h=...&hb=...&f=...&fp=...` | Blob diff (two versions of a file) rendered with diff2html. |
60
- | blobpatch | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobpatch&h=...&hb=...&f=...&fp=...` | Blob diff as plain unified diff. |
61
- | remotes | — | `GET /project/{project}?a=remotes` | List repo remotes. |
62
- | object | `h` | `GET /project/{project}?a=object&h=...` | Show object by type (commit, tree, tag, or blob). |
63
- | blame_raw | `h`, `f` | `GET /project/{project}?a=blame_raw&h=...&f=...` | File blame as JSON: array of `{commit_id, commit_msg, commit_author, time, line_range}`. Contiguous lines from the same commit are merged. |
64
- | blame | `h`, `f` | `GET /project/{project}?a=blame&h=...&f=...` | File blame HTML view (syntax-highlighted source, line numbers, commit links per line range; hover shows author and date). |
65
- | blame_incremental | — | | TODO |
66
- | blame_data | — | | TODO |
67
- | rss | — | | TODO |
68
- | atom | — | | TODO |
69
- | search | `patterns`, `paths`, `globs`, `heading`, `sort`, `max_count`, `multiline` | `GET /project/{project}?a=search&patterns=...` | Ripgrep search (via `python-ripgrep`); returns JSON. `paths` are relative to the project tree and cannot escape it. |
70
- | search (page) | — | `GET /project/{project}/search` | Per-project search UI page. |
71
- | search_help | — | | TODO |
72
-
73
- **Blog, boards, and tasks**
74
-
75
- - `GET /project/{project}/blog/`: markdown blog page when `articles/manifest.json` exists at `HEAD`. Otherwise the summary link stays disabled.
76
- - `GET /project/{project}/blog/raw/{path}`: raw blob from `HEAD` for the blog viewer (markdown, manifest, and assets). Paths that escape the tree return `404`.
77
- - `POST /tasks/move?project=<name>&board=<source>&task=<ref>&target=<board>`: move a task onto another board, such as a sprint board. Column headers on the board page show a running points total. `points` on create and update accepts `0`, `1`, `2`, `3`, `5`, `8`, `13`, or `21`; any other value is stored as unestimated.
78
- - `POST /tasks/archive?project=<name>&board=<source>&task=<ref>`: move a task to the archive board.
79
- - `POST /tasks/delete?project=<name>&board=<source>&task=<ref>`: delete a task.
80
-
81
- ## Query parameter short names (CGI mapping)
82
-
83
- - `p` → project
84
- - `a` → action
85
- - `f` → file_name
86
- - `fp` → file_parent
87
- - `h` → hash
88
- - `hp` → hash_parent
89
- - `hb` → hash_base
90
- - `hpb` → hash_parent_base
91
- - `pg` → page
92
- - `o` → order
93
- - `s` → searchtext
94
- - `st` → searchtype
95
- - `sf` → snapshot_format
96
- - `opt` → extra_options
97
- - `sr` → search_use_regexp
98
- - `by_tag` → ctag
99
- - `ds` → diff_style
100
- - `pf` → project_filter
101
- - `updates` → long-poll subscription flag (`true` parks the request up to 30s; returns `200 OK` with an empty body on timeout/shutdown, or the action data when the queue is notified)
102
-
103
- ## Live updates (long polling)
104
-
105
- Supported actions (`history`, `log`, `shortlog`, `heads`, `tags`) accept `updates=true` to
106
- subscribe to the project's change queue. The request is held for up to 30 seconds:
107
-
108
- - A `POST /_internal/notify?project=<name>` (typically from a server-side git hook) wakes
109
- matching subscribers, who then receive the freshly-rendered action response.
110
- - If no notification arrives in 30 seconds (or the server is shutting down), the response is `200 OK` with an empty body.
111
- - Combine with `pf=<prefix>` to subscribe to every project under a path prefix instead of
112
- just the URL project (the action is still rendered for the URL project).
113
-
114
- The notify endpoint is intended for loopback use by `pygittools` post-receive hooks (see
115
- `pygittools/hook_samples/post-receive.notify`). The server enforces loopback-only access and
116
- rejects unknown projects; production deployments should still restrict it at the reverse proxy.
117
-
118
- ## Hook management
119
-
120
- The project summary page exposes a **Hooks** row that lists installed hooks and lets you
121
- install or remove pygittools samples, including the `update` bundle: `post-receive.notify`
122
- (feeds the change queue when refs are pushed) and `post-commit.notify` (feeds the change
123
- queue when a working clone of this repo records a local commit). Either is sufficient to
124
- wake long-poll subscribers; installing both covers server-side and client-side commit paths.
125
-
126
- The same operations are available programmatically via
127
- `POST /project/{name}/hook?name=<sample-or-bundle>&op=<...>`. Bundle status is
128
- `INSTALLED` only when every member is installed, `DIFFERENT` if any member's path holds
129
- a custom hook (the bundle then refuses to install or remove anything to preserve the
130
- custom hook), otherwise `NOT_INSTALLED`. When `PYGITWEB_AUTH` is enabled, `add` and `remove`
131
- require a valid access token (`Authorization: Bearer …` from `POST /token`, or the cookie from `POST /login`); `check` is always allowed.
1
+ # Pygitweb
2
+
3
+ Gitweb reimplementation using **Python**, **FastAPI**, and **Pygit2**, ported from `git/gitweb/gitweb.perl`.
4
+
5
+ ## Config
6
+
7
+ Settings load from `~/.pygitweb/settings.json` (or `PYGITWEB_SETTINGS_CONFIG`), `PYGITWEB_*`
8
+ environment variables, and optionally a `.env` file in the working directory via
9
+ `pydantic-settings`. See `src/pygitweb/config.py` and `settings.schema.json` for the full schema. Common ones:
10
+
11
+ - `PYGITWEB_PROJECTROOT` — absolute path to directory containing git repositories (default: `$HOME`)
12
+ - `PYGITWEB_PROJECTS_LIST` — directory to scan, or path to a project-list file (default: `PROJECTROOT`)
13
+ - `PYGITWEB_EXPORT_OK` — filename that must exist to allow export (e.g. `git-daemon-export-ok`); empty = no check
14
+ - `PYGITWEB_SITE_NAME` — site name in titles (default: `PyGitWeb`)
15
+ - `PYGITWEB_GIT` — path to the git executable (default: `git`)
16
+ - `PYGITWEB_AUTH` — `0` / `false` / `off` disables auth; `1` / `true` / `on` enables it. If **unset or empty**, auth defaults to **on**.
17
+ - `PYGITWEB_AUTH_CONFIG` — path to the auth JSON file (default: `~/.pygitweb/auth.json`). Generated to a reasonable default if not present.
18
+ - `PYGITWEB_SETTINGS_CONFIG` — path to the settings JSON file (default: `~/.pygitweb/settings.json`). Created from the environment on first run if missing.
19
+ - `PYGITWEB_ENABLED_PLUGINS` — installed plugins to load. The settings page can change this list and reload plugins immediately (`POST /settings/pygitweb/plugins`).
20
+ - `PYGITWEB_API_KEY_MAX_COUNT` — maximum Smart HTTP API keys each local user may hold (default: `2`).
21
+ - `PYGITWEB_API_KEY_EXPIRY_DAYS` — lifetime of a newly issued API key, in days. `0` means the key does not expire (the default).
22
+ - Browser login: `GET /login` (optional `?next=/path`), `POST /login` with form fields `username`, `password`, `next`; sets an HttpOnly cookie with an opaque in-process session id (also accepted by protected routes via `Authorization: Bearer`). Sessions are wiped when the process exits. `GET /logout?next=/` revokes the session and clears the cookie.
23
+ - Account and Smart HTTP keys (auth required): `GET /user` is the account page. `POST /user/keys` with JSON `{"id": "...", "readonly": false}` issues a key and returns the plaintext secret once; only its scrypt hash is stored. `readonly: true` allows fetch but not push. `DELETE /user/keys?id=<id>` revokes one key. Clone and push attempts are appended to `~/.pygitweb/smart_http.log`.
24
+
25
+ ## Routes
26
+
27
+ Load the `/docs` page for a detailed view of routes (below the readme).
28
+
29
+ **No-project routes**
30
+
31
+ - `GET /`: project list
32
+ - `GET /index`: plain text project index (path, owner)
33
+ - `GET /opml`: OPML feed list
34
+ - `GET /project/{name}`: Project dispatch (See actions table)
35
+
36
+ **Hook management routes**
37
+
38
+ - `GET /project/{name}/hooks`: JSON `{hooks: [...samples...], bundles: [...]}` with current status (`installed`, `not_installed`, `different`) for every pygittools sample and bundle
39
+ - `POST /project/{name}/hook?name=<sample-or-bundle>&op=<add|remove|check>`: install, remove, or check one sample or bundle. `name` may be a sample filename (e.g. `post-receive.notify`) or a bundle name (e.g. `update`, which expands to `post-commit.notify` + `post-receive.notify`). `add`/`remove` refuse to clobber a custom hook with different content (returns `409`)
40
+
41
+ **Actions**
42
+
43
+ | Action | Query parameters | URL | Description |
44
+ |--------|------------------|-----|-------------|
45
+ | summary | *(default)* or `a` | `GET /project/{project}` | Project summary (description, owner, HEAD, tree link). |
46
+ | tree | `h`, `f` | `GET /project/{project}?a=tree&h=...&f=...` | Directory listing (tree). |
47
+ | blob | `h`, `f` | `GET /project/{project}?a=blob&h=...&f=...` | File view (HTML). |
48
+ | blob_plain | `h`, `f` | `GET /project/{project}?a=blob_plain&h=...&f=...` | Raw file download. |
49
+ | log | `h`, `updates`, `pf` | `GET /project/{project}?a=log&h=...` | Commit log. Supports long-poll subscribe. |
50
+ | shortlog | `h`, `updates`, `pf` | `GET /project/{project}?a=shortlog&h=...` | Shortlog. Supports long-poll subscribe. |
51
+ | history | `h`, `f`, `updates`, `pf` | `GET /project/{project}?a=history&h=...&f=...` | History of a file or path. Supports long-poll subscribe. |
52
+ | heads | `updates`, `pf` | `GET /project/{project}?a=heads` | List branch heads. Supports long-poll subscribe. |
53
+ | tags | `updates`, `pf` | `GET /project/{project}?a=tags` | List all tags. Supports long-poll subscribe. |
54
+ | tag | `h` | `GET /project/{project}?a=tag&h=...` | Single tag view (tag ref or hash). |
55
+ | commit | `h` | `GET /project/{project}?a=commit&h=...` | Commit information. |
56
+ | commitdiff | `h` | `GET /project/{project}?a=commitdiff&h=...` | Commit diff (unified diff rendered with [diff2html](https://github.com/rtfpessoa/diff2html)). |
57
+ | patch | `h` | `GET /project/{project}?a=patch&h=...` | Single-commit patch (plain text). |
58
+ | patches | `h`, `hb` | `GET /project/{project}?a=patches&h=...&hb=...` | Multi-commit patches for range `hb..h` (plain text). |
59
+ | blobdiff | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobdiff&h=...&hb=...&f=...&fp=...` | Blob diff (two versions of a file) rendered with diff2html. |
60
+ | blobpatch | `h`, `hb`, `f`, `fp` | `GET /project/{project}?a=blobpatch&h=...&hb=...&f=...&fp=...` | Blob diff as plain unified diff. |
61
+ | remotes | — | `GET /project/{project}?a=remotes` | List repo remotes. |
62
+ | object | `h` | `GET /project/{project}?a=object&h=...` | Show object by type (commit, tree, tag, or blob). |
63
+ | blame_raw | `h`, `f` | `GET /project/{project}?a=blame_raw&h=...&f=...` | File blame as JSON: array of `{commit_id, commit_msg, commit_author, time, line_range}`. Contiguous lines from the same commit are merged. |
64
+ | blame | `h`, `f` | `GET /project/{project}?a=blame&h=...&f=...` | File blame HTML view (syntax-highlighted source, line numbers, commit links per line range; hover shows author and date). |
65
+ | blame_incremental | — | | TODO |
66
+ | blame_data | — | | TODO |
67
+ | rss | — | | TODO |
68
+ | atom | — | | TODO |
69
+ | search | `patterns`, `paths`, `globs`, `heading`, `sort`, `max_count`, `multiline` | `GET /project/{project}?a=search&patterns=...` | Ripgrep search (via `python-ripgrep`); returns JSON. `paths` are relative to the project tree and cannot escape it. |
70
+ | search (page) | — | `GET /project/{project}/search` | Per-project search UI page. |
71
+ | search_help | — | | TODO |
72
+
73
+ **Blog, boards, and tasks**
74
+
75
+ - `GET /project/{project}/blog/`: markdown blog page when `articles/manifest.json` exists at `HEAD`. Otherwise the summary link stays disabled.
76
+ - `GET /project/{project}/blog/raw/{path}`: raw blob from `HEAD` for the blog viewer (markdown, manifest, and assets). Paths that escape the tree return `404`.
77
+ - `POST /tasks/move?project=<name>&board=<source>&task=<ref>&target=<board>`: move a task onto another board, such as a sprint board. Column headers on the board page show a running points total. `points` on create and update accepts `0`, `1`, `2`, `3`, `5`, `8`, `13`, or `21`; any other value is stored as unestimated.
78
+ - `POST /tasks/archive?project=<name>&board=<source>&task=<ref>`: move a task to the archive board.
79
+ - `POST /tasks/delete?project=<name>&board=<source>&task=<ref>`: delete a task.
80
+
81
+ ## Query parameter short names (CGI mapping)
82
+
83
+ - `p` → project
84
+ - `a` → action
85
+ - `f` → file_name
86
+ - `fp` → file_parent
87
+ - `h` → hash
88
+ - `hp` → hash_parent
89
+ - `hb` → hash_base
90
+ - `hpb` → hash_parent_base
91
+ - `pg` → page
92
+ - `o` → order
93
+ - `s` → searchtext
94
+ - `st` → searchtype
95
+ - `sf` → snapshot_format
96
+ - `opt` → extra_options
97
+ - `sr` → search_use_regexp
98
+ - `by_tag` → ctag
99
+ - `ds` → diff_style
100
+ - `pf` → project_filter
101
+ - `updates` → long-poll subscription flag (`true` parks the request up to 30s; returns `200 OK` with an empty body on timeout/shutdown, or the action data when the queue is notified)
102
+
103
+ ## Live updates (long polling)
104
+
105
+ Supported actions (`history`, `log`, `shortlog`, `heads`, `tags`) accept `updates=true` to
106
+ subscribe to the project's change queue. The request is held for up to 30 seconds:
107
+
108
+ - A `POST /_internal/notify?project=<name>` (typically from a server-side git hook) wakes
109
+ matching subscribers, who then receive the freshly-rendered action response.
110
+ - If no notification arrives in 30 seconds (or the server is shutting down), the response is `200 OK` with an empty body.
111
+ - Combine with `pf=<prefix>` to subscribe to every project under a path prefix instead of
112
+ just the URL project (the action is still rendered for the URL project).
113
+
114
+ The notify endpoint is intended for loopback use by `pygittools` post-receive hooks (see
115
+ `pygittools/hook_samples/post-receive.notify`). The server enforces loopback-only access and
116
+ rejects unknown projects; production deployments should still restrict it at the reverse proxy.
117
+
118
+ ## Hook management
119
+
120
+ The project summary page exposes a **Hooks** row that lists installed hooks and lets you
121
+ install or remove pygittools samples, including the `update` bundle: `post-receive.notify`
122
+ (feeds the change queue when refs are pushed) and `post-commit.notify` (feeds the change
123
+ queue when a working clone of this repo records a local commit). Either is sufficient to
124
+ wake long-poll subscribers; installing both covers server-side and client-side commit paths.
125
+
126
+ The same operations are available programmatically via
127
+ `POST /project/{name}/hook?name=<sample-or-bundle>&op=<...>`. Bundle status is
128
+ `INSTALLED` only when every member is installed, `DIFFERENT` if any member's path holds
129
+ a custom hook (the bundle then refuses to install or remove anything to preserve the
130
+ custom hook), otherwise `NOT_INSTALLED`. When `PYGITWEB_AUTH` is enabled, `add` and `remove`
131
+ require a valid access token (`Authorization: Bearer …` from `POST /token`, or the cookie from `POST /login`); `check` is always allowed.
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "pygitweb"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "Gitweb reimplementation with FastAPI and Pygit2"
5
5
  readme = "README.md"
6
6
  license = "MIT"
7
7
  license-files = ["LICENSE"]
8
- requires-python = ">=3.11"
8
+ requires-python = ">=3.12"
9
9
  dependencies = [
10
- "pygittools>=0.2.0",
10
+ "pygittools>=0.3.1",
11
11
  "fastapi[standard-no-fastapi-cloud-cli]>=0.104.0",
12
12
  "uvicorn[standard]>=0.24.0",
13
13
  "python-multipart>=0.0.6",