otterwiki 2.2.0__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 (268) hide show
  1. otterwiki-2.2.0/.coveragerc +6 -0
  2. otterwiki-2.2.0/.gitignore +21 -0
  3. otterwiki-2.2.0/.mailmap +2 -0
  4. otterwiki-2.2.0/Dockerfile +73 -0
  5. otterwiki-2.2.0/LICENSE +21 -0
  6. otterwiki-2.2.0/MANIFEST.in +4 -0
  7. otterwiki-2.2.0/Makefile +128 -0
  8. otterwiki-2.2.0/PKG-INFO +130 -0
  9. otterwiki-2.2.0/README.md +63 -0
  10. otterwiki-2.2.0/docker/entrypoint.sh +102 -0
  11. otterwiki-2.2.0/docker/stop-supervisor.sh +8 -0
  12. otterwiki-2.2.0/docker/supervisord.conf +27 -0
  13. otterwiki-2.2.0/docker/uwsgi.ini +36 -0
  14. otterwiki-2.2.0/docker-compose.override.yml.skeleton +54 -0
  15. otterwiki-2.2.0/docker-compose.yml +20 -0
  16. otterwiki-2.2.0/otterwiki/__init__.py +13 -0
  17. otterwiki-2.2.0/otterwiki/about.md +27 -0
  18. otterwiki-2.2.0/otterwiki/auth.py +624 -0
  19. otterwiki-2.2.0/otterwiki/gitstorage.py +365 -0
  20. otterwiki-2.2.0/otterwiki/help.md +139 -0
  21. otterwiki-2.2.0/otterwiki/help_admin.md +102 -0
  22. otterwiki-2.2.0/otterwiki/helper.py +180 -0
  23. otterwiki-2.2.0/otterwiki/initial_home.md +28 -0
  24. otterwiki-2.2.0/otterwiki/preferences.py +294 -0
  25. otterwiki-2.2.0/otterwiki/profiler.py +20 -0
  26. otterwiki-2.2.0/otterwiki/remote.py +106 -0
  27. otterwiki-2.2.0/otterwiki/renderer.py +274 -0
  28. otterwiki-2.2.0/otterwiki/renderer_plugins.py +522 -0
  29. otterwiki-2.2.0/otterwiki/server.py +160 -0
  30. otterwiki-2.2.0/otterwiki/sidebar.py +132 -0
  31. otterwiki-2.2.0/otterwiki/static/.DS_Store +0 -0
  32. otterwiki-2.2.0/otterwiki/static/.gitattributes +2 -0
  33. otterwiki-2.2.0/otterwiki/static/css/.gitattributes +12 -0
  34. otterwiki-2.2.0/otterwiki/static/css/codemirror-theme.css +99 -0
  35. otterwiki-2.2.0/otterwiki/static/css/codemirror.css +350 -0
  36. otterwiki-2.2.0/otterwiki/static/css/elements/page.css +116 -0
  37. otterwiki-2.2.0/otterwiki/static/css/elements/table.css +0 -0
  38. otterwiki-2.2.0/otterwiki/static/css/elements/toast.css +16 -0
  39. otterwiki-2.2.0/otterwiki/static/css/fontawesome-all.css +4616 -0
  40. otterwiki-2.2.0/otterwiki/static/css/fontawesome-all.min.css +5 -0
  41. otterwiki-2.2.0/otterwiki/static/css/halfmoon-variables.css +14539 -0
  42. otterwiki-2.2.0/otterwiki/static/css/halfmoon-variables.min.css +11 -0
  43. otterwiki-2.2.0/otterwiki/static/css/halfmoon.css +14408 -0
  44. otterwiki-2.2.0/otterwiki/static/css/halfmoon.min.css +11 -0
  45. otterwiki-2.2.0/otterwiki/static/css/otterwiki.css +310 -0
  46. otterwiki-2.2.0/otterwiki/static/css/partials/documentation.css +63 -0
  47. otterwiki-2.2.0/otterwiki/static/css/partials/history.css +92 -0
  48. otterwiki-2.2.0/otterwiki/static/css/partials/sidebar.css +216 -0
  49. otterwiki-2.2.0/otterwiki/static/css/print.css +29 -0
  50. otterwiki-2.2.0/otterwiki/static/css/pygments.css +165 -0
  51. otterwiki-2.2.0/otterwiki/static/css/roboto.css +13 -0
  52. otterwiki-2.2.0/otterwiki/static/img/backdrop.jpg +0 -0
  53. otterwiki-2.2.0/otterwiki/static/img/otter-favicon.ico +0 -0
  54. otterwiki-2.2.0/otterwiki/static/img/otter-favicon.png +0 -0
  55. otterwiki-2.2.0/otterwiki/static/img/otter-favicon.xcf +0 -0
  56. otterwiki-2.2.0/otterwiki/static/img/otter-favicon2.ico +0 -0
  57. otterwiki-2.2.0/otterwiki/static/img/otter-favicon2.png +0 -0
  58. otterwiki-2.2.0/otterwiki/static/img/otter-favicon2.xcf +0 -0
  59. otterwiki-2.2.0/otterwiki/static/img/otter.png +0 -0
  60. otterwiki-2.2.0/otterwiki/static/img/otter.xcf +0 -0
  61. otterwiki-2.2.0/otterwiki/static/img/otterhead-100.png +0 -0
  62. otterwiki-2.2.0/otterwiki/static/img/otterhead.png +0 -0
  63. otterwiki-2.2.0/otterwiki/static/img/otterhead.xcf +0 -0
  64. otterwiki-2.2.0/otterwiki/static/img/preview.png +0 -0
  65. otterwiki-2.2.0/otterwiki/static/img/preview.xcf +0 -0
  66. otterwiki-2.2.0/otterwiki/static/js/.gitattributes +15 -0
  67. otterwiki-2.2.0/otterwiki/static/js/cm-continuelist.js +101 -0
  68. otterwiki-2.2.0/otterwiki/static/js/cm-markdown.js +886 -0
  69. otterwiki-2.2.0/otterwiki/static/js/cm-modes.js +7613 -0
  70. otterwiki-2.2.0/otterwiki/static/js/cm-modes.min.js +1093 -0
  71. otterwiki-2.2.0/otterwiki/static/js/cm-panel.js +133 -0
  72. otterwiki-2.2.0/otterwiki/static/js/codemirror-4.inline-attachment.js +89 -0
  73. otterwiki-2.2.0/otterwiki/static/js/codemirror.js +9874 -0
  74. otterwiki-2.2.0/otterwiki/static/js/codemirror.min.js +1976 -0
  75. otterwiki-2.2.0/otterwiki/static/js/halfmoon-module.js +513 -0
  76. otterwiki-2.2.0/otterwiki/static/js/halfmoon.js +519 -0
  77. otterwiki-2.2.0/otterwiki/static/js/halfmoon.min.js +11 -0
  78. otterwiki-2.2.0/otterwiki/static/js/inline-attachment.js +399 -0
  79. otterwiki-2.2.0/otterwiki/static/js/otterwiki.js +662 -0
  80. otterwiki-2.2.0/otterwiki/static/js/polyfill.e6.min.js +100 -0
  81. otterwiki-2.2.0/otterwiki/static/js/polyfill.min.js +95 -0
  82. otterwiki-2.2.0/otterwiki/static/mathjax/a11y/assistive-mml.js +1 -0
  83. otterwiki-2.2.0/otterwiki/static/mathjax/a11y/complexity.js +1 -0
  84. otterwiki-2.2.0/otterwiki/static/mathjax/a11y/explorer.js +1 -0
  85. otterwiki-2.2.0/otterwiki/static/mathjax/a11y/semantic-enrich.js +1 -0
  86. otterwiki-2.2.0/otterwiki/static/mathjax/adaptors/liteDOM.js +1 -0
  87. otterwiki-2.2.0/otterwiki/static/mathjax/core.js +1 -0
  88. otterwiki-2.2.0/otterwiki/static/mathjax/input/asciimath.js +1 -0
  89. otterwiki-2.2.0/otterwiki/static/mathjax/input/mml/entities.js +1 -0
  90. otterwiki-2.2.0/otterwiki/static/mathjax/input/mml/extensions/mml3.js +1 -0
  91. otterwiki-2.2.0/otterwiki/static/mathjax/input/mml/extensions/mml3.sef.json +1 -0
  92. otterwiki-2.2.0/otterwiki/static/mathjax/input/mml.js +1 -0
  93. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/action.js +1 -0
  94. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/all-packages.js +34 -0
  95. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/ams.js +1 -0
  96. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/amscd.js +1 -0
  97. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/autoload.js +1 -0
  98. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/bbox.js +1 -0
  99. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/boldsymbol.js +1 -0
  100. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/braket.js +1 -0
  101. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/bussproofs.js +1 -0
  102. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/cancel.js +1 -0
  103. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/centernot.js +1 -0
  104. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/color.js +1 -0
  105. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/colortbl.js +1 -0
  106. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/colorv2.js +1 -0
  107. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/configmacros.js +1 -0
  108. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/enclose.js +1 -0
  109. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/extpfeil.js +1 -0
  110. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/gensymb.js +1 -0
  111. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/html.js +1 -0
  112. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/mathtools.js +1 -0
  113. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/mhchem.js +34 -0
  114. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/newcommand.js +1 -0
  115. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/noerrors.js +1 -0
  116. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/noundefined.js +1 -0
  117. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/physics.js +1 -0
  118. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/require.js +1 -0
  119. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/setoptions.js +1 -0
  120. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/tagformat.js +1 -0
  121. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/textcomp.js +1 -0
  122. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/textmacros.js +1 -0
  123. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/unicode.js +1 -0
  124. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/upgreek.js +1 -0
  125. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex/extensions/verb.js +1 -0
  126. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex-base.js +1 -0
  127. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex-full.js +34 -0
  128. otterwiki-2.2.0/otterwiki/static/mathjax/input/tex.js +1 -0
  129. otterwiki-2.2.0/otterwiki/static/mathjax/latest.js +1 -0
  130. otterwiki-2.2.0/otterwiki/static/mathjax/loader.js +1 -0
  131. otterwiki-2.2.0/otterwiki/static/mathjax/mml-chtml.js +1 -0
  132. otterwiki-2.2.0/otterwiki/static/mathjax/mml-svg.js +1 -0
  133. otterwiki-2.2.0/otterwiki/static/mathjax/node-main.js +1 -0
  134. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/tex.js +1 -0
  135. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
  136. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
  137. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
  138. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
  139. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
  140. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
  141. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
  142. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
  143. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
  144. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
  145. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
  146. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
  147. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
  148. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
  149. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
  150. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
  151. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
  152. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
  153. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
  154. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
  155. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
  156. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
  157. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
  158. otterwiki-2.2.0/otterwiki/static/mathjax/output/chtml.js +1 -0
  159. otterwiki-2.2.0/otterwiki/static/mathjax/output/svg/fonts/tex.js +1 -0
  160. otterwiki-2.2.0/otterwiki/static/mathjax/output/svg.js +1 -0
  161. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/de.js +125 -0
  162. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/en.js +131 -0
  163. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/es.js +122 -0
  164. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/fr.js +125 -0
  165. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/hi.js +125 -0
  166. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/it.js +125 -0
  167. otterwiki-2.2.0/otterwiki/static/mathjax/sre/mathmaps/nemeth.js +113 -0
  168. otterwiki-2.2.0/otterwiki/static/mathjax/sre/sre-node.js +11 -0
  169. otterwiki-2.2.0/otterwiki/static/mathjax/sre/sre_browser.js +999 -0
  170. otterwiki-2.2.0/otterwiki/static/mathjax/startup.js +1 -0
  171. otterwiki-2.2.0/otterwiki/static/mathjax/tex-chtml-full.js +34 -0
  172. otterwiki-2.2.0/otterwiki/static/mathjax/tex-chtml.js +1 -0
  173. otterwiki-2.2.0/otterwiki/static/mathjax/tex-mml-chtml.js +1 -0
  174. otterwiki-2.2.0/otterwiki/static/mathjax/tex-mml-svg.js +1 -0
  175. otterwiki-2.2.0/otterwiki/static/mathjax/tex-svg-full.js +34 -0
  176. otterwiki-2.2.0/otterwiki/static/mathjax/tex-svg.js +1 -0
  177. otterwiki-2.2.0/otterwiki/static/mathjax/ui/lazy.js +1 -0
  178. otterwiki-2.2.0/otterwiki/static/mathjax/ui/menu.js +1 -0
  179. otterwiki-2.2.0/otterwiki/static/mathjax/ui/safe.js +1 -0
  180. otterwiki-2.2.0/otterwiki/static/webfonts/fa-brands-400.eot +0 -0
  181. otterwiki-2.2.0/otterwiki/static/webfonts/fa-brands-400.svg +3717 -0
  182. otterwiki-2.2.0/otterwiki/static/webfonts/fa-brands-400.ttf +0 -0
  183. otterwiki-2.2.0/otterwiki/static/webfonts/fa-brands-400.woff +0 -0
  184. otterwiki-2.2.0/otterwiki/static/webfonts/fa-brands-400.woff2 +0 -0
  185. otterwiki-2.2.0/otterwiki/static/webfonts/fa-regular-400.eot +0 -0
  186. otterwiki-2.2.0/otterwiki/static/webfonts/fa-regular-400.svg +801 -0
  187. otterwiki-2.2.0/otterwiki/static/webfonts/fa-regular-400.ttf +0 -0
  188. otterwiki-2.2.0/otterwiki/static/webfonts/fa-regular-400.woff +0 -0
  189. otterwiki-2.2.0/otterwiki/static/webfonts/fa-regular-400.woff2 +0 -0
  190. otterwiki-2.2.0/otterwiki/static/webfonts/fa-solid-900.eot +0 -0
  191. otterwiki-2.2.0/otterwiki/static/webfonts/fa-solid-900.svg +5034 -0
  192. otterwiki-2.2.0/otterwiki/static/webfonts/fa-solid-900.ttf +0 -0
  193. otterwiki-2.2.0/otterwiki/static/webfonts/fa-solid-900.woff +0 -0
  194. otterwiki-2.2.0/otterwiki/static/webfonts/fa-solid-900.woff2 +0 -0
  195. otterwiki-2.2.0/otterwiki/static/webfonts/roboto-v29-latin-regular.eot +0 -0
  196. otterwiki-2.2.0/otterwiki/static/webfonts/roboto-v29-latin-regular.svg +308 -0
  197. otterwiki-2.2.0/otterwiki/static/webfonts/roboto-v29-latin-regular.ttf +0 -0
  198. otterwiki-2.2.0/otterwiki/static/webfonts/roboto-v29-latin-regular.woff +0 -0
  199. otterwiki-2.2.0/otterwiki/static/webfonts/roboto-v29-latin-regular.woff2 +0 -0
  200. otterwiki-2.2.0/otterwiki/templates/about.html +20 -0
  201. otterwiki-2.2.0/otterwiki/templates/admin.html +316 -0
  202. otterwiki-2.2.0/otterwiki/templates/admin_notification.txt +9 -0
  203. otterwiki-2.2.0/otterwiki/templates/approvement_notification.txt +7 -0
  204. otterwiki-2.2.0/otterwiki/templates/attachments.html +83 -0
  205. otterwiki-2.2.0/otterwiki/templates/blame.html +23 -0
  206. otterwiki-2.2.0/otterwiki/templates/changelog.html +87 -0
  207. otterwiki-2.2.0/otterwiki/templates/confirm_email.txt +7 -0
  208. otterwiki-2.2.0/otterwiki/templates/create.html +16 -0
  209. otterwiki-2.2.0/otterwiki/templates/delete.html +17 -0
  210. otterwiki-2.2.0/otterwiki/templates/diff.html +61 -0
  211. otterwiki-2.2.0/otterwiki/templates/edit_attachment.html +79 -0
  212. otterwiki-2.2.0/otterwiki/templates/editor.html +249 -0
  213. otterwiki-2.2.0/otterwiki/templates/example.html +65 -0
  214. otterwiki-2.2.0/otterwiki/templates/form.html +11 -0
  215. otterwiki-2.2.0/otterwiki/templates/help.html +46 -0
  216. otterwiki-2.2.0/otterwiki/templates/help_syntax.html +13 -0
  217. otterwiki-2.2.0/otterwiki/templates/history.html +82 -0
  218. otterwiki-2.2.0/otterwiki/templates/layout.html +240 -0
  219. otterwiki-2.2.0/otterwiki/templates/login.html +26 -0
  220. otterwiki-2.2.0/otterwiki/templates/lost_password.html +18 -0
  221. otterwiki-2.2.0/otterwiki/templates/page.html +75 -0
  222. otterwiki-2.2.0/otterwiki/templates/page404.html +6 -0
  223. otterwiki-2.2.0/otterwiki/templates/pageindex.html +40 -0
  224. otterwiki-2.2.0/otterwiki/templates/preview.html +85 -0
  225. otterwiki-2.2.0/otterwiki/templates/recover_password.txt +8 -0
  226. otterwiki-2.2.0/otterwiki/templates/register.html +27 -0
  227. otterwiki-2.2.0/otterwiki/templates/register.txt +9 -0
  228. otterwiki-2.2.0/otterwiki/templates/rename.html +25 -0
  229. otterwiki-2.2.0/otterwiki/templates/revert.html +15 -0
  230. otterwiki-2.2.0/otterwiki/templates/search.html +62 -0
  231. otterwiki-2.2.0/otterwiki/templates/settings.html +114 -0
  232. otterwiki-2.2.0/otterwiki/templates/snippets/menutree.html +37 -0
  233. otterwiki-2.2.0/otterwiki/templates/snippets/syntax.html +354 -0
  234. otterwiki-2.2.0/otterwiki/templates/snippets/toc.html +15 -0
  235. otterwiki-2.2.0/otterwiki/templates/source.html +5 -0
  236. otterwiki-2.2.0/otterwiki/templates/syntax.html +17 -0
  237. otterwiki-2.2.0/otterwiki/templates/user.html +59 -0
  238. otterwiki-2.2.0/otterwiki/templates/wiki.html +83 -0
  239. otterwiki-2.2.0/otterwiki/util.py +277 -0
  240. otterwiki-2.2.0/otterwiki/version.py +10 -0
  241. otterwiki-2.2.0/otterwiki/views.py +454 -0
  242. otterwiki-2.2.0/otterwiki/wiki.py +1409 -0
  243. otterwiki-2.2.0/otterwiki.egg-info/PKG-INFO +130 -0
  244. otterwiki-2.2.0/otterwiki.egg-info/SOURCES.txt +266 -0
  245. otterwiki-2.2.0/otterwiki.egg-info/dependency_links.txt +1 -0
  246. otterwiki-2.2.0/otterwiki.egg-info/requires.txt +23 -0
  247. otterwiki-2.2.0/otterwiki.egg-info/top_level.txt +1 -0
  248. otterwiki-2.2.0/pyproject.toml +96 -0
  249. otterwiki-2.2.0/screenshot.png +0 -0
  250. otterwiki-2.2.0/settings.cfg.skeleton +51 -0
  251. otterwiki-2.2.0/setup.cfg +4 -0
  252. otterwiki-2.2.0/setup.py +5 -0
  253. otterwiki-2.2.0/tbump.toml +31 -0
  254. otterwiki-2.2.0/tests/conftest.py +102 -0
  255. otterwiki-2.2.0/tests/example.md +64 -0
  256. otterwiki-2.2.0/tests/test_attachments.py +114 -0
  257. otterwiki-2.2.0/tests/test_auth.py +708 -0
  258. otterwiki-2.2.0/tests/test_essentials.py +29 -0
  259. otterwiki-2.2.0/tests/test_gitstorage.py +409 -0
  260. otterwiki-2.2.0/tests/test_helper.py +215 -0
  261. otterwiki-2.2.0/tests/test_image.png +0 -0
  262. otterwiki-2.2.0/tests/test_otterwiki.py +528 -0
  263. otterwiki-2.2.0/tests/test_preferences.py +197 -0
  264. otterwiki-2.2.0/tests/test_preview.py +95 -0
  265. otterwiki-2.2.0/tests/test_remote.py +159 -0
  266. otterwiki-2.2.0/tests/test_renderer.py +432 -0
  267. otterwiki-2.2.0/tests/test_settings.py +118 -0
  268. otterwiki-2.2.0/tests/test_util.py +202 -0
