itsi 0.1.18 → 0.1.20

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 (394) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Cargo.lock +924 -385
  4. data/README.md +67 -55
  5. data/crates/itsi_server/Cargo.toml +7 -4
  6. data/crates/itsi_server/src/ruby_types/itsi_http_request.rs +2 -2
  7. data/crates/itsi_server/src/ruby_types/itsi_server/itsi_server_config.rs +150 -19
  8. data/crates/itsi_server/src/ruby_types/itsi_server.rs +1 -0
  9. data/crates/itsi_server/src/server/binds/listener.rs +34 -29
  10. data/crates/itsi_server/src/server/binds/tls/locked_dir_cache.rs +2 -2
  11. data/crates/itsi_server/src/server/binds/tls.rs +1 -1
  12. data/crates/itsi_server/src/server/middleware_stack/middleware.rs +33 -28
  13. data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_jwt.rs +56 -3
  14. data/crates/itsi_server/src/server/middleware_stack/middlewares/csp.rs +179 -0
  15. data/crates/itsi_server/src/server/middleware_stack/middlewares/mod.rs +25 -2
  16. data/crates/itsi_server/src/server/middleware_stack/middlewares/ruby_app.rs +3 -3
  17. data/crates/itsi_server/src/server/middleware_stack/middlewares/static_assets.rs +2 -1
  18. data/crates/itsi_server/src/server/middleware_stack/mod.rs +32 -34
  19. data/crates/itsi_server/src/server/serve_strategy/cluster_mode.rs +10 -4
  20. data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +30 -7
  21. data/crates/itsi_server/src/server/thread_worker.rs +2 -2
  22. data/crates/itsi_server/src/services/static_file_server.rs +30 -28
  23. data/crates/itsi_tracing/src/lib.rs +39 -8
  24. data/docker/Dockerfile +12 -0
  25. data/docs/content/_index.md +18 -10
  26. data/docs/content/acknowledgements/_index.md +43 -0
  27. data/docs/content/configuration/_index.md +98 -0
  28. data/docs/content/contact/_index.md +7 -0
  29. data/docs/content/faqs/_index.md +27 -0
  30. data/docs/content/features/_index.md +285 -0
  31. data/docs/content/getting_started/_index.md +70 -0
  32. data/docs/content/getting_started/local_development.md +40 -0
  33. data/docs/content/getting_started/logging.md +16 -0
  34. data/docs/content/getting_started/running_itsi_in_production.md +24 -0
  35. data/docs/content/itsi-server-100.png +0 -0
  36. data/docs/content/itsi_scheduler/_index.md +105 -0
  37. data/docs/content/itsi_scheduler/itsi-scheduler-100.png +0 -0
  38. data/docs/content/ruby-lsp.png +0 -0
  39. data/docs/content/ruby.svg +948 -0
  40. data/docs/data/icons.yaml +949 -0
  41. data/docs/hugo.yaml +27 -28
  42. data/fairytale.txt +34 -0
  43. data/gems/scheduler/Cargo.lock +46 -46
  44. data/gems/scheduler/README.md +53 -24
  45. data/gems/scheduler/itsi-scheduler-100.png +0 -0
  46. data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
  47. data/gems/server/Cargo.lock +932 -382
  48. data/gems/server/README.md +2 -0
  49. data/gems/server/exe/itsi +5 -5
  50. data/gems/server/lib/itsi/http_request.rb +1 -0
  51. data/gems/server/lib/itsi/server/config/config_helpers.rb +93 -0
  52. data/gems/server/lib/itsi/server/config/dsl.rb +98 -37
  53. data/gems/server/lib/itsi/server/config/known_paths/KitchensinkDirectories.txt +2346 -0
  54. data/gems/server/lib/itsi/server/config/known_paths/Randomfiles.txt +24 -0
  55. data/gems/server/lib/itsi/server/config/known_paths/UnixDotfiles.txt +52 -0
  56. data/gems/server/lib/itsi/server/config/known_paths/backdoors/ASP_CommonBackdoors.txt +29 -0
  57. data/gems/server/lib/itsi/server/config/known_paths/backdoors/bot_control_panels.txt +1668 -0
  58. data/gems/server/lib/itsi/server/config/known_paths/backdoors/shells.txt +1167 -0
  59. data/gems/server/lib/itsi/server/config/known_paths/cgi/CGI_HTTP_POST.txt +7 -0
  60. data/gems/server/lib/itsi/server/config/known_paths/cgi/CGI_HTTP_POST_Windows.txt +6 -0
  61. data/gems/server/lib/itsi/server/config/known_paths/cgi/CGI_Microsoft.txt +79 -0
  62. data/gems/server/lib/itsi/server/config/known_paths/cgi/CGI_XPlatform.txt +3948 -0
  63. data/gems/server/lib/itsi/server/config/known_paths/cms/README.md +5 -0
  64. data/gems/server/lib/itsi/server/config/known_paths/cms/drupal_plugins.txt +6320 -0
  65. data/gems/server/lib/itsi/server/config/known_paths/cms/drupal_themes.txt +828 -0
  66. data/gems/server/lib/itsi/server/config/known_paths/cms/joomla_plugins.txt +224 -0
  67. data/gems/server/lib/itsi/server/config/known_paths/cms/joomla_themes.txt +30 -0
  68. data/gems/server/lib/itsi/server/config/known_paths/cms/php-nuke.txt +2142 -0
  69. data/gems/server/lib/itsi/server/config/known_paths/cms/wordpress.txt +1566 -0
  70. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_common_theme_files.txt +46 -0
  71. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_plugins.txt +13366 -0
  72. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_plugins_full.txt +68662 -0
  73. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_plugins_top225.txt +225 -0
  74. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_themes.readme +12 -0
  75. data/gems/server/lib/itsi/server/config/known_paths/cms/wp_themes.txt +7336 -0
  76. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/3CharExtBrute.txt +17576 -0
  77. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/CommonWebExtensions.txt +80 -0
  78. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/Extensions.Backup.txt +14 -0
  79. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/Extensions.Common.txt +865 -0
  80. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/Extensions.Compressed.txt +186 -0
  81. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/Extensions.Mostcommon.txt +30 -0
  82. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/Extensions.Skipfish.txt +93 -0
  83. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/WordlistSkipfish.txt +1918 -0
  84. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/copy_of.txt +8 -0
  85. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-directories-lowercase.txt +56180 -0
  86. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-directories.txt +62290 -0
  87. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-extensions-lowercase.txt +2367 -0
  88. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-extensions.txt +2450 -0
  89. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-files-lowercase.txt +35323 -0
  90. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-files.txt +37037 -0
  91. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-words-lowercase.txt +107982 -0
  92. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-large-words.txt +119600 -0
  93. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-directories-lowercase.txt +26593 -0
  94. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-directories.txt +30009 -0
  95. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-extensions-lowercase.txt +1233 -0
  96. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-extensions.txt +1289 -0
  97. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-files-lowercase.txt +16243 -0
  98. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-files.txt +17128 -0
  99. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-words-lowercase.txt +56293 -0
  100. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-medium-words.txt +63087 -0
  101. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-directories-lowercase.txt +17776 -0
  102. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-directories.txt +20122 -0
  103. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-extensions-lowercase.txt +914 -0
  104. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-extensions.txt +963 -0
  105. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-files-lowercase.txt +10848 -0
  106. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-files.txt +11424 -0
  107. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-words-lowercase.txt +38267 -0
  108. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/raft-small-words.txt +43003 -0
  109. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/spanish.txt +445 -0
  110. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/test_demo.txt +36 -0
  111. data/gems/server/lib/itsi/server/config/known_paths/filename-dirname-bruteforce/upload_variants.txt +44 -0
  112. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/Logins.txt +71 -0
  113. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/cfm.txt +294 -0
  114. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/html.txt +295 -0
  115. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/jsp.txt +294 -0
  116. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/php.txt +294 -0
  117. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/windows-asp.txt +294 -0
  118. data/gems/server/lib/itsi/server/config/known_paths/login-file-locations/windows-aspx.txt +294 -0
  119. data/gems/server/lib/itsi/server/config/known_paths/password-file-locations/Passwords.txt +47 -0
  120. data/gems/server/lib/itsi/server/config/known_paths/php/PHP.txt +30 -0
  121. data/gems/server/lib/itsi/server/config/known_paths/php/PHP_CommonBackdoors.txt +5 -0
  122. data/gems/server/lib/itsi/server/config/known_paths/proxy-conf.txt +31 -0
  123. data/gems/server/lib/itsi/server/config/known_paths/tftp.txt +79 -0
  124. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/ADFS.txt +86 -0
  125. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/AdobeXML.txt +16 -0
  126. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Apache.txt +101 -0
  127. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/ApacheTomcat.txt +47 -0
  128. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Apache_Axis.txt +16 -0
  129. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/ColdFusion.txt +111 -0
  130. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/FatwireCMS.txt +390 -0
  131. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Frontpage.txt +38 -0
  132. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/HP_System_Mgmt_Homepage.txt +239 -0
  133. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/HTTP_POST_Microsoft.txt +2 -0
  134. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Hyperion.txt +578 -0
  135. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/IIS.txt +187 -0
  136. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/JBoss.txt +5 -0
  137. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/JRun.txt +13 -0
  138. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/JavaServlets_Common.txt +3 -0
  139. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Joomla_exploitable.txt +1937 -0
  140. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/LotusNotes.txt +206 -0
  141. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Netware.txt +18 -0
  142. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Oracle9i.txt +60 -0
  143. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/OracleAppServer.txt +192 -0
  144. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/README.md +6 -0
  145. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Ruby_Rails.txt +121 -0
  146. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/SAP.txt +463 -0
  147. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Sharepoint.txt +1707 -0
  148. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/SiteMinder.txt +19 -0
  149. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/SunAppServerGlassfish.txt +51 -0
  150. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/SuniPlanet.txt +35 -0
  151. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Vignette.txt +73 -0
  152. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Weblogic.txt +160 -0
  153. data/gems/server/lib/itsi/server/config/known_paths/webservers-appservers/Websphere.txt +366 -0
  154. data/gems/server/lib/itsi/server/config/known_paths/wellknown-rfc5785.txt +30 -0
  155. data/gems/server/lib/itsi/server/config/known_paths.rb +17 -0
  156. data/gems/server/lib/itsi/server/config/middleware/_index.md +54 -0
  157. data/gems/server/lib/itsi/server/config/middleware/log_requests.md +63 -0
  158. data/gems/server/lib/itsi/server/config/middleware/log_requests.rb +33 -0
  159. data/gems/server/lib/itsi/server/config/middleware.rb +9 -0
  160. data/gems/server/lib/itsi/server/config/option.rb +9 -0
  161. data/gems/server/lib/itsi/server/config/options/_index.md +36 -0
  162. data/gems/server/lib/itsi/server/config/options/fiber_scheduler.md +35 -0
  163. data/gems/server/lib/itsi/server/config/options/fiber_scheduler.rb +18 -0
  164. data/gems/server/lib/itsi/server/config/options/threads.md +39 -0
  165. data/gems/server/lib/itsi/server/config/options/threads.rb +17 -0
  166. data/gems/server/lib/itsi/server/config/options/workers.md +43 -0
  167. data/gems/server/lib/itsi/server/config/options/workers.rb +17 -0
  168. data/gems/server/lib/itsi/server/config/typed_struct.rb +203 -0
  169. data/gems/server/lib/itsi/server/config.rb +124 -30
  170. data/gems/server/lib/itsi/server/signal_trap.rb +5 -1
  171. data/gems/server/lib/itsi/server/typed_handlers/source_parser.rb +1 -1
  172. data/gems/server/lib/itsi/server/version.rb +1 -1
  173. data/gems/server/lib/itsi/server.rb +27 -6
  174. data/gems/server/lib/ruby_lsp/itsi/addon.rb +64 -48
  175. data/gems/server/test/helpers/test_helper.rb +64 -5
  176. data/gems/server/test/middleware/test_log_requests.rb +17 -0
  177. data/gems/server/test/options/test_threads.rb +15 -0
  178. data/gems/server/test/options/test_workers.rb +18 -0
  179. data/gems/server/test/test_itsi_server.rb +81 -94
  180. data/itsi-scheduler-100.png +0 -0
  181. data/itsi-server-100.png +0 -0
  182. data/lib/itsi/version.rb +1 -1
  183. data/tasks.txt +36 -28
  184. metadata +147 -215
  185. data/crates/_index.md +0 -0
  186. data/crates/itsi_server/src/ruby_types/README.md +0 -21
  187. data/crates/itsi_server/test.md +0 -14
  188. data/docs/Itsi.rb +0 -17
  189. data/docs/content/about.md +0 -6
  190. data/docs/content/docs/_index.md +0 -18
  191. data/docs/content/docs/first-page.md +0 -9
  192. data/docs/content/docs/folder/_index.md +0 -10
  193. data/docs/content/docs/folder/leaf.md +0 -7
  194. data/foo/Itsi.rb +0 -122
  195. data/gems/_index.md +0 -18
  196. data/gems/scheduler/CHANGELOG.md +0 -5
  197. data/gems/scheduler/CODE_OF_CONDUCT.md +0 -139
  198. data/gems/scheduler/LICENSE.txt +0 -21
  199. data/gems/scheduler/_index.md +0 -7
  200. data/gems/server/CHANGELOG.md +0 -10
  201. data/gems/server/CODE_OF_CONDUCT.md +0 -139
  202. data/gems/server/LICENSE.txt +0 -21
  203. data/gems/server/_index.md +0 -6
  204. data/sandbox/README.md +0 -5
  205. data/sandbox/deploy/main.tf +0 -238
  206. data/sandbox/deploy/outputs.tf +0 -4
  207. data/sandbox/deploy/vars.tf +0 -11
  208. data/sandbox/falcon_benchmark/Gemfile +0 -10
  209. data/sandbox/falcon_benchmark/Gemfile.lock +0 -140
  210. data/sandbox/falcon_benchmark/config.ru +0 -54
  211. data/sandbox/itsi_file/Gemfile +0 -13
  212. data/sandbox/itsi_file/Gemfile.lock +0 -111
  213. data/sandbox/itsi_file/Itsi.rb +0 -473
  214. data/sandbox/itsi_file/call.json +0 -1
  215. data/sandbox/itsi_file/echo_client/Gemfile +0 -10
  216. data/sandbox/itsi_file/echo_client/Gemfile.lock +0 -27
  217. data/sandbox/itsi_file/echo_client/README.md +0 -95
  218. data/sandbox/itsi_file/echo_client/echo_client.rb +0 -164
  219. data/sandbox/itsi_file/echo_client/gen_proto.sh +0 -17
  220. data/sandbox/itsi_file/echo_client/lib/echo_pb.rb +0 -16
  221. data/sandbox/itsi_file/echo_client/lib/echo_services_pb.rb +0 -29
  222. data/sandbox/itsi_file/echo_client/run_client.rb +0 -64
  223. data/sandbox/itsi_file/echo_client/test_compressions.sh +0 -20
  224. data/sandbox/itsi_file/echo_service_nonitsi/Gemfile +0 -10
  225. data/sandbox/itsi_file/echo_service_nonitsi/Gemfile.lock +0 -79
  226. data/sandbox/itsi_file/echo_service_nonitsi/echo.proto +0 -26
  227. data/sandbox/itsi_file/echo_service_nonitsi/echo_pb.rb +0 -16
  228. data/sandbox/itsi_file/echo_service_nonitsi/echo_services_pb.rb +0 -29
  229. data/sandbox/itsi_file/echo_service_nonitsi/server.rb +0 -52
  230. data/sandbox/itsi_file/error.html +0 -2
  231. data/sandbox/itsi_file/organisations_controller.rb +0 -20
  232. data/sandbox/itsi_file/public/assets/image.png +0 -0
  233. data/sandbox/itsi_sandbox_async/Gemfile +0 -10
  234. data/sandbox/itsi_sandbox_async/Gemfile.lock +0 -69
  235. data/sandbox/itsi_sandbox_async/config.ru +0 -9
  236. data/sandbox/itsi_sandbox_hanami/.env +0 -2
  237. data/sandbox/itsi_sandbox_hanami/.gitignore +0 -6
  238. data/sandbox/itsi_sandbox_hanami/.rspec +0 -1
  239. data/sandbox/itsi_sandbox_hanami/Gemfile +0 -49
  240. data/sandbox/itsi_sandbox_hanami/Gemfile.lock +0 -440
  241. data/sandbox/itsi_sandbox_hanami/Guardfile +0 -9
  242. data/sandbox/itsi_sandbox_hanami/Procfile.dev +0 -2
  243. data/sandbox/itsi_sandbox_hanami/README.md +0 -1
  244. data/sandbox/itsi_sandbox_hanami/Rakefile +0 -3
  245. data/sandbox/itsi_sandbox_hanami/app/action.rb +0 -12
  246. data/sandbox/itsi_sandbox_hanami/app/actions/.keep +0 -0
  247. data/sandbox/itsi_sandbox_hanami/app/assets/css/app.css +0 -5
  248. data/sandbox/itsi_sandbox_hanami/app/assets/images/favicon.ico +0 -0
  249. data/sandbox/itsi_sandbox_hanami/app/assets/js/app.js +0 -1
  250. data/sandbox/itsi_sandbox_hanami/app/db/relation.rb +0 -10
  251. data/sandbox/itsi_sandbox_hanami/app/db/repo.rb +0 -10
  252. data/sandbox/itsi_sandbox_hanami/app/db/struct.rb +0 -10
  253. data/sandbox/itsi_sandbox_hanami/app/operation.rb +0 -9
  254. data/sandbox/itsi_sandbox_hanami/app/relations/.keep +0 -0
  255. data/sandbox/itsi_sandbox_hanami/app/repos/.keep +0 -0
  256. data/sandbox/itsi_sandbox_hanami/app/structs/.keep +0 -0
  257. data/sandbox/itsi_sandbox_hanami/app/templates/layouts/app.html.erb +0 -14
  258. data/sandbox/itsi_sandbox_hanami/app/view.rb +0 -9
  259. data/sandbox/itsi_sandbox_hanami/app/views/helpers.rb +0 -10
  260. data/sandbox/itsi_sandbox_hanami/bin/dev +0 -8
  261. data/sandbox/itsi_sandbox_hanami/config/app.rb +0 -8
  262. data/sandbox/itsi_sandbox_hanami/config/assets.js +0 -16
  263. data/sandbox/itsi_sandbox_hanami/config/db/migrate/.keep +0 -0
  264. data/sandbox/itsi_sandbox_hanami/config/db/seeds.rb +0 -15
  265. data/sandbox/itsi_sandbox_hanami/config/puma.rb +0 -47
  266. data/sandbox/itsi_sandbox_hanami/config/routes.rb +0 -7
  267. data/sandbox/itsi_sandbox_hanami/config/settings.rb +0 -9
  268. data/sandbox/itsi_sandbox_hanami/config.ru +0 -5
  269. data/sandbox/itsi_sandbox_hanami/db/.keep +0 -0
  270. data/sandbox/itsi_sandbox_hanami/lib/itsi_hanami/types.rb +0 -11
  271. data/sandbox/itsi_sandbox_hanami/lib/tasks/.keep +0 -0
  272. data/sandbox/itsi_sandbox_hanami/package-lock.json +0 -946
  273. data/sandbox/itsi_sandbox_hanami/package.json +0 -8
  274. data/sandbox/itsi_sandbox_hanami/spec/requests/root_spec.rb +0 -11
  275. data/sandbox/itsi_sandbox_hanami/spec/spec_helper.rb +0 -9
  276. data/sandbox/itsi_sandbox_hanami/spec/support/db/cleaning.rb +0 -42
  277. data/sandbox/itsi_sandbox_hanami/spec/support/db.rb +0 -10
  278. data/sandbox/itsi_sandbox_hanami/spec/support/features.rb +0 -5
  279. data/sandbox/itsi_sandbox_hanami/spec/support/operations.rb +0 -8
  280. data/sandbox/itsi_sandbox_hanami/spec/support/requests.rb +0 -13
  281. data/sandbox/itsi_sandbox_hanami/spec/support/rspec.rb +0 -61
  282. data/sandbox/itsi_sandbox_rack/Gemfile +0 -17
  283. data/sandbox/itsi_sandbox_rack/Gemfile.lock +0 -153
  284. data/sandbox/itsi_sandbox_rack/config.ru +0 -5
  285. data/sandbox/itsi_sandbox_rack_lint/Gemfile +0 -7
  286. data/sandbox/itsi_sandbox_rack_lint/Gemfile.lock +0 -27
  287. data/sandbox/itsi_sandbox_rack_lint/config.ru +0 -3
  288. data/sandbox/itsi_sandbox_rails/.dockerignore +0 -48
  289. data/sandbox/itsi_sandbox_rails/.gitattributes +0 -9
  290. data/sandbox/itsi_sandbox_rails/.github/dependabot.yml +0 -12
  291. data/sandbox/itsi_sandbox_rails/.github/workflows/ci.yml +0 -90
  292. data/sandbox/itsi_sandbox_rails/.gitignore +0 -35
  293. data/sandbox/itsi_sandbox_rails/.rubocop.yml +0 -8
  294. data/sandbox/itsi_sandbox_rails/.ruby-version +0 -1
  295. data/sandbox/itsi_sandbox_rails/Dockerfile +0 -69
  296. data/sandbox/itsi_sandbox_rails/Gemfile +0 -66
  297. data/sandbox/itsi_sandbox_rails/Gemfile.lock +0 -429
  298. data/sandbox/itsi_sandbox_rails/README.md +0 -24
  299. data/sandbox/itsi_sandbox_rails/Rakefile +0 -6
  300. data/sandbox/itsi_sandbox_rails/app/assets/config/manifest.js +0 -4
  301. data/sandbox/itsi_sandbox_rails/app/assets/images/.keep +0 -0
  302. data/sandbox/itsi_sandbox_rails/app/assets/stylesheets/application.css +0 -15
  303. data/sandbox/itsi_sandbox_rails/app/channels/application_cable/channel.rb +0 -4
  304. data/sandbox/itsi_sandbox_rails/app/channels/application_cable/connection.rb +0 -4
  305. data/sandbox/itsi_sandbox_rails/app/controllers/application_controller.rb +0 -4
  306. data/sandbox/itsi_sandbox_rails/app/controllers/concerns/.keep +0 -0
  307. data/sandbox/itsi_sandbox_rails/app/controllers/home_controller.rb +0 -66
  308. data/sandbox/itsi_sandbox_rails/app/controllers/live_controller.rb +0 -40
  309. data/sandbox/itsi_sandbox_rails/app/controllers/uploads_controller.rb +0 -29
  310. data/sandbox/itsi_sandbox_rails/app/helpers/application_helper.rb +0 -2
  311. data/sandbox/itsi_sandbox_rails/app/javascript/application.js +0 -3
  312. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/application.js +0 -9
  313. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/hello_controller.js +0 -7
  314. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/index.js +0 -4
  315. data/sandbox/itsi_sandbox_rails/app/jobs/application_job.rb +0 -7
  316. data/sandbox/itsi_sandbox_rails/app/mailers/application_mailer.rb +0 -4
  317. data/sandbox/itsi_sandbox_rails/app/models/application_record.rb +0 -3
  318. data/sandbox/itsi_sandbox_rails/app/models/concerns/.keep +0 -0
  319. data/sandbox/itsi_sandbox_rails/app/models/post.rb +0 -2
  320. data/sandbox/itsi_sandbox_rails/app/views/layouts/application.html.erb +0 -23
  321. data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.html.erb +0 -13
  322. data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.text.erb +0 -1
  323. data/sandbox/itsi_sandbox_rails/app/views/pwa/manifest.json.erb +0 -22
  324. data/sandbox/itsi_sandbox_rails/app/views/pwa/service-worker.js +0 -26
  325. data/sandbox/itsi_sandbox_rails/bin/brakeman +0 -7
  326. data/sandbox/itsi_sandbox_rails/bin/bundle +0 -109
  327. data/sandbox/itsi_sandbox_rails/bin/docker-entrypoint +0 -13
  328. data/sandbox/itsi_sandbox_rails/bin/importmap +0 -4
  329. data/sandbox/itsi_sandbox_rails/bin/rails +0 -4
  330. data/sandbox/itsi_sandbox_rails/bin/rake +0 -4
  331. data/sandbox/itsi_sandbox_rails/bin/rubocop +0 -8
  332. data/sandbox/itsi_sandbox_rails/bin/setup +0 -37
  333. data/sandbox/itsi_sandbox_rails/config/application.rb +0 -27
  334. data/sandbox/itsi_sandbox_rails/config/boot.rb +0 -4
  335. data/sandbox/itsi_sandbox_rails/config/cable.yml +0 -10
  336. data/sandbox/itsi_sandbox_rails/config/credentials.yml.enc +0 -1
  337. data/sandbox/itsi_sandbox_rails/config/database.yml +0 -30
  338. data/sandbox/itsi_sandbox_rails/config/environment.rb +0 -5
  339. data/sandbox/itsi_sandbox_rails/config/environments/development.rb +0 -82
  340. data/sandbox/itsi_sandbox_rails/config/environments/production.rb +0 -106
  341. data/sandbox/itsi_sandbox_rails/config/environments/test.rb +0 -67
  342. data/sandbox/itsi_sandbox_rails/config/importmap.rb +0 -7
  343. data/sandbox/itsi_sandbox_rails/config/initializers/assets.rb +0 -12
  344. data/sandbox/itsi_sandbox_rails/config/initializers/content_security_policy.rb +0 -25
  345. data/sandbox/itsi_sandbox_rails/config/initializers/filter_parameter_logging.rb +0 -8
  346. data/sandbox/itsi_sandbox_rails/config/initializers/inflections.rb +0 -16
  347. data/sandbox/itsi_sandbox_rails/config/initializers/permissions_policy.rb +0 -13
  348. data/sandbox/itsi_sandbox_rails/config/locales/en.yml +0 -31
  349. data/sandbox/itsi_sandbox_rails/config/puma.rb +0 -34
  350. data/sandbox/itsi_sandbox_rails/config/routes.rb +0 -23
  351. data/sandbox/itsi_sandbox_rails/config/storage.yml +0 -34
  352. data/sandbox/itsi_sandbox_rails/config.ru +0 -6
  353. data/sandbox/itsi_sandbox_rails/db/migrate/20250301041554_create_posts.rb +0 -10
  354. data/sandbox/itsi_sandbox_rails/db/schema.rb +0 -23
  355. data/sandbox/itsi_sandbox_rails/db/seeds.rb +0 -9
  356. data/sandbox/itsi_sandbox_rails/lib/assets/.keep +0 -0
  357. data/sandbox/itsi_sandbox_rails/lib/tasks/.keep +0 -0
  358. data/sandbox/itsi_sandbox_rails/log/.keep +0 -0
  359. data/sandbox/itsi_sandbox_rails/public/404.html +0 -67
  360. data/sandbox/itsi_sandbox_rails/public/406-unsupported-browser.html +0 -66
  361. data/sandbox/itsi_sandbox_rails/public/422.html +0 -67
  362. data/sandbox/itsi_sandbox_rails/public/500.html +0 -66
  363. data/sandbox/itsi_sandbox_rails/public/icon.png +0 -0
  364. data/sandbox/itsi_sandbox_rails/public/icon.svg +0 -3
  365. data/sandbox/itsi_sandbox_rails/public/robots.txt +0 -1
  366. data/sandbox/itsi_sandbox_rails/storage/.keep +0 -0
  367. data/sandbox/itsi_sandbox_rails/test/application_system_test_case.rb +0 -5
  368. data/sandbox/itsi_sandbox_rails/test/channels/application_cable/connection_test.rb +0 -13
  369. data/sandbox/itsi_sandbox_rails/test/controllers/.keep +0 -0
  370. data/sandbox/itsi_sandbox_rails/test/fixtures/files/.keep +0 -0
  371. data/sandbox/itsi_sandbox_rails/test/helpers/.keep +0 -0
  372. data/sandbox/itsi_sandbox_rails/test/integration/.keep +0 -0
  373. data/sandbox/itsi_sandbox_rails/test/mailers/.keep +0 -0
  374. data/sandbox/itsi_sandbox_rails/test/models/.keep +0 -0
  375. data/sandbox/itsi_sandbox_rails/test/system/.keep +0 -0
  376. data/sandbox/itsi_sandbox_rails/test/test_helper.rb +0 -15
  377. data/sandbox/itsi_sandbox_rails/tmp/.keep +0 -0
  378. data/sandbox/itsi_sandbox_rails/tmp/pids/.keep +0 -0
  379. data/sandbox/itsi_sandbox_rails/tmp/storage/.keep +0 -0
  380. data/sandbox/itsi_sandbox_rails/vendor/.keep +0 -0
  381. data/sandbox/itsi_sandbox_rails/vendor/javascript/.keep +0 -0
  382. data/sandbox/itsi_sandbox_roda/Gemfile +0 -5
  383. data/sandbox/itsi_sandbox_roda/Gemfile.lock +0 -37
  384. data/sandbox/itsi_sandbox_roda/config.ru +0 -39
  385. data/sandbox/itsi_sinatra/Gemfile +0 -9
  386. data/sandbox/itsi_sinatra/Gemfile.lock +0 -81
  387. data/sandbox/itsi_sinatra/app.rb +0 -8
  388. data/sandbox/pebble/docker-compose.yml +0 -11
  389. data/sandbox/static_files/.env +0 -1
  390. data/sandbox/static_files/404.html +0 -25
  391. data/sandbox/static_files/_DSC0102.NEF.jpg +0 -0
  392. data/sandbox/static_files/about.html +0 -68
  393. data/sandbox/static_files/tiny.html +0 -1
  394. data/sandbox/static_files/writebook.zip +0 -0
