dtxwiki 0.0.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 (428) hide show
  1. dtxwiki-0.0.1/DEPLOYMENT.md +261 -0
  2. dtxwiki-0.0.1/LICENSE +186 -0
  3. dtxwiki-0.0.1/MANIFEST.in +17 -0
  4. dtxwiki-0.0.1/NOTICE +4 -0
  5. dtxwiki-0.0.1/PKG-INFO +731 -0
  6. dtxwiki-0.0.1/README.md +688 -0
  7. dtxwiki-0.0.1/backend/__init__.py +1 -0
  8. dtxwiki-0.0.1/backend/alembic.ini +38 -0
  9. dtxwiki-0.0.1/backend/api/__init__.py +1 -0
  10. dtxwiki-0.0.1/backend/api/auth.py +466 -0
  11. dtxwiki-0.0.1/backend/api/deps.py +61 -0
  12. dtxwiki-0.0.1/backend/api/health.py +107 -0
  13. dtxwiki-0.0.1/backend/api/mcp_chats.py +243 -0
  14. dtxwiki-0.0.1/backend/api/mcp_http.py +1430 -0
  15. dtxwiki-0.0.1/backend/api/metrics.py +183 -0
  16. dtxwiki-0.0.1/backend/api/middleware/public_headers.py +53 -0
  17. dtxwiki-0.0.1/backend/api/middleware/request_log.py +115 -0
  18. dtxwiki-0.0.1/backend/api/middleware/security_headers.py +52 -0
  19. dtxwiki-0.0.1/backend/api/oauth.py +1082 -0
  20. dtxwiki-0.0.1/backend/api/pages.py +570 -0
  21. dtxwiki-0.0.1/backend/api/public.py +60 -0
  22. dtxwiki-0.0.1/backend/api/read.py +2223 -0
  23. dtxwiki-0.0.1/backend/api/uploads.py +217 -0
  24. dtxwiki-0.0.1/backend/api/users.py +61 -0
  25. dtxwiki-0.0.1/backend/app/__init__.py +1 -0
  26. dtxwiki-0.0.1/backend/app/bootstrap.py +148 -0
  27. dtxwiki-0.0.1/backend/app/data_dir.py +31 -0
  28. dtxwiki-0.0.1/backend/app/db.py +66 -0
  29. dtxwiki-0.0.1/backend/app/errors.py +59 -0
  30. dtxwiki-0.0.1/backend/app/main.py +241 -0
  31. dtxwiki-0.0.1/backend/app/settings.py +315 -0
  32. dtxwiki-0.0.1/backend/app/state.py +35 -0
  33. dtxwiki-0.0.1/backend/app/version.py +32 -0
  34. dtxwiki-0.0.1/backend/audit/__init__.py +1 -0
  35. dtxwiki-0.0.1/backend/audit/emitter.py +130 -0
  36. dtxwiki-0.0.1/backend/cli/__init__.py +1 -0
  37. dtxwiki-0.0.1/backend/cli/integrations/__init__.py +1 -0
  38. dtxwiki-0.0.1/backend/cli/integrations/_common.py +137 -0
  39. dtxwiki-0.0.1/backend/cli/integrations/claude.py +112 -0
  40. dtxwiki-0.0.1/backend/cli/integrations/codex.py +48 -0
  41. dtxwiki-0.0.1/backend/cli/integrations/cursor.py +16 -0
  42. dtxwiki-0.0.1/backend/cli/integrations/detect.py +99 -0
  43. dtxwiki-0.0.1/backend/cli/main.py +1164 -0
  44. dtxwiki-0.0.1/backend/cli/mcp_doctor.py +238 -0
  45. dtxwiki-0.0.1/backend/cli/mcp_http_register.py +305 -0
  46. dtxwiki-0.0.1/backend/cli/prod_setup.py +523 -0
  47. dtxwiki-0.0.1/backend/llm/__init__.py +39 -0
  48. dtxwiki-0.0.1/backend/llm/anthropic.py +122 -0
  49. dtxwiki-0.0.1/backend/llm/base.py +109 -0
  50. dtxwiki-0.0.1/backend/llm/openai.py +113 -0
  51. dtxwiki-0.0.1/backend/llm/registry.py +17 -0
  52. dtxwiki-0.0.1/backend/mcp/__init__.py +1 -0
  53. dtxwiki-0.0.1/backend/mcp/agent_tools.py +85 -0
  54. dtxwiki-0.0.1/backend/mcp/context_tools.py +162 -0
  55. dtxwiki-0.0.1/backend/mcp/conversation.py +106 -0
  56. dtxwiki-0.0.1/backend/mcp/entry.py +92 -0
  57. dtxwiki-0.0.1/backend/mcp/envelope.py +53 -0
  58. dtxwiki-0.0.1/backend/mcp/page_tools.py +150 -0
  59. dtxwiki-0.0.1/backend/mcp/protocol/__init__.py +1 -0
  60. dtxwiki-0.0.1/backend/mcp/protocol/prompts_resources.py +545 -0
  61. dtxwiki-0.0.1/backend/mcp/protocol/runner.py +212 -0
  62. dtxwiki-0.0.1/backend/mcp/protocol/server.py +87 -0
  63. dtxwiki-0.0.1/backend/mcp/protocol/session_pool.py +27 -0
  64. dtxwiki-0.0.1/backend/mcp/protocol/tool_descriptors.py +226 -0
  65. dtxwiki-0.0.1/backend/mcp/read_tools.py +226 -0
  66. dtxwiki-0.0.1/backend/mcp/review_tools.py +107 -0
  67. dtxwiki-0.0.1/backend/mcp/router.py +208 -0
  68. dtxwiki-0.0.1/backend/mcp/scopes.py +107 -0
  69. dtxwiki-0.0.1/backend/mcp/stdio_server.py +11 -0
  70. dtxwiki-0.0.1/backend/migrations/env.py +46 -0
  71. dtxwiki-0.0.1/backend/migrations/script.py.mako +24 -0
  72. dtxwiki-0.0.1/backend/migrations/versions/0001_p0_0_pages.py +118 -0
  73. dtxwiki-0.0.1/backend/migrations/versions/0002_sprint2_workspace_client.py +223 -0
  74. dtxwiki-0.0.1/backend/migrations/versions/0003_sprint2_job_discovery.py +178 -0
  75. dtxwiki-0.0.1/backend/migrations/versions/0004_sprint2_library_item.py +177 -0
  76. dtxwiki-0.0.1/backend/migrations/versions/0005_sprint2_agent_page.py +162 -0
  77. dtxwiki-0.0.1/backend/migrations/versions/0006_sprint2_agent_input_bundle.py +140 -0
  78. dtxwiki-0.0.1/backend/migrations/versions/0007_sprint2_context_claim_citation.py +202 -0
  79. dtxwiki-0.0.1/backend/migrations/versions/0008_sprint2_change_review_audit.py +391 -0
  80. dtxwiki-0.0.1/backend/migrations/versions/0009_sprint2_full_text_indexes.py +150 -0
  81. dtxwiki-0.0.1/backend/migrations/versions/0010_sprint2_pgvector_readiness.py +25 -0
  82. dtxwiki-0.0.1/backend/migrations/versions/0011_sprint2_workspace_tree.py +185 -0
  83. dtxwiki-0.0.1/backend/migrations/versions/0012_sprint2_chat_ingress.py +272 -0
  84. dtxwiki-0.0.1/backend/migrations/versions/0013_sprint4_identity.py +98 -0
  85. dtxwiki-0.0.1/backend/migrations/versions/0014_sprint4_workspace_memberships.py +106 -0
  86. dtxwiki-0.0.1/backend/migrations/versions/0015_sprint4_oauth.py +167 -0
  87. dtxwiki-0.0.1/backend/migrations/versions/0016_sprint4_refresh_token_argon2id.py +30 -0
  88. dtxwiki-0.0.1/backend/migrations/versions/0017_sprint4_oauth_consent_workspace.py +41 -0
  89. dtxwiki-0.0.1/backend/migrations/versions/0018_sprint4_fix3_oauth_workspace_bound_tokens.py +222 -0
  90. dtxwiki-0.0.1/backend/migrations/versions/0019_sprint5_audit_workspace_nullable.py +50 -0
  91. dtxwiki-0.0.1/backend/migrations/versions/0020_sprint5_oauth_access_token_jti.py +89 -0
  92. dtxwiki-0.0.1/backend/migrations/versions/0021_sprint5_app_metadata.py +31 -0
  93. dtxwiki-0.0.1/backend/migrations/versions/0022_sprint6_api_token_mcp_metadata.py +24 -0
  94. dtxwiki-0.0.1/backend/migrations/versions/0023_sprint6_page_links.py +250 -0
  95. dtxwiki-0.0.1/backend/migrations/versions/0024_sprint6_session_generation.py +30 -0
  96. dtxwiki-0.0.1/backend/migrations/versions/0025_sprint6_oauth_jti_refresh_restrict.py +61 -0
  97. dtxwiki-0.0.1/backend/migrations/versions/0026_sprint6_mcp_client_created_by_fk.py +74 -0
  98. dtxwiki-0.0.1/backend/migrations/versions/0027_sprint6_context_body_md_canonical.py +95 -0
  99. dtxwiki-0.0.1/backend/migrations/versions/0028_sprint6_context_check_constraints.py +108 -0
  100. dtxwiki-0.0.1/backend/migrations/versions/0029_sprint6_page_link_target_fk.py +61 -0
  101. dtxwiki-0.0.1/backend/migrations/versions/0030_sprint6_actor_names_aliases.py +121 -0
  102. dtxwiki-0.0.1/backend/migrations/versions/0031_sprint6_restore_draft_versions.py +50 -0
  103. dtxwiki-0.0.1/backend/migrations/versions/0032_sprint6_rename_chat_to_ask.py +310 -0
  104. dtxwiki-0.0.1/backend/migrations/versions/0033_sprint6_mcp_chats.py +190 -0
  105. dtxwiki-0.0.1/backend/migrations/versions/0034_sprint6_library_domain_rename.py +378 -0
  106. dtxwiki-0.0.1/backend/migrations/versions/0035_sprint6_api_token_preview.py +25 -0
  107. dtxwiki-0.0.1/backend/migrations/versions/0036_sprint6_user_default_workspace.py +41 -0
  108. dtxwiki-0.0.1/backend/migrations/versions/0037_sprint6_mcp_chat_owner_user.py +70 -0
  109. dtxwiki-0.0.1/backend/migrations/versions/0038_sprint6_drop_review_assignee.py +35 -0
  110. dtxwiki-0.0.1/backend/migrations/versions/0039_sprint6_changeset_origin_chat_session.py +68 -0
  111. dtxwiki-0.0.1/backend/migrations/versions/0040_sprint6_mcp_per_call_artifact.py +104 -0
  112. dtxwiki-0.0.1/backend/migrations/versions/0041_sprint6_review_audience_claim.py +58 -0
  113. dtxwiki-0.0.1/backend/migrations/versions/0042_sprint6_context_page_public.py +33 -0
  114. dtxwiki-0.0.1/backend/migrations/versions/0043_sprint6_ask_auto_title.py +43 -0
  115. dtxwiki-0.0.1/backend/migrations/versions/0044_sprint6_review_risk_policy.py +96 -0
  116. dtxwiki-0.0.1/backend/migrations/versions/0045_sprint6_auto_approve_by_risk.py +84 -0
  117. dtxwiki-0.0.1/backend/migrations/versions/0046_sprint6_auto_approve_rename_allowed.py +94 -0
  118. dtxwiki-0.0.1/backend/migrations/versions/0047_sprint6_library_item_tombstone.py +57 -0
  119. dtxwiki-0.0.1/backend/models/__init__.py +98 -0
  120. dtxwiki-0.0.1/backend/models/agent.py +128 -0
  121. dtxwiki-0.0.1/backend/models/api_token.py +37 -0
  122. dtxwiki-0.0.1/backend/models/app_metadata.py +10 -0
  123. dtxwiki-0.0.1/backend/models/ask.py +177 -0
  124. dtxwiki-0.0.1/backend/models/audit.py +51 -0
  125. dtxwiki-0.0.1/backend/models/base.py +29 -0
  126. dtxwiki-0.0.1/backend/models/bundle.py +102 -0
  127. dtxwiki-0.0.1/backend/models/change.py +66 -0
  128. dtxwiki-0.0.1/backend/models/context.py +293 -0
  129. dtxwiki-0.0.1/backend/models/feedback.py +28 -0
  130. dtxwiki-0.0.1/backend/models/job.py +58 -0
  131. dtxwiki-0.0.1/backend/models/library.py +176 -0
  132. dtxwiki-0.0.1/backend/models/library_discovery.py +152 -0
  133. dtxwiki-0.0.1/backend/models/lint.py +57 -0
  134. dtxwiki-0.0.1/backend/models/mcp_chat.py +186 -0
  135. dtxwiki-0.0.1/backend/models/mcp_trace.py +96 -0
  136. dtxwiki-0.0.1/backend/models/oauth.py +166 -0
  137. dtxwiki-0.0.1/backend/models/review.py +89 -0
  138. dtxwiki-0.0.1/backend/models/tree.py +147 -0
  139. dtxwiki-0.0.1/backend/models/user.py +50 -0
  140. dtxwiki-0.0.1/backend/models/workspace.py +207 -0
  141. dtxwiki-0.0.1/backend/policy/__init__.py +1 -0
  142. dtxwiki-0.0.1/backend/policy/auth.py +243 -0
  143. dtxwiki-0.0.1/backend/policy/rbac.py +221 -0
  144. dtxwiki-0.0.1/backend/policy/remote_ip.py +51 -0
  145. dtxwiki-0.0.1/backend/policy/rest_scopes.py +405 -0
  146. dtxwiki-0.0.1/backend/policy/trust_boundaries.py +196 -0
  147. dtxwiki-0.0.1/backend/policy/workspace_resolution.py +150 -0
  148. dtxwiki-0.0.1/backend/repositories/__init__.py +1 -0
  149. dtxwiki-0.0.1/backend/repositories/audit_repo.py +38 -0
  150. dtxwiki-0.0.1/backend/repositories/context_page_repo.py +216 -0
  151. dtxwiki-0.0.1/backend/repositories/workspace_repo.py +15 -0
  152. dtxwiki-0.0.1/backend/schemas/__init__.py +1 -0
  153. dtxwiki-0.0.1/backend/schemas/activity.py +55 -0
  154. dtxwiki-0.0.1/backend/schemas/agent.py +135 -0
  155. dtxwiki-0.0.1/backend/schemas/ask.py +94 -0
  156. dtxwiki-0.0.1/backend/schemas/auth.py +172 -0
  157. dtxwiki-0.0.1/backend/schemas/common.py +194 -0
  158. dtxwiki-0.0.1/backend/schemas/context_ingress.py +122 -0
  159. dtxwiki-0.0.1/backend/schemas/context_write.py +521 -0
  160. dtxwiki-0.0.1/backend/schemas/deployment.py +45 -0
  161. dtxwiki-0.0.1/backend/schemas/health.py +51 -0
  162. dtxwiki-0.0.1/backend/schemas/lint.py +78 -0
  163. dtxwiki-0.0.1/backend/schemas/mcp/__init__.py +1 -0
  164. dtxwiki-0.0.1/backend/schemas/mcp/agent_tools.py +49 -0
  165. dtxwiki-0.0.1/backend/schemas/mcp/context_tools.py +81 -0
  166. dtxwiki-0.0.1/backend/schemas/mcp/page_tools.py +103 -0
  167. dtxwiki-0.0.1/backend/schemas/mcp/read_tools.py +161 -0
  168. dtxwiki-0.0.1/backend/schemas/mcp/review_tools.py +137 -0
  169. dtxwiki-0.0.1/backend/schemas/mcp_chat.py +195 -0
  170. dtxwiki-0.0.1/backend/schemas/page.py +323 -0
  171. dtxwiki-0.0.1/backend/schemas/read.py +425 -0
  172. dtxwiki-0.0.1/backend/schemas/settings.py +52 -0
  173. dtxwiki-0.0.1/backend/schemas/tree.py +52 -0
  174. dtxwiki-0.0.1/backend/schemas/upload.py +16 -0
  175. dtxwiki-0.0.1/backend/schemas/user.py +21 -0
  176. dtxwiki-0.0.1/backend/scripts/__init__.py +1 -0
  177. dtxwiki-0.0.1/backend/scripts/export_mcp_schemas.py +127 -0
  178. dtxwiki-0.0.1/backend/scripts/export_openapi.py +17 -0
  179. dtxwiki-0.0.1/backend/scripts/migrate_data.py +374 -0
  180. dtxwiki-0.0.1/backend/scripts/seed_dev.py +378 -0
  181. dtxwiki-0.0.1/backend/scripts/seed_remote_mcp_smoke.py +336 -0
  182. dtxwiki-0.0.1/backend/services/__init__.py +1 -0
  183. dtxwiki-0.0.1/backend/services/activity_service.py +476 -0
  184. dtxwiki-0.0.1/backend/services/actor_identities.py +16 -0
  185. dtxwiki-0.0.1/backend/services/agent_page_service.py +532 -0
  186. dtxwiki-0.0.1/backend/services/anchor_resolver.py +248 -0
  187. dtxwiki-0.0.1/backend/services/api_token_service.py +296 -0
  188. dtxwiki-0.0.1/backend/services/ask_service.py +623 -0
  189. dtxwiki-0.0.1/backend/services/audit_service.py +37 -0
  190. dtxwiki-0.0.1/backend/services/bundle_expiration.py +103 -0
  191. dtxwiki-0.0.1/backend/services/bundle_service.py +475 -0
  192. dtxwiki-0.0.1/backend/services/change_review_audit.py +351 -0
  193. dtxwiki-0.0.1/backend/services/citation_service.py +236 -0
  194. dtxwiki-0.0.1/backend/services/context_ingress_service.py +694 -0
  195. dtxwiki-0.0.1/backend/services/context_write_service.py +784 -0
  196. dtxwiki-0.0.1/backend/services/credential_hashing.py +92 -0
  197. dtxwiki-0.0.1/backend/services/deployment.py +269 -0
  198. dtxwiki-0.0.1/backend/services/domain_read.py +875 -0
  199. dtxwiki-0.0.1/backend/services/extraction_service.py +238 -0
  200. dtxwiki-0.0.1/backend/services/feedback_errors.py +18 -0
  201. dtxwiki-0.0.1/backend/services/feedback_resolver_service.py +58 -0
  202. dtxwiki-0.0.1/backend/services/feedback_service.py +234 -0
  203. dtxwiki-0.0.1/backend/services/job_queue.py +119 -0
  204. dtxwiki-0.0.1/backend/services/library_service.py +747 -0
  205. dtxwiki-0.0.1/backend/services/library_storage.py +55 -0
  206. dtxwiki-0.0.1/backend/services/lint_service.py +147 -0
  207. dtxwiki-0.0.1/backend/services/mcp_chat_service.py +900 -0
  208. dtxwiki-0.0.1/backend/services/mcp_client_service.py +149 -0
  209. dtxwiki-0.0.1/backend/services/mcp_surface_service.py +260 -0
  210. dtxwiki-0.0.1/backend/services/mcp_trace_capture.py +381 -0
  211. dtxwiki-0.0.1/backend/services/oauth_service.py +1800 -0
  212. dtxwiki-0.0.1/backend/services/page_service.py +1879 -0
  213. dtxwiki-0.0.1/backend/services/read_errors.py +68 -0
  214. dtxwiki-0.0.1/backend/services/restricted_library_policy.py +32 -0
  215. dtxwiki-0.0.1/backend/services/review_risk_policy.py +483 -0
  216. dtxwiki-0.0.1/backend/services/review_service.py +1640 -0
  217. dtxwiki-0.0.1/backend/services/search_service.py +442 -0
  218. dtxwiki-0.0.1/backend/services/session_service.py +367 -0
  219. dtxwiki-0.0.1/backend/services/settings_service.py +654 -0
  220. dtxwiki-0.0.1/backend/services/tree_read.py +264 -0
  221. dtxwiki-0.0.1/backend/services/tree_service.py +644 -0
  222. dtxwiki-0.0.1/backend/services/user_admin_service.py +66 -0
  223. dtxwiki-0.0.1/backend/services/workspace_membership_service.py +97 -0
  224. dtxwiki-0.0.1/backend/services/workspace_read.py +329 -0
  225. dtxwiki-0.0.1/backend/services/workspace_write.py +292 -0
  226. dtxwiki-0.0.1/backend/static/assets/AccountSecurityScreen-DiqtgYNv.js +1 -0
  227. dtxwiki-0.0.1/backend/static/assets/ActivityScreen-Bo-O3wrB.js +1 -0
  228. dtxwiki-0.0.1/backend/static/assets/AdvancedSection-CTCsjBty.js +1 -0
  229. dtxwiki-0.0.1/backend/static/assets/AgentScreen-FQXe7sbN.js +3 -0
  230. dtxwiki-0.0.1/backend/static/assets/ArtifactChatsSection-BubCHY0m.js +1 -0
  231. dtxwiki-0.0.1/backend/static/assets/AskScreen-Dqc4wuxZ.js +1 -0
  232. dtxwiki-0.0.1/backend/static/assets/AuthScreen-vpDdVOyl.js +1 -0
  233. dtxwiki-0.0.1/backend/static/assets/Breadcrumbs-DP6tKrMn.js +1 -0
  234. dtxwiki-0.0.1/backend/static/assets/ChatsDetailScreen-DA4L4hTh.js +1 -0
  235. dtxwiki-0.0.1/backend/static/assets/ChatsListScreen-Bn1PA3RK.js +1 -0
  236. dtxwiki-0.0.1/backend/static/assets/ClientChip-DjqI-fCu.js +1 -0
  237. dtxwiki-0.0.1/backend/static/assets/ContextScreen-DIHjETDO.js +1 -0
  238. dtxwiki-0.0.1/backend/static/assets/DashboardScreen-S-7Ix7tx.js +1 -0
  239. dtxwiki-0.0.1/backend/static/assets/Dialog-Vb4frv23.js +1 -0
  240. dtxwiki-0.0.1/backend/static/assets/DiffViewer-B-Tm0Rlp.js +1 -0
  241. dtxwiki-0.0.1/backend/static/assets/DiffViewerDialog-BeYlLkBC.js +1 -0
  242. dtxwiki-0.0.1/backend/static/assets/FirstUseChecklist-C8AKYWCQ.js +1 -0
  243. dtxwiki-0.0.1/backend/static/assets/FormField-BNzNKUos.js +1 -0
  244. dtxwiki-0.0.1/backend/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  245. dtxwiki-0.0.1/backend/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  246. dtxwiki-0.0.1/backend/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  247. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  248. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  249. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  250. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  251. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  252. dtxwiki-0.0.1/backend/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  253. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  254. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  255. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  256. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  257. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  258. dtxwiki-0.0.1/backend/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  259. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  260. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  261. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  262. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  263. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  264. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  265. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  266. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  267. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  268. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  269. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  270. dtxwiki-0.0.1/backend/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  271. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  272. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  273. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  274. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  275. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  276. dtxwiki-0.0.1/backend/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  277. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  278. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  279. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  280. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  281. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  282. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  283. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  284. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  285. dtxwiki-0.0.1/backend/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  286. dtxwiki-0.0.1/backend/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  287. dtxwiki-0.0.1/backend/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  288. dtxwiki-0.0.1/backend/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  289. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  290. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  291. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  292. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  293. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  294. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  295. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  296. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  297. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  298. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  299. dtxwiki-0.0.1/backend/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  300. dtxwiki-0.0.1/backend/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  301. dtxwiki-0.0.1/backend/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  302. dtxwiki-0.0.1/backend/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  303. dtxwiki-0.0.1/backend/static/assets/LibraryScreen-DU8DIEN1.js +2 -0
  304. dtxwiki-0.0.1/backend/static/assets/LintScreen-Ck8G5qFr.js +1 -0
  305. dtxwiki-0.0.1/backend/static/assets/MarkdownView-BpTgdD6k.css +1 -0
  306. dtxwiki-0.0.1/backend/static/assets/MarkdownView-CGRbHpcO.js +9 -0
  307. dtxwiki-0.0.1/backend/static/assets/PageEditor-DBY5SoQN.js +64 -0
  308. dtxwiki-0.0.1/backend/static/assets/PageList-yeqekuM2.js +1 -0
  309. dtxwiki-0.0.1/backend/static/assets/PageReader-CbFNMzqu.js +1 -0
  310. dtxwiki-0.0.1/backend/static/assets/PagesLanding-BuRXy1Mw.js +1 -0
  311. dtxwiki-0.0.1/backend/static/assets/PdfLibraryPreview-DeOASwDs.js +1 -0
  312. dtxwiki-0.0.1/backend/static/assets/PublishedPageReader-DgNxuHVX.js +1 -0
  313. dtxwiki-0.0.1/backend/static/assets/ReaderTabs-CW9i9iAQ.js +1 -0
  314. dtxwiki-0.0.1/backend/static/assets/ReviewScreen-CVJ-8CZV.js +1 -0
  315. dtxwiki-0.0.1/backend/static/assets/SearchField-BapgB6om.js +1 -0
  316. dtxwiki-0.0.1/backend/static/assets/SearchScreen-BzzrKHsg.js +1 -0
  317. dtxwiki-0.0.1/backend/static/assets/SegmentedControl-DmN2cD1q.js +1 -0
  318. dtxwiki-0.0.1/backend/static/assets/SettingsScreen-CGBXnRha.js +5 -0
  319. dtxwiki-0.0.1/backend/static/assets/SetupScreen-DleZsBoV.js +1 -0
  320. dtxwiki-0.0.1/backend/static/assets/StatusPill-DKi2M2_W.js +1 -0
  321. dtxwiki-0.0.1/backend/static/assets/TabbedInspector-CGd3S1nF.js +1 -0
  322. dtxwiki-0.0.1/backend/static/assets/TreeNodeActionDialogs-ByCKoAKa.js +1 -0
  323. dtxwiki-0.0.1/backend/static/assets/WorkspaceLayout-DAuixhhE.js +1 -0
  324. dtxwiki-0.0.1/backend/static/assets/WorkspacePanelChrome-CazCCL7R.js +1 -0
  325. dtxwiki-0.0.1/backend/static/assets/agent-DSSb30Yg.js +1 -0
  326. dtxwiki-0.0.1/backend/static/assets/arc-DOA1mDnW.js +1 -0
  327. dtxwiki-0.0.1/backend/static/assets/architectureDiagram-3BPJPVTR-BlLZuU3B.js +36 -0
  328. dtxwiki-0.0.1/backend/static/assets/blockDiagram-GPEHLZMM-TsVMwqa7.js +132 -0
  329. dtxwiki-0.0.1/backend/static/assets/c4Diagram-AAUBKEIU-D1Jir-z6.js +10 -0
  330. dtxwiki-0.0.1/backend/static/assets/channel-BPrSEbJD.js +1 -0
  331. dtxwiki-0.0.1/backend/static/assets/chunk-2J33WTMH-DNdwDO-t.js +1 -0
  332. dtxwiki-0.0.1/backend/static/assets/chunk-4BX2VUAB-C6UYYSFQ.js +1 -0
  333. dtxwiki-0.0.1/backend/static/assets/chunk-55IACEB6-DYF1SBFk.js +1 -0
  334. dtxwiki-0.0.1/backend/static/assets/chunk-727SXJPM-TKztczVt.js +206 -0
  335. dtxwiki-0.0.1/backend/static/assets/chunk-AQP2D5EJ-BQ35mjEn.js +231 -0
  336. dtxwiki-0.0.1/backend/static/assets/chunk-FMBD7UC4-B8CjS_KZ.js +15 -0
  337. dtxwiki-0.0.1/backend/static/assets/chunk-ND2GUHAM-CKPlR7DV.js +1 -0
  338. dtxwiki-0.0.1/backend/static/assets/chunk-QZHKN3VN-DgBTuQ_m.js +1 -0
  339. dtxwiki-0.0.1/backend/static/assets/classDiagram-4FO5ZUOK-BOEcTU37.js +1 -0
  340. dtxwiki-0.0.1/backend/static/assets/classDiagram-v2-Q7XG4LA2-BOEcTU37.js +1 -0
  341. dtxwiki-0.0.1/backend/static/assets/context-GkNFjSlJ.js +1 -0
  342. dtxwiki-0.0.1/backend/static/assets/cose-bilkent-S5V4N54A-B42Xuae7.js +1 -0
  343. dtxwiki-0.0.1/backend/static/assets/cytoscape.esm-CkSuTymj.js +321 -0
  344. dtxwiki-0.0.1/backend/static/assets/dagre-BM42HDAG-DnwvVl7c.js +4 -0
  345. dtxwiki-0.0.1/backend/static/assets/datetime-BnjnLyld.js +1 -0
  346. dtxwiki-0.0.1/backend/static/assets/defaultLocale-DX6XiGOO.js +1 -0
  347. dtxwiki-0.0.1/backend/static/assets/diagram-2AECGRRQ-CHhcd3Tm.js +43 -0
  348. dtxwiki-0.0.1/backend/static/assets/diagram-5GNKFQAL-CjfkjQTI.js +10 -0
  349. dtxwiki-0.0.1/backend/static/assets/diagram-KO2AKTUF-C8P94VYb.js +3 -0
  350. dtxwiki-0.0.1/backend/static/assets/diagram-LMA3HP47-D3LKUKZG.js +24 -0
  351. dtxwiki-0.0.1/backend/static/assets/diagram-OG6HWLK6-CGk-FJDI.js +24 -0
  352. dtxwiki-0.0.1/backend/static/assets/editor-core-Cdo7OTFt.js +1 -0
  353. dtxwiki-0.0.1/backend/static/assets/editor-language-tools-CgxqIgMk.js +14 -0
  354. dtxwiki-0.0.1/backend/static/assets/editor-parser-DSyH1Mzz.js +6 -0
  355. dtxwiki-0.0.1/backend/static/assets/editor-react-DRW4r8ms.js +1 -0
  356. dtxwiki-0.0.1/backend/static/assets/editor-view-BXEsFLud.js +11 -0
  357. dtxwiki-0.0.1/backend/static/assets/editorCompletions-DuzU7UvS.js +1 -0
  358. dtxwiki-0.0.1/backend/static/assets/erDiagram-TEJ5UH35-C1PyRkV0.js +85 -0
  359. dtxwiki-0.0.1/backend/static/assets/flowDiagram-I6XJVG4X-3m6UNhdQ.js +162 -0
  360. dtxwiki-0.0.1/backend/static/assets/ganttDiagram-6RSMTGT7-LQnXwYZS.js +292 -0
  361. dtxwiki-0.0.1/backend/static/assets/gitGraphDiagram-PVQCEYII-BHa_Pet_.js +106 -0
  362. dtxwiki-0.0.1/backend/static/assets/graph--OzhPTMs.js +1 -0
  363. dtxwiki-0.0.1/backend/static/assets/index-BdTqqDwG.js +2 -0
  364. dtxwiki-0.0.1/backend/static/assets/index-Cmd_pg4m.css +1 -0
  365. dtxwiki-0.0.1/backend/static/assets/infoDiagram-5YYISTIA-C2mg4KKv.js +2 -0
  366. dtxwiki-0.0.1/backend/static/assets/init-Gi6I4Gst.js +1 -0
  367. dtxwiki-0.0.1/backend/static/assets/ishikawaDiagram-YF4QCWOH-CE-dFGYw.js +70 -0
  368. dtxwiki-0.0.1/backend/static/assets/journeyDiagram-JHISSGLW-DqYwk8pB.js +139 -0
  369. dtxwiki-0.0.1/backend/static/assets/kanban-definition-UN3LZRKU-BacEfSti.js +89 -0
  370. dtxwiki-0.0.1/backend/static/assets/katex-HP8lGamR.js +257 -0
  371. dtxwiki-0.0.1/backend/static/assets/layout-SsrduOYp.js +1 -0
  372. dtxwiki-0.0.1/backend/static/assets/library-B6fRp5Gm.js +1 -0
  373. dtxwiki-0.0.1/backend/static/assets/linear-DVlp5p9k.js +1 -0
  374. dtxwiki-0.0.1/backend/static/assets/markdown-renderer-DePAehBt.js +298 -0
  375. dtxwiki-0.0.1/backend/static/assets/mermaid.core-CYYJY67q.js +301 -0
  376. dtxwiki-0.0.1/backend/static/assets/mindmap-definition-RKZ34NQL-DdKxWlof.js +96 -0
  377. dtxwiki-0.0.1/backend/static/assets/oauth-DyP8Cxyk.js +1 -0
  378. dtxwiki-0.0.1/backend/static/assets/ordinal-Cboi1Yqb.js +1 -0
  379. dtxwiki-0.0.1/backend/static/assets/pages-CGETtzbr.js +1 -0
  380. dtxwiki-0.0.1/backend/static/assets/pdf.worker.min-qwK7q_zL.mjs +28 -0
  381. dtxwiki-0.0.1/backend/static/assets/permissions-ChixKY_L.js +1 -0
  382. dtxwiki-0.0.1/backend/static/assets/pieDiagram-4H26LBE5-BEoevSrX.js +30 -0
  383. dtxwiki-0.0.1/backend/static/assets/quadrantDiagram-W4KKPZXB-CwTyi4l7.js +7 -0
  384. dtxwiki-0.0.1/backend/static/assets/react-vendor-B9Z7D9kT.css +1 -0
  385. dtxwiki-0.0.1/backend/static/assets/react-vendor-D-A9oZv0.js +23 -0
  386. dtxwiki-0.0.1/backend/static/assets/requirementDiagram-4Y6WPE33-C0ts8nzW.js +84 -0
  387. dtxwiki-0.0.1/backend/static/assets/sankeyDiagram-5OEKKPKP-COb8cAU9.js +40 -0
  388. dtxwiki-0.0.1/backend/static/assets/sequenceDiagram-3UESZ5HK-DQ4oJOSq.js +162 -0
  389. dtxwiki-0.0.1/backend/static/assets/stateDiagram-AJRCARHV-DB7lbo8X.js +1 -0
  390. dtxwiki-0.0.1/backend/static/assets/stateDiagram-v2-BHNVJYJU-BkBPd5nW.js +1 -0
  391. dtxwiki-0.0.1/backend/static/assets/timeline-definition-PNZ67QCA-Bu-1ffiL.js +120 -0
  392. dtxwiki-0.0.1/backend/static/assets/treeBreadcrumbs-CpaE1543.js +1 -0
  393. dtxwiki-0.0.1/backend/static/assets/treeRouteState-BNlMLOl9.js +1 -0
  394. dtxwiki-0.0.1/backend/static/assets/urlState-DNJd2clf.js +1 -0
  395. dtxwiki-0.0.1/backend/static/assets/useAsyncLoad-BxqJIu7P.js +1 -0
  396. dtxwiki-0.0.1/backend/static/assets/vennDiagram-CIIHVFJN-nVhYg_zO.js +34 -0
  397. dtxwiki-0.0.1/backend/static/assets/wardley-L42UT6IY-BdL46ant.js +161 -0
  398. dtxwiki-0.0.1/backend/static/assets/wardleyDiagram-YWT4CUSO-BGM9TwwH.js +78 -0
  399. dtxwiki-0.0.1/backend/static/assets/xychartDiagram-2RQKCTM6-CMs6AC4_.js +7 -0
  400. dtxwiki-0.0.1/backend/static/index.html +15 -0
  401. dtxwiki-0.0.1/backend/utils/__init__.py +1 -0
  402. dtxwiki-0.0.1/backend/utils/actor_display.py +26 -0
  403. dtxwiki-0.0.1/backend/utils/content_hash.py +65 -0
  404. dtxwiki-0.0.1/backend/utils/page_frontmatter.py +262 -0
  405. dtxwiki-0.0.1/backend/utils/uuid.py +10 -0
  406. dtxwiki-0.0.1/backend/worker/__init__.py +1 -0
  407. dtxwiki-0.0.1/backend/worker/entry.py +146 -0
  408. dtxwiki-0.0.1/backend/worker/runtime.py +455 -0
  409. dtxwiki-0.0.1/dtxwiki.egg-info/PKG-INFO +731 -0
  410. dtxwiki-0.0.1/dtxwiki.egg-info/SOURCES.txt +426 -0
  411. dtxwiki-0.0.1/dtxwiki.egg-info/dependency_links.txt +1 -0
  412. dtxwiki-0.0.1/dtxwiki.egg-info/entry_points.txt +4 -0
  413. dtxwiki-0.0.1/dtxwiki.egg-info/requires.txt +21 -0
  414. dtxwiki-0.0.1/dtxwiki.egg-info/top_level.txt +1 -0
  415. dtxwiki-0.0.1/infra/prod/.env.docker.example +24 -0
  416. dtxwiki-0.0.1/infra/prod/.env.example +63 -0
  417. dtxwiki-0.0.1/infra/prod/Caddyfile.docker +31 -0
  418. dtxwiki-0.0.1/infra/prod/Caddyfile.example +28 -0
  419. dtxwiki-0.0.1/infra/prod/docker-compose.yml +116 -0
  420. dtxwiki-0.0.1/infra/prod/docker-entrypoint.sh +42 -0
  421. dtxwiki-0.0.1/infra/prod/dtxwiki-worker.service +24 -0
  422. dtxwiki-0.0.1/infra/prod/dtxwiki.service +25 -0
  423. dtxwiki-0.0.1/infra/prod/install.sh +110 -0
  424. dtxwiki-0.0.1/infra/prod/nginx.conf.example +38 -0
  425. dtxwiki-0.0.1/pyproject.toml +113 -0
  426. dtxwiki-0.0.1/setup.cfg +4 -0
  427. dtxwiki-0.0.1/tests/packaging/production_smoke.ps1 +110 -0
  428. dtxwiki-0.0.1/tests/packaging/production_smoke.sh +86 -0