@@ -0,0 +1,6 @@
1
+ [run]
2
+ omit =
3
+ otterwiki/profiler.py
4
+
5
+ [html]
6
+ directory = coverage_html
@@ -0,0 +1,21 @@
1
+ venv/
2
+ env*
3
+ build/
4
+ *.pyc
5
+ *.egg-info/
6
+ dist/
7
+ settings.cfg
8
+ *.log*
9
+ otterwiki/__pycache__
10
+ repository
11
+ *.sqlite
12
+ .coverage
13
+ coverage_html
14
+ app-data*
15
+ settings.cfg
16
+ tmp
17
+ docker-compose.override.yml
18
+ .env
19
+ .flaskenv
20
+ .tox
21
+ .idea
@@ -0,0 +1,2 @@
1
+ Ralph Thesen <mail@redimp.de> Ralph Thesen <ralph.thesen@scai.fraunhofer.de>
2
+ Ralph Thesen <mail@redimp.de> Ralph Thesen <thesen@ins.uni-bonn.de>
@@ -0,0 +1,73 @@
1
+ #
2
+ # compile stage
3
+ #
4
+ FROM nginx:1.25.3 AS compile-stage
5
+ LABEL maintainer="Ralph Thesen <mail@redimp.de>"
6
+ # install python environment
7
+ RUN \
8
+ apt-get update -y && \
9
+ apt-get upgrade -y && \
10
+ apt-get install -y python3.11 python3.11-venv python3-pip \
11
+ libjpeg-dev zlib1g-dev
12
+ # prepare environment
13
+ RUN python3 -m venv /opt/venv
14
+ ENV PATH="/opt/venv/bin:$PATH"
15
+ # upgrade pip and install requirements not in otterwiki
16
+ RUN pip install -U pip wheel
17
+ # copy app
18
+ COPY . /app
19
+ WORKDIR /app
20
+ # install the otterwiki and its requirements
21
+ RUN pip install .
22
+ #
23
+ # test stage
24
+ #
25
+ FROM compile-stage AS test-stage
26
+ # install git (not needed for compiling)
27
+ RUN apt-get update -y && apt-get install -y --no-install-recommends git
28
+ # install the dev environment
29
+ RUN pip install '.[dev]'
30
+ # run tox (which builds a new environemnt and runs pytest)
31
+ RUN tox
32
+ # configure tox as default command when the test-stage is executed
33
+ CMD ["tox"]
34
+ #
35
+ # production stage
36
+ #
37
+ FROM nginx:1.25.3
38
+ # arg for marking dev images
39
+ ARG GIT_TAG
40
+ ENV GIT_TAG $GIT_TAG
41
+ # environment variables (I'm not sure if anyone ever would modify this)
42
+ ENV OTTERWIKI_SETTINGS=/app-data/settings.cfg
43
+ ENV OTTERWIKI_REPOSITORY=/app-data/repository
44
+ # install supervisord and python
45
+ RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && \
46
+ apt-get upgrade -y && \
47
+ apt-get install -y --no-install-recommends \
48
+ supervisor git \
49
+ python3.11 python3-wheel python3-venv libpython3.11 \
50
+ uwsgi uwsgi-plugin-python3 \
51
+ && rm -rf /var/lib/apt/lists/*
52
+ # copy virtual environment
53
+ COPY --from=compile-stage /opt/venv /opt/venv
54
+ # Make sure we use the virtualenv:
55
+ ENV PATH="/opt/venv/bin:$PATH"
56
+ # create directories
57
+ RUN mkdir -p /app-data /app/otterwiki
58
+ VOLUME /app-data
59
+ RUN chown -R www-data:www-data /app-data
60
+ # copy static files for nginx
61
+ COPY otterwiki/static /app/otterwiki/static
62
+ # copy supervisord configs (nginx is configured in the entrypoint.sh)
63
+ COPY docker/uwsgi.ini /app/uwsgi.ini
64
+ COPY docker/supervisord.conf /etc/supervisor/conf.d/
65
+ COPY --chmod=0755 docker/stop-supervisor.sh /etc/supervisor/
66
+ # Copy the entrypoint that will generate Nginx additional configs
67
+ COPY --chmod=0755 ./docker/entrypoint.sh /entrypoint.sh
68
+ # configure the entrypoint
69
+ ENTRYPOINT ["/entrypoint.sh"]
70
+ # and the default command: supervisor which takes care of nginx and uWSGI
71
+ CMD ["/usr/bin/supervisord"]
72
+
73
+ # vim:set et ts=8 sts=2 sw=2 ai fenc=utf-8:
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Ralph Thesen
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.
@@ -0,0 +1,4 @@
1
+ # include templates and static files in the package
2
+ recursive-include otterwiki/templates *
3
+ recursive-include otterwiki/static *
4
+ include otterwiki/*.md
@@ -0,0 +1,128 @@
1
+ #
2
+ #
3
+ # Makefile for developing and building An Otter Wiki
4
+ #
5
+ # Please read the Installation guide <https://otterwiki.com/Installation>
6
+ # to get started.
7
+ #
8
+ #
9
+ PORT ?= 8080
10
+ VERSION := $(shell python3 -c "with open('otterwiki/version.py') as f: exec(f.read()); print(__version__);")
11
+ VERSION_MAJOR_MINOR := $(shell python3 -c "with open('otterwiki/version.py') as f: exec(f.read()); print('.'.join(__version__.split('.')[0:2]));")
12
+ VERSION_MAJOR := $(shell python3 -c "with open('otterwiki/version.py') as f: exec(f.read()); print('.'.join(__version__.split('.')[0:1]));")
13
+ PLATFORM ?= "linux/arm64,linux/amd64,linux/arm/v7,linux/arm/v6"
14
+
15
+ all: run
16
+
17
+ .PHONY: clean coverage run debug shell sdist docker-build docker-test
18
+
19
+ clean:
20
+ rm -rf venv *.egg-info dist *.log* otterwiki/__pycache__ tests/__pycache__
21
+ rm -rf .pytest_cache .tox
22
+ rm -rf coverage_html
23
+
24
+ venv: pyproject.toml
25
+ rm -rf venv
26
+ python3 -m venv venv
27
+ venv/bin/pip install -U pip wheel
28
+ venv/bin/pip install -e '.[dev]'
29
+
30
+ run: venv settings.cfg
31
+ GIT_TAG=$(shell git describe --long) FLASK_APP=otterwiki.server OTTERWIKI_SETTINGS=$(PWD)/settings.cfg venv/bin/flask run --host 0.0.0.0 --port $(PORT)
32
+
33
+ debug: venv settings.cfg
34
+ FLASK_ENV=development FLASK_DEBUG=True FLASK_APP=otterwiki.server OTTERWIKI_SETTINGS=../settings.cfg venv/bin/flask run --port $(PORT)
35
+
36
+ profiler: venv settings.cfg
37
+ FLASK_DEBUG=True FLASK_APP=otterwiki.server OTTERWIKI_SETTINGS=../settings.cfg \
38
+ venv/bin/python otterwiki/profiler.py
39
+
40
+
41
+ shell: venv
42
+ FLASK_DEBUG=True FLASK_APP=otterwiki.server OTTERWIKI_SETTINGS=../settings.cfg venv/bin/flask shell
43
+
44
+ test: venv
45
+ OTTERWIKI_SETTINGS="" venv/bin/pytest tests
46
+
47
+ tox: venv
48
+ venv/bin/tox
49
+
50
+ venv/bin/coverage: venv
51
+ venv/bin/pip install coverage
52
+
53
+ coverage: venv venv/bin/coverage
54
+ OTTERWIKI_SETTINGS="" venv/bin/coverage run --source=otterwiki -m pytest tests
55
+ venv/bin/coverage report
56
+ venv/bin/coverage html -d coverage_html
57
+
58
+ black:
59
+ venv/bin/black setup.py otterwiki/ tests/
60
+
61
+ sdist: venv test
62
+ venv/bin/python setup.py sdist
63
+
64
+ settings.cfg:
65
+ @echo ""
66
+ @echo " Please create the settings.cfg. You find an example in the"
67
+ @echo " settings.cfg.skeleton"
68
+ @echo ""
69
+ @false
70
+
71
+ tmp/codemirror-5.65.15:
72
+ mkdir -p tmp && \
73
+ cd tmp && \
74
+ test -f codemirror.zip || wget https://codemirror.net/5/codemirror.zip && \
75
+ unzip codemirror.zip
76
+
77
+ otterwiki/static/js/cm-modes.min.js: tmp/codemirror-5.65.15
78
+ cat tmp/codemirror-5.65.15/addon/mode/simple.js > otterwiki/static/js/cm-modes.js
79
+ cat tmp/codemirror-5.65.15/mode/meta.js >> otterwiki/static/js/cm-modes.js
80
+ for MODE in shell clike xml python javascript markdown yaml php sql \
81
+ toml cmake perl http go rust dockerfile powershell properties \
82
+ stex nginx; do \
83
+ cat tmp/codemirror-5.65.15/mode/$$MODE/$$MODE.js \
84
+ >> otterwiki/static/js/cm-modes.js; \
85
+ done
86
+ ./venv/bin/python -m rjsmin -p < otterwiki/static/js/cm-modes.js > otterwiki/static/js/cm-modes.min.js
87
+
88
+ docker-test:
89
+ # make sure the image is rebuild
90
+ DOCKER_BUILDKIT=1 docker build --no-cache -t otterwiki:_test --target test-stage .
91
+
92
+ docker-run:
93
+ DOCKER_BUILDKIT=1 docker build -t otterwiki:_build .
94
+ docker run -p 8080:80 otterwiki:_build
95
+
96
+ docker-buildx-test:
97
+ ifeq ($(strip $(shell git rev-parse --abbrev-ref HEAD)),main)
98
+ docker buildx build --no-cache --platform $(PLATFORM) --target test-stage .
99
+ else
100
+ docker buildx build --no-cache --platform linux/arm64,linux/amd64 --target test-stage .
101
+ endif
102
+
103
+ docker-buildx-push: test
104
+ # check if we are in the main branch (to avoid accidently pushing a feature branch
105
+ ifeq ($(strip $(shell git rev-parse --abbrev-ref HEAD)),main)
106
+ # check if git is clean
107
+ ifneq ($(strip $(shell git status --porcelain)),)
108
+ $(error Error: Uncommitted changes in found)
109
+ endif
110
+ docker buildx build --platform $(PLATFORM) \
111
+ -t redimp/otterwiki:latest \
112
+ -t redimp/otterwiki:$(VERSION) \
113
+ -t redimp/otterwiki:$(VERSION_MAJOR) \
114
+ -t redimp/otterwiki:$(VERSION_MAJOR_MINOR) \
115
+ --build-arg GIT_TAG="$(shell git describe --long)" \
116
+ --push .
117
+ else
118
+ @echo ""
119
+ @echo "-- Building dev image"
120
+ @echo ""
121
+ docker buildx build --platform linux/arm64,linux/amd64 \
122
+ -t redimp/otterwiki:dev-$(shell git rev-parse --abbrev-ref HEAD) \
123
+ --build-arg GIT_TAG="$(shell git describe --long)_$(shell git rev-parse --abbrev-ref HEAD)" \
124
+ --push .
125
+ @echo ""
126
+ @echo "-- Done dev-image: redimp/otterwiki:dev-$(shell git rev-parse --abbrev-ref HEAD)"
127
+ @echo ""
128
+ endif
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.1
2
+ Name: otterwiki
3
+ Version: 2.2.0
4
+ Summary: An Otter Wiki is Python-based software for collaborative content management, called a wiki. The content is stored in a git repository, which keeps track of all changes. Markdown is used as markup language.
5
+ Author-email: Ralph Thesen <mail@redimp.de>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2022 Ralph Thesen
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: homepage, https://otterwiki.com
29
+ Project-URL: repository, https://github.com/redimp/otterwiki
30
+ Project-URL: issues, https://github.com/redimp/otterwiki/issues/
31
+ Project-URL: Demo, https://demo.otterwiki.com
32
+ Keywords: wiki,git,markdown
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
37
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki
38
+ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
39
+ Classifier: Topic :: Text Processing :: Markup
40
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
41
+ Classifier: Topic :: Software Development :: Version Control :: Git
42
+ Requires-Python: >=3.7
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: Werkzeug==3.0.1
46
+ Requires-Dist: Flask-Login==0.6.3
47
+ Requires-Dist: Flask-Mail==0.9.1
48
+ Requires-Dist: SQLAlchemy==2.0.27
49
+ Requires-Dist: Flask-SQLAlchemy==3.1.1
50
+ Requires-Dist: Flask==3.0.2
51
+ Requires-Dist: Jinja2==3.1.3
52
+ Requires-Dist: gitpython==3.1.42
53
+ Requires-Dist: cython==3.0.8
54
+ Requires-Dist: mistune==2.0.5
55
+ Requires-Dist: pygments==2.17.2
56
+ Requires-Dist: Pillow==10.2.0
57
+ Requires-Dist: unidiff==0.7.5
58
+ Requires-Dist: flask-htmlmin==2.2.1
59
+ Requires-Dist: beautifulsoup4==4.12.3
60
+ Provides-Extra: dev
61
+ Requires-Dist: coverage; extra == "dev"
62
+ Requires-Dist: pytest; extra == "dev"
63
+ Requires-Dist: black; extra == "dev"
64
+ Requires-Dist: tox; extra == "dev"
65
+ Requires-Dist: tbump; extra == "dev"
66
+ Requires-Dist: rjsmin; extra == "dev"
67
+
68
+ ![](screenshot.png)
69
+
70
+ # An Otter Wiki
71
+
72
+ An Otter Wiki is Python-based software for collaborative content
73
+ management, called a [wiki](https://en.wikipedia.org/wiki/Wiki). The
74
+ content is stored in a git repository, which keeps track of all changes.
75
+ [Markdown](https://daringfireball.net/projects/markdown) is used as
76
+ Markup language. An Otter Wiki is written in [python](https://www.python.org/)
77
+ using the microframework [Flask](http://flask.pocoo.org/).
78
+ [halfmoon](https://www.gethalfmoon.com) is used as CSS framework
79
+ and [CodeMirror](https://codemirror.net/) as editor.
80
+ [Font Awesome Free](https://fontawesome.com/license/free) serves the icons.
81
+
82
+ ## Notable Features
83
+
84
+ - Minimalistic interface (with dark-mode)
85
+ - Editor with markdown highlighting and support including tables
86
+ - Full changelog and page history
87
+ - User authentication
88
+ - Page Attachments
89
+ - A very cute Otter as logo (drawn by [Christy Presler](http://christypresler.com/) CC BY 3.0).
90
+
91
+ ## Demo
92
+
93
+ Check out the demo <https://demo.otterwiki.com>.
94
+
95
+ ## Installation
96
+
97
+ Read the [installation guide](https://otterwiki.com/Installation) to get
98
+ started. Recommended is the installation with `docker-compose`.
99
+
100
+ ### Quick start with docker-compose
101
+
102
+ 1. Copy and edit the `docker-compose.yml` below to match your preferences.
103
+ 2. Run `docker-compose up -d`
104
+ 3. Access the wiki via http://127.0.0.1:8080 if run on your machine.
105
+ 4. If the wiki shall be accessible via the internet and an domain name make sure to configure your web server accordingly. Check the [installation guide](https://otterwiki.com/Installation#reverse-proxy) for example configurations for nginx, apache and caddy.
106
+ 5. Register your account. The first account is an admin-account giving you access to the settings tab.
107
+ 6. Customize the settings to your liking.
108
+
109
+ Proceed for the [configuration guide](https://otterwiki.com/Configuration) for
110
+ detailed information.
111
+
112
+ #### docker-compose.yml
113
+
114
+ ```yaml
115
+ version: '3'
116
+ services:
117
+ otterwiki:
118
+ image: redimp/otterwiki:2
119
+ restart: unless-stopped
120
+ ports:
121
+ - 8080:80
122
+ volumes:
123
+ - ./app-data:/app-data
124
+ ```
125
+
126
+ ## License
127
+
128
+ An Otter Wiki is open-source software licensed under the [MIT License](https://github.com/redimp/otterwiki/blob/main/LICENSE).
129
+
130
+ [modeline]: # ( vim: set fenc=utf-8 spell spl=en sts=4 et tw=72: )
@@ -0,0 +1,63 @@
1
+ ![](screenshot.png)
2
+
3
+ # An Otter Wiki
4
+
5
+ An Otter Wiki is Python-based software for collaborative content
6
+ management, called a [wiki](https://en.wikipedia.org/wiki/Wiki). The
7
+ content is stored in a git repository, which keeps track of all changes.
8
+ [Markdown](https://daringfireball.net/projects/markdown) is used as
9
+ Markup language. An Otter Wiki is written in [python](https://www.python.org/)
10
+ using the microframework [Flask](http://flask.pocoo.org/).
11
+ [halfmoon](https://www.gethalfmoon.com) is used as CSS framework
12
+ and [CodeMirror](https://codemirror.net/) as editor.
13
+ [Font Awesome Free](https://fontawesome.com/license/free) serves the icons.
14
+
15
+ ## Notable Features
16
+
17
+ - Minimalistic interface (with dark-mode)
18
+ - Editor with markdown highlighting and support including tables
19
+ - Full changelog and page history
20
+ - User authentication
21
+ - Page Attachments
22
+ - A very cute Otter as logo (drawn by [Christy Presler](http://christypresler.com/) CC BY 3.0).
23
+
24
+ ## Demo
25
+
26
+ Check out the demo <https://demo.otterwiki.com>.
27
+
28
+ ## Installation
29
+
30
+ Read the [installation guide](https://otterwiki.com/Installation) to get
31
+ started. Recommended is the installation with `docker-compose`.
32
+
33
+ ### Quick start with docker-compose
34
+
35
+ 1. Copy and edit the `docker-compose.yml` below to match your preferences.
36
+ 2. Run `docker-compose up -d`
37
+ 3. Access the wiki via http://127.0.0.1:8080 if run on your machine.
38
+ 4. If the wiki shall be accessible via the internet and an domain name make sure to configure your web server accordingly. Check the [installation guide](https://otterwiki.com/Installation#reverse-proxy) for example configurations for nginx, apache and caddy.
39
+ 5. Register your account. The first account is an admin-account giving you access to the settings tab.
40
+ 6. Customize the settings to your liking.
41
+
42
+ Proceed for the [configuration guide](https://otterwiki.com/Configuration) for
43
+ detailed information.
44
+
45
+ #### docker-compose.yml
46
+
47
+ ```yaml
48
+ version: '3'
49
+ services:
50
+ otterwiki:
51
+ image: redimp/otterwiki:2
52
+ restart: unless-stopped
53
+ ports:
54
+ - 8080:80
55
+ volumes:
56
+ - ./app-data:/app-data
57
+ ```
58
+
59
+ ## License
60
+
61
+ An Otter Wiki is open-source software licensed under the [MIT License](https://github.com/redimp/otterwiki/blob/main/LICENSE).
62
+
63
+ [modeline]: # ( vim: set fenc=utf-8 spell spl=en sts=4 et tw=72: )
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ # vim:set et ts=8 sts=4 sw=4 ai fenc=utf-8:
3
+
4
+ set -e
5
+
6
+ # take care of repository dictionary
7
+ if [ ! -d ${OTTERWIKI_REPOSITORY} ]; then
8
+ mkdir -p ${OTTERWIKI_REPOSITORY}
9
+ fi
10
+
11
+ if [ ! -d ${OTTERWIKI_REPOSITORY}/.git ]; then
12
+ git init ${OTTERWIKI_REPOSITORY}
13
+ fi
14
+
15
+ # take care of the otterwiki settings file
16
+ if [ ! -f ${OTTERWIKI_SETTINGS} ]; then
17
+ RANDOM_SECRET_KEY=$(echo $RANDOM | md5sum | head -c 16)
18
+ echo "DEBUG = False" >> ${OTTERWIKI_SETTINGS}
19
+ echo "REPOSITORY = '/app-data/repository'" >> ${OTTERWIKI_SETTINGS}
20
+ echo "SECRET_KEY = '${RANDOM_SECRET_KEY}'" >> ${OTTERWIKI_SETTINGS}
21
+ echo "SQLALCHEMY_DATABASE_URI = 'sqlite:////app-data/db.sqlite'" >> ${OTTERWIKI_SETTINGS}
22
+ fi
23
+
24
+ # handle environment variables
25
+ # branding
26
+ for EV in SITE_NAME SITE_LOGO SITE_DESCRIPTION SITE_ICON; do
27
+ if [ ! -z "${!EV}" ]; then
28
+ sed -i "/^${EV}.*/d" ${OTTERWIKI_SETTINGS}
29
+ echo "${EV} = '${!EV}'" >> ${OTTERWIKI_SETTINGS}
30
+ fi
31
+ done
32
+ # permissions
33
+ for EV in READ_ACCESS WRITE_ACCESS ATTACHMENT_ACCESS; do
34
+ if [ ! -z "${!EV}" ]; then
35
+ sed -i "/^${EV}.*/d" ${OTTERWIKI_SETTINGS}
36
+ echo "${EV} = '${!EV}'" >> ${OTTERWIKI_SETTINGS}
37
+ fi
38
+ done
39
+ for EV in AUTO_APPROVAL EMAIL_NEEDS_CONFIRMATION RETAIN_PAGE_NAME_CASE GIT_WEB_SERVER; do
40
+ if [ ! -z "${!EV}" ]; then
41
+ sed -i "/^${EV}.*/d" ${OTTERWIKI_SETTINGS}
42
+ echo "${EV} = ${!EV}" >> ${OTTERWIKI_SETTINGS}
43
+ fi
44
+ done
45
+ # mail
46
+ for EV in MAIL_SERVER MAIL_USERNAME MAIL_PASSWORD MAIL_DEFAULT_SENDER; do
47
+ if [ ! -z "${!EV}" ]; then
48
+ sed -i "/^${EV}.*/d" ${OTTERWIKI_SETTINGS}
49
+ echo "${EV} = '${!EV}'" >> ${OTTERWIKI_SETTINGS}
50
+ fi
51
+ done
52
+ for EV in MAIL_PORT MAIL_USE_TLS MAIL_USE_SSL; do
53
+ if [ ! -z "${!EV}" ]; then
54
+ sed -i "/^${EV}.*/d" ${OTTERWIKI_SETTINGS}
55
+ echo "${EV} = ${!EV}" >> ${OTTERWIKI_SETTINGS}
56
+ fi
57
+ done
58
+
59
+ chown -R www-data:www-data /app-data
60
+
61
+ # Get the maximum upload file size for Nginx, default to 0: unlimited
62
+ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
63
+ # Get the number of workers for Nginx, default to 1
64
+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
65
+ # Modify the number of worker processes in Nginx config
66
+ sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf
67
+
68
+ # Get the URL for static files from the environment variable
69
+ USE_STATIC_URL=${STATIC_URL:-'/static'}
70
+ # Get the absolute path of the static files from the environment variable
71
+ USE_STATIC_PATH=${STATIC_PATH:-'/app/otterwiki/static'}
72
+ # Get the listen port for Nginx, default to 80
73
+ USE_LISTEN_PORT=${LISTEN_PORT:-80}
74
+
75
+ # Generate Nginx config first part using the environment variables
76
+ echo "server {
77
+ listen ${USE_LISTEN_PORT};
78
+ client_max_body_size $USE_NGINX_MAX_UPLOAD;
79
+ " > /etc/nginx/conf.d/default.conf
80
+
81
+ if [ ! -z "${REAL_IP_FROM}" ]; then
82
+ echo " set_real_ip_from $REAL_IP_FROM;
83
+ real_ip_header X-Real-IP;
84
+ real_ip_recursive on;" >> /etc/nginx/conf.d/nginx.conf
85
+ fi
86
+
87
+
88
+ echo " location / {
89
+ try_files \$uri @app;
90
+ }
91
+ location @app {
92
+ include uwsgi_params;
93
+ uwsgi_pass unix:///tmp/uwsgi.sock;
94
+ }
95
+ location $USE_STATIC_URL {
96
+ alias $USE_STATIC_PATH;
97
+ }" >> /etc/nginx/conf.d/default.conf
98
+
99
+ # close the server block
100
+ echo "}" >> /etc/nginx/conf.d/default.conf
101
+
102
+ exec "$@"
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env sh
2
+ # https://serverfault.com/a/922943
3
+ printf "READY\n";
4
+
5
+ while read line; do
6
+ echo "Processing Event: $line" >&2;
7
+ kill $PPID
8
+ done < /dev/stdin
@@ -0,0 +1,27 @@
1
+ [supervisord]
2
+ nodaemon=true
3
+ user=root
4
+
5
+ [program:uwsgi]
6
+ command=/usr/bin/uwsgi_python3 --ini /app/uwsgi.ini --venv /opt/venv
7
+ stdout_logfile=/dev/stdout
8
+ stdout_logfile_maxbytes=0
9
+ stderr_logfile=/dev/stderr
10
+ stderr_logfile_maxbytes=0
11
+ startsecs=0
12
+ autorestart=false
13
+
14
+ [program:nginx]
15
+ command=/usr/sbin/nginx -g 'daemon off;'
16
+ stdout_logfile=/dev/stdout
17
+ stdout_logfile_maxbytes=0
18
+ stderr_logfile=/dev/stderr
19
+ stderr_logfile_maxbytes=0
20
+ # Graceful stop would be QUIT, see http://nginx.org/en/docs/control.html
21
+ stopsignal=TERM
22
+ startsecs=0
23
+ autorestart=false
24
+
25
+ [eventlistener:quit_on_failure]
26
+ events=PROCESS_STATE_STOPPED,PROCESS_STATE_EXITED,PROCESS_STATE_FATAL
27
+ command=/etc/supervisor/stop-supervisor.sh
@@ -0,0 +1,36 @@
1
+ [uwsgi]
2
+ module = otterwiki.server
3
+ callable = app
4
+ # socket configuration
5
+ socket = /tmp/uwsgi.sock
6
+ pidfile = /tmp/uwsgi.pid
7
+ chdir = /app
8
+ chown-socket = nginx:nginx
9
+ chmod-socket = 664
10
+ # Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386
11
+ hook-master-start = unix_signal:15 gracefully_kill_them_all
12
+ need-app = true
13
+ die-on-term = true
14
+ # we run a single app
15
+ single-interpreter = true
16
+ # For debugging and testing
17
+ show-config = true
18
+ vacuum = true
19
+ # fixing WARNING: you are running uWSGI without its master process manager
20
+ master = true
21
+ uid = www-data
22
+ gid = www-data
23
+ # wsgi.file_wrapper is an optimization of the WSGI standard. In some
24
+ # corner case it can raise an error. For example when returning an
25
+ # in-memory bytes buffer (io.Bytesio) in Python 3.5.
26
+ # see https://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html
27
+ wsgi-disable-file-wrapper = true
28
+ # enable threads, which are disabled by default
29
+ # see https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html#a-note-on-python-threads
30
+ enable-threads = true
31
+ # disable logs
32
+ disable-logging = true
33
+ # close the uwsgi processes quicker, when hitting Ctrl-C
34
+ reload-mercy = 5
35
+ worker-reload-mercy = 5
36
+ env=HOME=/app-data