@@ -73,13 +73,18 @@ impl ClusterMode {
73
73
  Ok(())
74
74
  }
75
75
  LifecycleEvent::Restart => {
76
- self.server_config.dup_fds()?;
77
- self.shutdown().await.ok();
78
- info!("Shutdown complete. Calling reload exec");
79
- self.server_config.reload_exec()?;
76
+ if self.server_config.check_config() {
77
+ self.server_config.dup_fds()?;
78
+ self.shutdown().await.ok();
79
+ info!("Shutdown complete. Calling reload exec");
80
+ self.server_config.reload_exec()?;
81
+ }
80
82
  Ok(())
81
83
  }
82
84
  LifecycleEvent::Reload => {
85
+ if !self.server_config.check_config() {
86
+ return Ok(());
87
+ }
83
88
  let should_reexec = self.server_config.clone().reload(true)?;
84
89
  if should_reexec {
85
90
  self.server_config.dup_fds()?;
@@ -286,6 +291,7 @@ impl ClusterMode {
286
291
  self.build_runtime().block_on(async {
287
292
  let self_ref = self_ref.clone();
288
293
  let mut memory_check_interval = time::interval(time::Duration::from_secs(2));
294
+
289
295
  loop {
290
296
  tokio::select! {
291
297
  _ = receiver.changed() => {
@@ -90,6 +90,7 @@ impl SingleMode {
90
90
  }
91
91
 
92
92
  pub fn stop(&self) -> Result<()> {
93
+ SHUTDOWN_REQUESTED.store(true, std::sync::atomic::Ordering::SeqCst);
93
94
  self.lifecycle_channel.send(LifecycleEvent::Shutdown).ok();
94
95
  Ok(())
95
96
  }
@@ -231,14 +232,17 @@ impl SingleMode {
231
232
  );
232
233
 
233
234
  let (shutdown_sender, _) = watch::channel(RunningPhase::Running);
234
- let thread = self.clone().start_monitors(thread_workers.clone());
235
+ let monitor_thread = self.clone().start_monitors(thread_workers.clone());
235
236
  if SHUTDOWN_REQUESTED.load(Ordering::SeqCst) {
236
237
  return Ok(());
237
238
  }
238
- runtime.block_on(
239
+ let result = runtime.block_on(
239
240
  async {
240
241
  let server_params = self.server_config.server_params.read().clone();
241
- server_params.middleware.get().unwrap().initialize_layers().await?;
242
+ if let Err(err) = server_params.initialize_middleware().await {
243
+ error!("Failed to initialize middleware: {}", err);
244
+ return Err(ItsiError::new("Failed to initialize middleware"))
245
+ }
242
246
  let tokio_listeners = server_params.listeners.lock()
243
247
  .drain(..)
244
248
  .map(|list| {
@@ -310,7 +314,19 @@ impl SingleMode {
310
314
  drop(tokio_listeners);
311
315
 
312
316
  Ok::<(), ItsiError>(())
313
- })?;
317
+ });
318
+
319
+ debug!("Single mode runtime exited.");
320
+
321
+ if result.is_err() {
322
+ for _i in 0..thread_workers.len() {
323
+ job_sender.send_blocking(RequestJob::Shutdown).unwrap();
324
+ nonblocking_sender
325
+ .send_blocking(RequestJob::Shutdown)
326
+ .unwrap();
327
+ }
328
+ self.lifecycle_channel.send(LifecycleEvent::Shutdown).ok();
329
+ }
314
330
 
315
331
  shutdown_sender.send(RunningPhase::Shutdown).ok();
316
332
  let deadline = Instant::now()
@@ -318,12 +334,13 @@ impl SingleMode {
318
334
 
319
335
  runtime.shutdown_timeout(Duration::from_millis(100));
320
336
 
337
+ debug!("Shutdown timeout finished.");
321
338
  loop {
322
339
  if thread_workers
323
340
  .iter()
324
341
  .all(|worker| call_with_gvl(move |_| !worker.poll_shutdown(deadline)))
325
342
  {
326
- funcall_no_ret(thread, "join", ()).ok();
343
+ funcall_no_ret(monitor_thread, "join", ()).ok();
327
344
  break;
328
345
  }
329
346
  sleep(Duration::from_millis(50));
@@ -335,7 +352,7 @@ impl SingleMode {
335
352
  self.run()?;
336
353
  }
337
354
  debug!("Runtime has shut down");
338
- Ok(())
355
+ result
339
356
  }
340
357
 
341
358
  pub(crate) async fn serve_connection(
@@ -367,7 +384,7 @@ impl SingleMode {
367
384
  let mut serve = Box::pin(
368
385
  binding
369
386
  .timer(TokioTimer::new())
370
- .header_read_timeout(Duration::from_secs(1))
387
+ .header_read_timeout(self.server_config.server_params.read().header_read_timeout)
371
388
  .serve_connection_with_upgrades(io, service),
372
389
  );
373
390
 
@@ -401,6 +418,9 @@ impl SingleMode {
401
418
  /// Not that when running in single mode this will not unload
402
419
  /// old code. If you need a clean restart, use the `restart` (SIGHUP) method instead
403
420
  pub fn reload(&self) -> Result<()> {
421
+ if !self.server_config.check_config() {
422
+ return Ok(());
423
+ }
404
424
  let should_reexec = self.server_config.clone().reload(false)?;
405
425
  if should_reexec {
406
426
  self.server_config.dup_fds()?;
@@ -414,6 +434,9 @@ impl SingleMode {
414
434
 
415
435
  /// Restart the server while keeping connections open.
416
436
  pub fn restart(&self) -> Result<()> {
437
+ if !self.server_config.check_config() {
438
+ return Ok(());
439
+ }
417
440
  self.server_config.dup_fds()?;
418
441
  self.server_config.reload_exec()?;
419
442
  Ok(())
@@ -159,11 +159,10 @@ impl ThreadWorker {
159
159
  pub fn poll_shutdown(&self, deadline: Instant) -> bool {
160
160
  if let Some(thread) = self.thread.read().deref() {
161
161
  if Instant::now() > deadline {
162
- warn!("Worker shutdown timed out. Killing thread");
162
+ warn!("Worker shutdown timed out. Killing thread {:?}", thread);
163
163
  self.terminated.store(true, Ordering::SeqCst);
164
164
  kill_threads(vec![thread.as_value()]);
165
165
  }
166
- debug!("Checking thread status");
167
166
  if thread.funcall::<_, _, bool>(*ID_ALIVE, ()).unwrap_or(false) {
168
167
  return true;
169
168
  }
@@ -184,6 +183,7 @@ impl ThreadWorker {
184
183
  call_with_gvl(|_| {
185
184
  *self.thread.write() = Some(
186
185
  create_ruby_thread(move || {
186
+ debug!("Ruby thread worker started");
187
187
  if let Some(scheduler_class) = scheduler_class {
188
188
  if let Err(err) = self_ref.fiber_accept_loop(
189
189
  params,
@@ -50,6 +50,7 @@ pub static ROOT_STATIC_FILE_SERVER: LazyLock<StaticFileServer> = LazyLock::new(|
50
50
  serve_hidden_files: false,
51
51
  allowed_extensions: vec!["html".to_string(), "css".to_string(), "js".to_string()],
52
52
  })
53
+ .unwrap()
53
54
  });
54
55
 
55
56
  #[derive(Debug, Clone, Deserialize)]
@@ -209,14 +210,27 @@ struct ServeCacheArgs<'a>(
209
210
  );
210
211
 
211
212
  impl StaticFileServer {
212
- pub fn new(config: StaticFileServerConfig) -> Self {
213
+ pub fn new(config: StaticFileServerConfig) -> Result<Self> {
213
214
  let cache = Cache::builder().max_capacity(config.max_entries).build();
215
+ if !config.root_dir.exists() {
216
+ return Err(ItsiError::InternalError(format!(
217
+ "Root directory {} for static file server doesn't exist",
218
+ config.root_dir.display()
219
+ )));
220
+ }
221
+
222
+ if std::fs::read_dir(&config.root_dir).is_err() {
223
+ return Err(ItsiError::InternalError(format!(
224
+ "Root directory {} for static file server is not readable",
225
+ config.root_dir.display()
226
+ )));
227
+ }
214
228
 
215
- StaticFileServer {
229
+ Ok(StaticFileServer {
216
230
  config: Arc::new(config),
217
231
  cache,
218
232
  key_to_path: Arc::new(Mutex::new(HashMap::new())),
219
- }
233
+ })
220
234
  }
221
235
 
222
236
  #[allow(clippy::too_many_arguments)]
@@ -483,14 +497,19 @@ impl StaticFileServer {
483
497
 
484
498
  tokio::pin!(entries);
485
499
  while let Some(entry) = entries.next_entry().await.unwrap_or(None) {
486
- if entry
487
- .file_name()
488
- .to_str()
489
- .is_some_and(|name| name.eq_ignore_ascii_case("index.html"))
490
- && entry.metadata().await.unwrap().is_file()
491
- {
492
- index_file = Some(entry.path());
493
- break;
500
+ if let Ok(metadata) = entry.metadata().await {
501
+ if entry
502
+ .file_name()
503
+ .to_str()
504
+ .is_some_and(|name| name.eq_ignore_ascii_case("index.html"))
505
+ && metadata.is_file()
506
+ {
507
+ index_file = Some(entry.path());
508
+ break;
509
+ }
510
+ } else {
511
+ error!("Failed to retrieve metadata for entry: {:?}", entry.path());
512
+ return Err(self.config.not_found_behavior.clone());
494
513
  }
495
514
  }
496
515
  }
@@ -999,23 +1018,6 @@ impl std::fmt::Display for StaticFileServer {
999
1018
  }
1000
1019
  }
1001
1020
 
1002
- impl Default for StaticFileServer {
1003
- fn default() -> Self {
1004
- let config = StaticFileServerConfig {
1005
- root_dir: "public".into(),
1006
- max_file_size: 10 * 1024 * 1024,
1007
- max_entries: 100,
1008
- recheck_interval: Duration::from_secs(60),
1009
- try_html_extension: true,
1010
- auto_index: true,
1011
- not_found_behavior: NotFoundBehavior::Error(ErrorResponse::not_found()),
1012
- serve_hidden_files: false,
1013
- allowed_extensions: vec!["html".to_string(), "css".to_string(), "js".to_string()],
1014
- };
1015
- Self::new(config)
1016
- }
1017
- }
1018
-
1019
1021
  async fn generate_directory_listing(
1020
1022
  dir_path: &Path,
1021
1023
  config: &StaticFileServerConfig,
@@ -3,6 +3,7 @@ use std::{
3
3
  env,
4
4
  sync::{Mutex, OnceLock},
5
5
  };
6
+ use tracing::Level;
6
7
  pub use tracing::{debug, error, info, trace, warn};
7
8
  use tracing_appender::rolling;
8
9
  use tracing_subscriber::fmt::writer::BoxMakeWriter;
@@ -110,7 +111,7 @@ fn build_fmt_layer(
110
111
  .compact()
111
112
  .with_file(false)
112
113
  .with_line_number(false)
113
- .with_target(false)
114
+ .with_target(true)
114
115
  .with_thread_ids(false)
115
116
  .with_writer(BoxMakeWriter::new(std::io::stdout))
116
117
  .with_ansi(config.use_ansi)
@@ -119,7 +120,7 @@ fn build_fmt_layer(
119
120
  .compact()
120
121
  .with_file(false)
121
122
  .with_line_number(false)
122
- .with_target(false)
123
+ .with_target(true)
123
124
  .with_thread_ids(false)
124
125
  .with_writer(BoxMakeWriter::new(std::io::stdout))
125
126
  .with_ansi(config.use_ansi)
@@ -133,7 +134,7 @@ fn build_fmt_layer(
133
134
  .compact()
134
135
  .with_file(false)
135
136
  .with_line_number(false)
136
- .with_target(false)
137
+ .with_target(true)
137
138
  .with_thread_ids(false)
138
139
  .with_writer(BoxMakeWriter::new(move || {
139
140
  rolling::daily(".", file_clone.clone())
@@ -146,7 +147,7 @@ fn build_fmt_layer(
146
147
  .compact()
147
148
  .with_file(false)
148
149
  .with_line_number(false)
149
- .with_target(false)
150
+ .with_target(true)
150
151
  .with_thread_ids(false)
151
152
  .with_writer(BoxMakeWriter::new(move || {
152
153
  rolling::daily(".", file_clone.clone())
@@ -165,7 +166,7 @@ fn build_fmt_layer(
165
166
  .compact()
166
167
  .with_file(false)
167
168
  .with_line_number(false)
168
- .with_target(false)
169
+ .with_target(true)
169
170
  .with_thread_ids(false)
170
171
  .with_writer(BoxMakeWriter::new(std::io::stdout))
171
172
  .with_ansi(config.use_ansi);
@@ -173,7 +174,7 @@ fn build_fmt_layer(
173
174
  .compact()
174
175
  .with_file(false)
175
176
  .with_line_number(false)
176
- .with_target(false)
177
+ .with_target(true)
177
178
  .with_thread_ids(false)
178
179
  .with_writer(BoxMakeWriter::new(move || {
179
180
  rolling::daily(".", file_clone.clone())
@@ -186,7 +187,7 @@ fn build_fmt_layer(
186
187
  .compact()
187
188
  .with_file(false)
188
189
  .with_line_number(false)
189
- .with_target(false)
190
+ .with_target(true)
190
191
  .with_thread_ids(false)
191
192
  .with_writer(BoxMakeWriter::new(std::io::stdout))
192
193
  .with_ansi(config.use_ansi)
@@ -195,7 +196,7 @@ fn build_fmt_layer(
195
196
  .compact()
196
197
  .with_file(false)
197
198
  .with_line_number(false)
198
- .with_target(false)
199
+ .with_target(true)
199
200
  .with_thread_ids(false)
200
201
  .with_writer(BoxMakeWriter::new(move || {
201
202
  rolling::daily(".", file_clone.clone())
@@ -304,6 +305,36 @@ pub fn set_format(new_format: &str) {
304
305
  eprintln!("Current configuration not initialized; call init() first.");
305
306
  }
306
307
  }
308
+ pub fn set_target_filters(targets: Vec<(&str, Level)>) {
309
+ if let Some(reload_handle_mutex) = RELOAD_HANDLE.get() {
310
+ if let Ok(handle_guard) = reload_handle_mutex.lock() {
311
+ if let Some(handle) = handle_guard.as_ref() {
312
+ let mut new_filter = EnvFilter::new("");
313
+
314
+ if let Some(config_mutex) = CURRENT_CONFIG.get() {
315
+ if let Ok(config) = config_mutex.lock() {
316
+ if let Ok(directive) = config.level.parse() {
317
+ new_filter = new_filter.add_directive(directive);
318
+ }
319
+ }
320
+ }
321
+
322
+ for (target, level) in targets {
323
+ let directive_str = format!("{}={}", target, level);
324
+ if let Ok(directive) = directive_str.parse() {
325
+ new_filter = new_filter.add_directive(directive);
326
+ }
327
+ }
328
+
329
+ if let Err(e) = handle.modify(|filter| *filter = new_filter) {
330
+ eprintln!("Failed to update filter with target directives: {}", e);
331
+ }
332
+ }
333
+ }
334
+ } else {
335
+ eprintln!("Reload handle for filter not initialized; call init() first.");
336
+ }
337
+ }
307
338
 
308
339
  /// Run a function silently by temporarily setting a no-op subscriber.
309
340
  pub fn run_silently<F, R>(f: F) -> R
data/docker/Dockerfile ADDED
@@ -0,0 +1,12 @@
1
+ FROM ruby:3.4.2-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install only what's needed to install the gem, then clean up in the same layer
6
+ RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends libclang-dev build-essential curl && \
8
+ gem install itsi --no-document && \
9
+ apt-get purge -y --auto-remove build-essential && \
10
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11
+
12
+ ENTRYPOINT ["itsi"]
@@ -1,17 +1,25 @@
1
1
  ---
2
- title: My Site
3
- toc: false
2
+ type: docs
4
3
  ---
4
+ # Itsi
5
+ <img src="itsi-server-100.png" alt="asd" width="80px" style="display: block; margin-left: auto; margin-right: auto;">
5
6
 
6
- This is the landing page.
7
+ > The Serious Web Server, for Serious People
7
8
 
8
- ## Explore
9
9
 
10
- {{< cards >}}
11
- {{< card link="docs" title="Docs" icon="book-open" >}}
12
- {{< card link="about" title="About" icon="user" >}}
13
- {{< /cards >}}
10
+ Itsi is a feature-packed, high performance web and application server, with first-class support for Ruby applications.
11
+ It's a compliant Rack server with top-tier performance.
12
+ It's *also* a well-equipped Reverse Proxy, API Gateway and Static file server, controlled by an intuitive and elegant configuration API and DSL.
13
+
14
14
 
15
- ## Documentation
15
+ Itsi is motivated by the belief that:
16
+ >*It should be **easy** to share your application on the internet with confidence, without a need for complex configuration or multiple layers of tools.*
16
17
 
17
- For more information, visit [Hextra](https://imfing.github.io/hextra).
18
+ With *just* your application code and *Itsi* working within a single process, you can proudly serve your best work, directly to the world wide web.
19
+
20
+ {{< cards >}}
21
+ {{< card link="../features" title="Features" icon="star" >}}
22
+ {{< card link="../getting_started" title="Getting Started" icon="academic-cap" >}}
23
+ {{< card link="../configuration" title="Configuration" icon="adjustments" >}}
24
+ {{< card link="https://github.com/wouterken/itsi" title="Source Code" icon="github" >}}
25
+ {{< /cards >}}
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Acknowledgements
3
+ type: docs
4
+ sidebar:
5
+ exclude: true
6
+ ---
7
+
8
+ Itsi is **heavily** is dependent on and/or heavily inspired by a long list of related projects and individuals.
9
+
10
+
11
+ ## Key Dependencies
12
+ * [hyper](https://hyper.rs/)
13
+ Hyper is a fast, correct and memory-safe HTTP1 & 2 Implementation in Rust.
14
+ It is an absolutely essential component of Itsi.
15
+
16
+ * [tokio](https://tokio.rs/)
17
+ Tokio is a fast and featureful asynchronous runtime for Rust.
18
+ It is the backbone of *all* asynchronous IO in Itsi.
19
+
20
+ * and many more [essential](https://github.com/wouterken/itsi/blob/main/crates/itsi_server/Cargo.toml) Rust crates!
21
+
22
+ * [hugo](https://gohugo.io/) and [hextra](https://imfing.github.io/hextra/) - generating *this very page* and allowing me to put together
23
+ this website with minimal effort.
24
+
25
+
26
+ ## Inspiration
27
+ * [Puma](https://puma.io/) is a long-standing industry heavy-weight and the current leading choice of Web Server in the Ruby ecosystem.
28
+ It's mature, stable and rock solid. Many features and interfaces of Itsi have been inspired by Puma.
29
+
30
+ * [NGINX](https://nginx.org/) is a popular open-source web server and reverse proxy server.
31
+ It's highly scalable and a great choice for high-traffic websites.
32
+ Many of Itsi's proxy and static file server design decisions and features have been inspired by their NGINX equivalents.
33
+
34
+ * The [Async](https://github.com/socketry/async) ecosystem and [Falcon](https://github.com/socketry/falcon), championed by [@ioaquatix](https://github.com/ioquatix) - a fellow Kiwi.
35
+ These tools and efforts in driving forward Ruby's cooperative multitasking have been a great inspiration and source of learning for Itsi's async IO design.
36
+
37
+ * [Iodine](https://github.com/boazsegev/iodine), [Agoo](https://github.com/ohler55/agoo). Two class-leading options when it comes to blazing fast Ruby servers written in native code.
38
+
39
+ * [Caddy](https://caddyserver.com/)
40
+ An open-source web server and reverse proxy server, with a huge feature set, great performance, and arguably the first tool to popularize automated ACME certificate management.
41
+
42
+ * [RubyLSP](https://shopify.github.io/ruby-lsp/)
43
+ An open-source language server for Ruby, built by engineers at Shopify making it *easy* to significantly enhance the Itsi developer experience.
@@ -0,0 +1,98 @@
1
+ ---
2
+ title: Configuration
3
+ type: docs
4
+ weight: 3
5
+ next: /options/
6
+ ---
7
+
8
+ ## Itsi.rb
9
+ To realize the full power of all of Itsi's features, you'll typically create a configuration file
10
+ (usually named `Itsi.rb`) at the root of your project.<br/>
11
+ If you're ready to get stuck in and learn all about what Itsi has to offer, use
12
+ `itsi init` to generate a fresh configuration file and read through the following [options](/options/) and [middleware](/middleware/) sections.
13
+
14
+
15
+ ## Out-of-the-box
16
+ If you prefer a more gradual introduction, Itsi provides several "out-of-the box" capabilities that you can take immediate advantage of *without*, needing to start a dedicated configuration file.
17
+
18
+
19
+
20
+ ## Run Rack Applications
21
+ Itsi will automatically host your Rack application if you launch it in a directory with a `config.ru` file.
22
+ This means, it's a drop in server replacement for your favourite `Rails`, `Hanami`, or `Sinatra` applications.
23
+
24
+ To get started just run
25
+ ```ruby
26
+ itsi # or
27
+ bundle exec itsi
28
+ ```
29
+
30
+ There's also a Rails adapter allowing you to add it to your Gemfile and launch it using the `rails server` command.
31
+
32
+ ```ruby
33
+ rails server -U itsi
34
+ ```
35
+ {{< callout type="info" >}}
36
+ Note that `rails server -U itsi` runs Itsi with a intentionally minimal footprint, specifically for development purposes. To take full advantage of Itsi's concurrency features,
37
+ it's advised you tweak these inside a dedicated `Itsi.rb` file.
38
+ {{< /callout >}}
39
+
40
+
41
+
42
+ ## Host static files
43
+ You can run Itsi as a fully fledged, static file server.
44
+ With a single command, Itsi will start an HTTP server to serve files from the current directory.
45
+ To get started just run.
46
+ ```ruby
47
+ itsi static # or
48
+ bundle exec itsi static
49
+ ```
50
+
51
+ > This starts a server with a minimal set of defaults. Look at the [`static_assets`](/middleware/static_assets) middleware page to learn more about how to configure Itsi for full control over static file server capabilities.
52
+
53
+ ## Tweak your Itsi server
54
+ Several of the most common features of Itsi are configurable using command line flags.
55
+ Run `itsi --help` to see all available options. If you apply both command line flags and an `Itsi.rb` config file, the command line flags will take precedence.
56
+
57
+ ```bash
58
+ ❯ itsi --help
59
+ Usage: itsi [COMMAND] [options]
60
+ -C, --config CONFIG_FILE Itsi Configuration file to use (default: Itsi.rb)
61
+ -w, --workers WORKERS Number of workers
62
+ -d, --daemonize Run the process as a daemon
63
+ -t, --threads THREADS Number of threads (default: 1)
64
+ --[no-]multithreaded-reactor Use a multithreaded reactor
65
+ -r, --rackup_file FILE Rackup file to use (default: config.ru)
66
+ --worker-memory-limit MEMORY_LIMIT
67
+ Memory limit for each worker (default: None). If this limit is breached the worker is gracefully restarted
68
+ -f [CLASS_NAME], Scheduler class to use (default: nil). Provide blank or true to use Itsi::Scheduler, or a classname to use an alternative scheduler
69
+ --fiber_scheduler
70
+ --preload [true, false, :bundle_group_name]
71
+ Toggle preloading the application
72
+ -b, --bind BIND Bind address (default: http://0.0.0.0:3000). You can specify this flag multiple times to bind to multiple addresses.
73
+ -c, --cert_path CERT_PATH Path to the SSL certificate file (must follow a --bind option). You can specify this flag multiple times.
74
+ -k, --key_path KEY_PATH Path to the SSL key file (must follow a --bind option). You can specify this flag multiple times.
75
+ --shutdown_timeout SHUTDOWN_TIMEOUT
76
+ Graceful timeout period before forcing workers to shutdown
77
+ --stream-body Stream body frames (default: false for best compatibility)
78
+ -h, --help Show this help message
79
+ --reexec PARAMS Reexec the server with the given parameters
80
+ --listeners LISTENERS Listeners for reexec
81
+ --passfile PASSFILE Passfile
82
+ --algorithm ALGORITHM Algorithm for password hashing
83
+ COMMAND:
84
+ init - Initialize a new Itsi.rb server configuration file
85
+ status - Show the status of the server
86
+ start - Start the Itsi server
87
+ serve - Start the Itsi server
88
+ stop - Stop the server
89
+ reload - Reload the server
90
+ restart - Restart the server
91
+ add_worker - Add a new worker to the server cluster
92
+ remove_worker - Remove a worker from the server cluster
93
+ routes - Print the routes of the server
94
+ passfile - Manage hashed users and passwords in a passfile (like .htpasswd). [add, remove, list]
95
+ test_route - Test which route a request will be routed to
96
+ static - Serve static assets in the given directory
97
+
98
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Contact
3
+ type: docs
4
+ weight: 3
5
+ sidebar:
6
+ exclude: true
7
+ ---
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: F.A.Qs
3
+ type: docs
4
+ ---
5
+
6
+ {{% details title="Is it just for Ruby applications?" closed="true" %}}
7
+ **No!** While one of Itsi's goals is to be the most frictionless way to get Ruby onto the web, it stands alone as a powerful Reverse Proxy, Static File Server and API Gateway.
8
+
9
+ You can have Itsi sit in front of *any* application that speaks HTTP and immediately benefit from security middleware, performance enhancements, and more.
10
+ You will need to write a little bit of Ruby, just to configure your Itsi server inside the `Itsi.rb` file. Who knows, maybe you'll learn to love it!
11
+ {{% /details %}}
12
+
13
+ {{% details title="What's it written in?" closed="true" %}}
14
+ The heart of Itsi is a Rust server, leaning *heavily* on [tokio](https://tokio.rs) and [hyper](https://hyper.rs) and many other fantastic and high performance Rust libraries.
15
+ Take a look at the [Cargo.toml](https://github.com/wouterken/itsi/blob/main/crates/itsi_server/Cargo.toml) to see them all.
16
+
17
+ This is exposed via a robust and ergonomic Ruby DSL.
18
+ {{% /details %}}
19
+
20
+ {{% details title="What License is it under?" closed="true" %}}
21
+ Itsi is an open source project licensed under the terms of the [LGPLv3](https://www.gnu.org/licenses/lgpl-3.0.en.html).
22
+
23
+ You can integrate and use Itsi in your projects—whether they are open source or proprietary—without any licensing fees or obligations, as long as you use Itsi in its unmodified form. However, if you modify Itsi’s source code and distribute the modified version, you are required to release your modifications under the same LGPLv3 license.
24
+
25
+ If these terms do not meet your project’s needs or if you require bespoke support and legal assurances, Itsi is also available under alternative commercial licensing options.
26
+ Please contact commercial@itsi.fyi for more information.
27
+ {{% /details %}}