@@ -0,0 +1,261 @@
1
+ # dtxWiki 프로덕션 배포 & 운영 Runbook (Ubuntu 22.04+)
2
+
3
+ Fresh Ubuntu 22.04 VM 에 dtxWiki 를 self-host 설치하는 절차. 대부분은 아래 **Quick
4
+ install (한 명령)** 로 끝난다. 그 아래 Step 1~8 은 같은 일을 손으로 하는 **수동/디버그
5
+ 경로**로, 자동 설치가 내부적으로 수행하는 단계를 그대로 문서화한 것이다.
6
+
7
+ > 설치 빠른 경로(solo·systemd·Docker) 요약은 루트 [README](README.md#설치) 에 있다. 이
8
+ > 문서는 그 production self-host 의 **전체 절차 + Day-2 운영 + 수동/디버그 + 트러블슈팅**
9
+ > 정본이다. (install.sh 한 명령은 README·이 문서 동일 — 방법이 갈라지지 않는다.)
10
+
11
+ ## Quick install (한 명령)
12
+
13
+ 맨 VM 에서, 도메인과 관리자 이메일 두 개만 정하면 된다. SSL 은 Caddy 가 Let's Encrypt
14
+ 에서 자동 발급한다 (전제: 도메인 DNS A 레코드가 이 서버 공인 IP 를 가리키고 80/443 이
15
+ 열려 있을 것 — 설치 스크립트가 preflight 로 확인한다).
16
+
17
+ ```bash
18
+ curl -fsSL https://<host>/install.sh | sudo bash -s -- \
19
+ --domain wiki.example.com --email admin@example.com
20
+ ```
21
+
22
+ `install.sh` 는 OS 프로비저닝(python3.12 + caddy + 시스템 유저 + venv +
23
+ `pip install dtxwiki`)만 담당하고, 앱 구성은 `dtxwiki setup production` 에 위임한다.
24
+
25
+ > **첫 PyPI 릴리스 전**에는 `pip install dtxwiki` 가 실패한다(install.sh 가 친절한
26
+ > 에러로 `--wheel` 사용을 안내). 그동안은 로컬 wheel 로 설치한다 — 빌드 머신에서
27
+ > `make build-wheel` 로 `dist/dtxwiki-<version>-py3-none-any.whl` 을 만든 뒤 서버로
28
+ > 복사하고 `--wheel` 로 지정한다:
29
+ >
30
+ > ```bash
31
+ > sudo bash install.sh --domain wiki.example.com --email admin@example.com \
32
+ > --wheel /path/dtxwiki-<version>-py3-none-any.whl
33
+ > ```
34
+
35
+ 이미 패키지가 설치돼 있으면(pipx/수동) 두 번째 단계만 직접 실행해도 된다:
36
+
37
+ ```bash
38
+ sudo dtxwiki setup production --domain wiki.example.com --email admin@example.com
39
+ ```
40
+
41
+ `setup production` 은 멱등이다: JWT 키·session secret 은 한 번 생성되면 보존되고
42
+ (`--reconfigure` 로 재실행해도 토큰/세션이 깨지지 않는다), 운영자 입력은 도메인+이메일
43
+ 2 개로 제한된다. 나머지(secret 생성, keygen, env 파일, systemd unit, Caddyfile,
44
+ bootstrap, admin, smoke)는 자동이다.
45
+
46
+ 개인/평가용으로 가볍게 띄울 거면 인터넷 노출 없이 `pipx install dtxwiki && dtxwiki`
47
+ (solo_local) 로 충분하다.
48
+
49
+ ## Day-2 reconfiguration (설치 후 값 변경)
50
+
51
+ 설정의 source-of-truth 는 `/etc/dtxwiki/dtxwiki.env` + Caddyfile 두 파일이다. 변경은
52
+ 설치와 같은 도구로 한다 — 앱 프로세스는 systemd 샌드박스(`ProtectSystem=strict`)로
53
+ `/etc` 에 못 쓰므로 웹 UI 가 아니라 CLI(root)가 푼다.
54
+
55
+ ```bash
56
+ sudo dtxwiki config show # 현재 값(시크릿 redacted) + 마지막 적용 시각
57
+ sudo dtxwiki config set DTXWIKI_PUBLIC_BASE_URL=https://new.example.com
58
+ ```
59
+
60
+ `config set` 은 env 파일을 백업→원자적 수정하고, 변경의 영향(blast-radius)을 출력한다.
61
+ 세션 시크릿·JWT 키처럼 전원 로그아웃/토큰 무효를 일으키는 위험 키는 `--i-understand`
62
+ 없이는 거부된다. 적용 강도 요약:
63
+
64
+ | 변경 | 영향 | 적용 |
65
+ |---|---|---|
66
+ | `DTXWIKI_PUBLIC_BASE_URL` / 도메인 | OAuth·MCP metadata, MCP 클라이언트 재등록 | restart + 프록시 reload, cert 재발급 |
67
+ | `DTXWIKI_CORS_ORIGINS` | 브라우저 origin 허용 범위 | restart |
68
+ | `DTXWIKI_SESSION_SECRET` | 로그인 세션 전원 무효 | restart (`--i-understand` 필요) |
69
+ | JWT 키 (`dtxwiki keygen --force`) | OAuth/MCP 토큰 전부 무효 | restart (PAT 는 DB 라 별개) |
70
+ | `DTXWIKI_DATABASE_URL` | 데이터 안 따라옴 | `dtxwiki migrate-data` 선행 후 restart |
71
+
72
+ 서버 이전(새 머신)은 신규 VM 에 `install.sh` 실행 후 기존 `/etc/dtxwiki`(키·시크릿·env)
73
+ 와 DB 파일을 복제하면 토큰·세션이 유지된다.
74
+
75
+ ## Docker 설치 (Tier 2)
76
+
77
+ > 상태: **2026-06-05 Linux 호스트에서 `docker compose up -d --build` 빌드/기동 검증 통과**
78
+ > — app crash-loop 없음, 이미지 업로드가 data volume(`/var/lib/dtxwiki`)에 정상 기록,
79
+ > 재시작 후에도 DB·업로드·세션 유지 확인. 라이선스는 Apache-2.0으로 선언되며 release
80
+ > artifact에는 root `LICENSE`/`NOTICE`가 포함된다.
81
+
82
+ systemd/venv 대신 컨테이너로 띄우는 경로. 레포를 clone 한 뒤 도메인+이메일 2개만 정하면
83
+ 된다. Caddy 컨테이너가 TLS(Let's Encrypt)를 자동 처리한다.
84
+
85
+ ```bash
86
+ cd infra/prod
87
+ cp .env.docker.example .env # DTXWIKI_DOMAIN + DTXWIKI_ADMIN_EMAIL 입력
88
+ docker compose up -d --build
89
+ ```
90
+
91
+ 구성: 멀티스테이지 [Dockerfile](Dockerfile)(프론트 빌드 → SPA 를 `backend/static`
92
+ 에 번들 → `pip install`), `init`(keygen+secret+bootstrap 1회) → `app`+`worker` →
93
+ `caddy`(80/443, auto-TLS, `app:21080` 로 reverse proxy). SQLite 는 named volume,
94
+ JWT 키·session secret 은 data volume 에 영속(재시작해도 토큰·세션 유지).
95
+ 전제는 self-host 와 동일: 도메인 DNS A 레코드 → 호스트, 80/443 개방.
96
+ production 스택은 dtxWiki 이미지 + `caddy:2` 만 사용하며 개발 전용 사이드카는 포함하지
97
+ 않는다.
98
+
99
+ ---
100
+
101
+ ## Step 1 — System user 및 디렉터리 생성
102
+
103
+ ```bash
104
+ sudo useradd --system --home /opt/dtxwiki --shell /usr/sbin/nologin dtxwiki
105
+ sudo mkdir -p /opt/dtxwiki /etc/dtxwiki /var/lib/dtxwiki
106
+ sudo chown -R dtxwiki:dtxwiki /opt/dtxwiki /var/lib/dtxwiki
107
+ sudo chown root:dtxwiki /etc/dtxwiki && sudo chmod 750 /etc/dtxwiki
108
+ ```
109
+
110
+ ## Step 2 — Python venv 및 dtxWiki 설치
111
+
112
+ ```bash
113
+ sudo apt-get update
114
+ # Ubuntu 24.04+: python3.12/python3.12-venv are available from the base repo.
115
+ # Ubuntu 22.04: enable a Python 3.12 source first, for example deadsnakes.
116
+ sudo apt-get install -y software-properties-common
117
+ sudo add-apt-repository -y ppa:deadsnakes/ppa
118
+ sudo apt-get update && sudo apt-get install -y python3.12 python3.12-venv
119
+ sudo -u dtxwiki python3.12 -m venv /opt/dtxwiki/.venv
120
+ sudo -u dtxwiki /opt/dtxwiki/.venv/bin/pip install --upgrade pip
121
+ sudo -u dtxwiki /opt/dtxwiki/.venv/bin/pip install dtxwiki
122
+ ```
123
+
124
+ ## Step 3 — JWT signing key 생성 (BLOCKER 1 / H19 / Task 4.12)
125
+
126
+ ```bash
127
+ sudo install -o dtxwiki -g dtxwiki -m 700 -d /var/lib/dtxwiki/private
128
+ sudo -u dtxwiki /opt/dtxwiki/.venv/bin/dtxwiki keygen \
129
+ --output /var/lib/dtxwiki/private/jwt.pem
130
+ sudo install -o root -g dtxwiki -m 0640 \
131
+ /var/lib/dtxwiki/private/jwt.pem /etc/dtxwiki/jwt.pem
132
+ sudo rm /var/lib/dtxwiki/private/jwt.pem
133
+ ```
134
+
135
+ keygen 은 RSA 2048 PKCS8 PEM 을 생성한다. 기존 파일 보호 — overwrite 하려면
136
+ `--force` 명시.
137
+
138
+ ## Step 4 — 환경변수 파일 작성
139
+
140
+ ```bash
141
+ sudo cp /opt/dtxwiki/.venv/share/dtxwiki/infra/prod/.env.example /etc/dtxwiki/dtxwiki.env
142
+ sudo chown root:dtxwiki /etc/dtxwiki/dtxwiki.env && sudo chmod 640 /etc/dtxwiki/dtxwiki.env
143
+ sudo nano /etc/dtxwiki/dtxwiki.env
144
+ # - DTXWIKI_PUBLIC_BASE_URL=https://<your-domain>
145
+ # - DTXWIKI_CORS_ORIGINS=https://<your-domain>
146
+ # - DTXWIKI_SESSION_SECRET=<64-byte-secret>
147
+ # 9 guard 모두 통과해야 한다 (Task 4.3 a-j)
148
+ ```
149
+
150
+ ## Step 4.5 — Bootstrap 1 회 수동 실행 (H24 / Q A3)
151
+
152
+ ```bash
153
+ sudo -u dtxwiki bash -c 'set -a; source /etc/dtxwiki/dtxwiki.env; \
154
+ /opt/dtxwiki/.venv/bin/dtxwiki bootstrap'
155
+ ```
156
+
157
+ `dtxwiki bootstrap` 은 운영자 1 회 maintenance command 이며, env 파일의
158
+ `DTXWIKI_AUTO_BOOTSTRAP=false` 는 그대로 둔다. 장기 실행 server startup 에서
159
+ 자동 bootstrap 은 계속 금지된다.
160
+
161
+ 본 1 회 명령이 Sprint_5 신규 alembic migration **3개를 한 번에 apply** 한다:
162
+ `0019_sprint5_audit_workspace_nullable` → `0020_sprint5_oauth_access_token_jti`
163
+ → `0021_sprint5_app_metadata`.
164
+
165
+ ## Step 5 — systemd unit 설치 + enable
166
+
167
+ ```bash
168
+ sudo cp /opt/dtxwiki/.venv/share/dtxwiki/infra/prod/dtxwiki.service /etc/systemd/system/
169
+ sudo cp /opt/dtxwiki/.venv/share/dtxwiki/infra/prod/dtxwiki-worker.service /etc/systemd/system/
170
+ sudo systemctl daemon-reload
171
+ sudo systemctl enable --now dtxwiki dtxwiki-worker
172
+ sudo systemctl status dtxwiki dtxwiki-worker
173
+ ```
174
+
175
+ ## Step 6 — Reverse proxy + TLS
176
+
177
+ ### Option A: Caddy (권고, 자동 ACME)
178
+
179
+ ```bash
180
+ sudo apt-get install -y caddy
181
+ sudo cp /opt/dtxwiki/.venv/share/dtxwiki/infra/prod/Caddyfile.example /etc/caddy/Caddyfile
182
+ sudo nano /etc/caddy/Caddyfile # wiki.example.com → your domain
183
+ sudo systemctl reload-or-restart caddy
184
+ ```
185
+
186
+ ### Option B: nginx + certbot (advanced)
187
+
188
+ ```bash
189
+ sudo apt-get install -y nginx certbot python3-certbot-nginx
190
+ sudo cp /opt/dtxwiki/.venv/share/dtxwiki/infra/prod/nginx.conf.example \
191
+ /etc/nginx/sites-available/dtxwiki.conf
192
+ sudo ln -s /etc/nginx/sites-available/dtxwiki.conf /etc/nginx/sites-enabled/
193
+ sudo nginx -t && sudo systemctl reload nginx
194
+ sudo certbot certonly --nginx -d wiki.example.com \
195
+ --agree-tos -m admin@example.com --no-eff-email
196
+ sudo systemctl reload nginx
197
+ ```
198
+
199
+ `admin@example.com` 은 인증서 만료/갱신 알림을 받을 운영자 이메일로 교체한다.
200
+
201
+ ## Step 7 — Admin user 생성 + smoke 확인
202
+
203
+ ```bash
204
+ sudo -u dtxwiki bash -c 'set -a; source /etc/dtxwiki/dtxwiki.env; \
205
+ /opt/dtxwiki/.venv/bin/dtxwiki users add admin@example.com --role owner'
206
+ # 외부에서 smoke 확인:
207
+ curl -fsS https://wiki.example.com/health/live
208
+ curl -fsS https://wiki.example.com/health/ready
209
+ curl -i https://wiki.example.com/mcp # expect 401 + WWW-Authenticate
210
+ ```
211
+
212
+ ## Step 8 — Production smoke 자동 실행 (Task 4.9)
213
+
214
+ ```bash
215
+ /opt/dtxwiki/.venv/share/dtxwiki/tests/packaging/production_smoke.sh https://wiki.example.com
216
+ # 5 검사 OK + compat 1 OK 시 exit 0
217
+ ```
218
+
219
+ ---
220
+
221
+ ## 데이터베이스
222
+
223
+ production 은 **SQLite 전용**이다 (`/var/lib/dtxwiki/dtxwiki.sqlite`, backend·worker 공유).
224
+ 별도 DB 서버가 필요 없다. 외부 DB 옵션은 현재 정식 지원 범위가 아니며 개발/실험 용도로만
225
+ 다룬다 — [DEVELOPMENT.md](DEVELOPMENT.md) 참고.
226
+
227
+ ---
228
+
229
+ ## Cross-platform dev PC 참조 (D2)
230
+
231
+ 외부 PC (Linux / Windows) 의 Claude Code / Codex CLI 등록은 별도 문서
232
+ `doc/setup/remote-mcp-clients.md` 참조.
233
+ Windows 의 `%APPDATA%\Claude\` / `%APPDATA%\codex\` 경로 차이 명시.
234
+
235
+ ---
236
+
237
+ ## LICENSE / NOTICE 정책 (H13)
238
+
239
+ 본 repository 와 release artifact 는 Apache License 2.0 기준으로 배포된다. root
240
+ `LICENSE` 에 Apache-2.0 전문을 두고, root `NOTICE` 는 wheel/sdist license metadata에
241
+ 포함한다. PyPI metadata의 SPDX license expression은 `Apache-2.0`이다.
242
+
243
+ ---
244
+
245
+ ## Health monitoring 경로 안내 (Phase_6 cross-reference)
246
+
247
+ 본 Sprint_5 부터 health endpoint 가 root prefix 로 split (ADR A10):
248
+ - **`/health/live`** — process liveness, 의존성 0
249
+ - **`/health/ready`** — DB + app_version_synced + MCP + JWT loadability 검증
250
+ - **`/api/v1/health`** — **deprecated compat** (future: Sprint_7+ 에서 제거 예정)
251
+
252
+ ## Troubleshooting
253
+
254
+ | 증상 | 원인 | 조치 |
255
+ |---|---|---|
256
+ | systemctl start dtxwiki → `validate_for_startup` 에러 | 9 guard 중 하나 미통과 | journalctl -u dtxwiki -n 50 → hint message 따라 .env 수정 |
257
+ | /mcp 가 HTML index 반환 | SPA fallback exemption 미적용 (Task 4.11) | dtxwiki 버전 확인 |
258
+ | OAuth 토큰 process 재시작마다 invalidate | DTXWIKI_OAUTH_JWT_PRIVATE_KEY_PATH 미설정 | dtxwiki keygen 1회 실행 + env 파일의 stable path 고정 |
259
+ | /health/ready 503 oauth_jwk=ephemeral_unsafe | JWT PEM path 가 비어있거나 invalid | step 3 재수행 |
260
+ | /health/ready 503 app_version=unsynced | `ensure_app_version_synced` 미호출 | systemd unit 의 ExecStart 가 `dtxwiki serve` 사용하는지 확인 |
261
+ | Worker unit 즉시 종료 | --idle-exit-after 0 사용 (H8) | dtxwiki-worker.service 의 ExecStart 점검 |
dtxwiki-0.0.1/LICENSE ADDED
@@ -0,0 +1,186 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation or
31
+ translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work (an example is provided in the Appendix
37
+ below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
40
+ is based on (or derived from) the Work and for which the editorial revisions,
41
+ annotations, elaborations, or other modifications represent, as a whole, an
42
+ original work of authorship. For the purposes of this License, Derivative
43
+ Works shall not include works that remain separable from, or merely link (or
44
+ bind by name) to the interfaces of, the Work and Derivative Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original
47
+ version of the Work and any modifications or additions to that Work or
48
+ Derivative Works thereof, that is intentionally submitted to Licensor for
49
+ inclusion in the Work by the copyright owner or by an individual or Legal
50
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
51
+ of this definition, "submitted" means any form of electronic, verbal, or
52
+ written communication sent to the Licensor or its representatives, including
53
+ but not limited to communication on electronic mailing lists, source code
54
+ control systems, and issue tracking systems that are managed by, or on behalf
55
+ of, the Licensor for the purpose of discussing and improving the Work, but
56
+ excluding communication that is conspicuously marked or otherwise designated
57
+ in writing by the copyright owner as "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
60
+ behalf of whom a Contribution has been received by Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
64
+ License, each Contributor hereby grants to You a perpetual, worldwide,
65
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
66
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
67
+ sublicense, and distribute the Work and such Derivative Works in Source or
68
+ Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of this
71
+ License, each Contributor hereby grants to You a perpetual, worldwide,
72
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
73
+ section) patent license to make, have made, use, offer to sell, sell, import,
74
+ and otherwise transfer the Work, where such license applies only to those
75
+ patent claims licensable by such Contributor that are necessarily infringed by
76
+ their Contribution(s) alone or by combination of their Contribution(s) with
77
+ the Work to which such Contribution(s) was submitted. If You institute patent
78
+ litigation against any entity (including a cross-claim or counterclaim in a
79
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
80
+ constitutes direct or contributory patent infringement, then any patent
81
+ licenses granted to You under this License for that Work shall terminate as of
82
+ the date such litigation is filed.
83
+
84
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
85
+ Derivative Works thereof in any medium, with or without modifications, and in
86
+ Source or Object form, provided that You meet the following conditions:
87
+
88
+ (a) You must give any other recipients of the Work or Derivative Works a
89
+ copy of this License; and
90
+
91
+ (b) You must cause any modified files to carry prominent notices stating
92
+ that You changed the files; and
93
+
94
+ (c) You must retain, in the Source form of any Derivative Works that You
95
+ distribute, all copyright, patent, trademark, and attribution notices
96
+ from the Source form of the Work, excluding those notices that do not
97
+ pertain to any part of the Derivative Works; and
98
+
99
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
100
+ then any Derivative Works that You distribute must include a readable
101
+ copy of the attribution notices contained within such NOTICE file,
102
+ excluding those notices that do not pertain to any part of the
103
+ Derivative Works, in at least one of the following places: within a
104
+ NOTICE text file distributed as part of the Derivative Works; within the
105
+ Source form or documentation, if provided along with the Derivative
106
+ Works; or, within a display generated by the Derivative Works, if and
107
+ wherever such third-party notices normally appear. The contents of the
108
+ NOTICE file are for informational purposes only and do not modify the
109
+ License. You may add Your own attribution notices within Derivative
110
+ Works that You distribute, alongside or as an addendum to the NOTICE
111
+ text from the Work, provided that such additional attribution notices
112
+ cannot be construed as modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may provide
115
+ additional or different license terms and conditions for use, reproduction, or
116
+ distribution of Your modifications, or for any such Derivative Works as a
117
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
118
+ complies with the conditions stated in this License.
119
+
120
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
121
+ Contribution intentionally submitted for inclusion in the Work by You to the
122
+ Licensor shall be under the terms and conditions of this License, without any
123
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
124
+ supersede or modify the terms of any separate license agreement you may have
125
+ executed with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade names,
128
+ trademarks, service marks, or product names of the Licensor, except as
129
+ required for reasonable and customary use in describing the origin of the Work
130
+ and reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
133
+ writing, Licensor provides the Work (and each Contributor provides its
134
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
135
+ KIND, either express or implied, including, without limitation, any warranties
136
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
137
+ PARTICULAR PURPOSE. You are solely responsible for determining the
138
+ appropriateness of using or redistributing the Work and assume any risks
139
+ associated with Your exercise of permissions under this License.
140
+
141
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
142
+ tort (including negligence), contract, or otherwise, unless required by
143
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
144
+ writing, shall any Contributor be liable to You for damages, including any
145
+ direct, indirect, special, incidental, or consequential damages of any
146
+ character arising as a result of this License or out of the use or inability
147
+ to use the Work (including but not limited to damages for loss of goodwill,
148
+ work stoppage, computer failure or malfunction, or any and all other
149
+ commercial damages or losses), even if such Contributor has been advised of
150
+ the possibility of such damages.
151
+
152
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
153
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
154
+ acceptance of support, warranty, indemnity, or other liability obligations
155
+ and/or rights consistent with this License. However, in accepting such
156
+ obligations, You may act only on Your own behalf and on Your sole
157
+ responsibility, not on behalf of any other Contributor, and only if You agree
158
+ to indemnify, defend, and hold each Contributor harmless for any liability
159
+ incurred by, or claims asserted against, such Contributor by reason of your
160
+ accepting any such warranty or additional liability.
161
+
162
+ END OF TERMS AND CONDITIONS
163
+
164
+ APPENDIX: How to apply the Apache License to your work.
165
+
166
+ To apply the Apache License to your work, attach the following boilerplate
167
+ notice, with the fields enclosed by brackets "[]" replaced with your own
168
+ identifying information. Do not include the brackets. The text should be
169
+ enclosed in the appropriate comment syntax for the file format. We also
170
+ recommend that a file or class name and description of purpose be included on
171
+ the same "printed page" as the copyright notice for easier identification
172
+ within third-party archives.
173
+
174
+ Copyright [yyyy] [name of copyright owner]
175
+
176
+ Licensed under the Apache License, Version 2.0 (the "License");
177
+ you may not use this file except in compliance with the License.
178
+ You may obtain a copy of the License at
179
+
180
+ http://www.apache.org/licenses/LICENSE-2.0
181
+
182
+ Unless required by applicable law or agreed to in writing, software
183
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
184
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185
+ See the License for the specific language governing permissions and
186
+ limitations under the License.
@@ -0,0 +1,17 @@
1
+ include README.md
2
+ include DEPLOYMENT.md
3
+ include LICENSE
4
+ include NOTICE
5
+ include backend/alembic.ini
6
+ recursive-include backend/migrations *
7
+ recursive-include backend/static *
8
+ recursive-include infra/prod *
9
+ include tests/packaging/production_smoke.sh
10
+ include tests/packaging/production_smoke.ps1
11
+ global-exclude __pycache__/*
12
+ global-exclude *.py[cod]
13
+ # Operator audit + internal docs + temp scratch — never ship in release wheel.
14
+ prune internal
15
+ prune doc
16
+ prune tests/fixtures
17
+ prune .ci-evidence
dtxwiki-0.0.1/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ dtxWiki
2
+ Copyright 2026 dtxWiki contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0.