itsi 0.1.6 → 0.1.8

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 (239) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +49 -0
  3. data/Rakefile +20 -0
  4. data/crates/itsi_error/src/from.rs +26 -29
  5. data/crates/itsi_error/src/lib.rs +1 -1
  6. data/crates/itsi_server/Cargo.lock +2956 -0
  7. data/crates/itsi_server/Cargo.toml +2 -1
  8. data/crates/itsi_server/src/env.rs +43 -0
  9. data/crates/itsi_server/src/lib.rs +1 -0
  10. data/crates/itsi_server/src/request/itsi_request.rs +7 -7
  11. data/crates/itsi_server/src/server/bind.rs +4 -3
  12. data/crates/itsi_server/src/server/itsi_server.rs +1 -8
  13. data/crates/itsi_server/src/server/listener.rs +98 -107
  14. data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
  15. data/crates/itsi_server/src/server/tls/locked_dir_cache.rs +3 -3
  16. data/crates/itsi_server/src/server/tls.rs +83 -44
  17. data/gems/scheduler/ext/itsi_error/src/from.rs +26 -29
  18. data/gems/scheduler/ext/itsi_error/src/lib.rs +1 -1
  19. data/gems/scheduler/ext/itsi_server/Cargo.lock +2956 -0
  20. data/gems/scheduler/ext/itsi_server/Cargo.toml +2 -1
  21. data/gems/scheduler/ext/itsi_server/src/env.rs +43 -0
  22. data/gems/scheduler/ext/itsi_server/src/lib.rs +1 -0
  23. data/gems/scheduler/ext/itsi_server/src/request/itsi_request.rs +7 -7
  24. data/gems/scheduler/ext/itsi_server/src/server/bind.rs +4 -3
  25. data/gems/scheduler/ext/itsi_server/src/server/itsi_server.rs +1 -8
  26. data/gems/scheduler/ext/itsi_server/src/server/listener.rs +98 -107
  27. data/gems/scheduler/ext/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
  28. data/gems/scheduler/ext/itsi_server/src/server/tls/locked_dir_cache.rs +3 -3
  29. data/gems/scheduler/ext/itsi_server/src/server/tls.rs +83 -44
  30. data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
  31. data/gems/server/Cargo.lock +2917 -0
  32. data/gems/server/Cargo.toml +7 -0
  33. data/gems/server/ext/itsi_error/src/from.rs +26 -29
  34. data/gems/server/ext/itsi_error/src/lib.rs +1 -1
  35. data/gems/server/ext/itsi_server/Cargo.lock +2956 -0
  36. data/gems/server/ext/itsi_server/Cargo.toml +2 -1
  37. data/gems/server/ext/itsi_server/src/env.rs +43 -0
  38. data/gems/server/ext/itsi_server/src/lib.rs +1 -0
  39. data/gems/server/ext/itsi_server/src/request/itsi_request.rs +7 -7
  40. data/gems/server/ext/itsi_server/src/server/bind.rs +4 -3
  41. data/gems/server/ext/itsi_server/src/server/itsi_server.rs +1 -8
  42. data/gems/server/ext/itsi_server/src/server/listener.rs +98 -107
  43. data/gems/server/ext/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
  44. data/gems/server/ext/itsi_server/src/server/tls/locked_dir_cache.rs +3 -3
  45. data/gems/server/ext/itsi_server/src/server/tls.rs +83 -44
  46. data/gems/server/lib/itsi/index.html.erb +91 -0
  47. data/gems/server/lib/itsi/server/scheduler_mode.rb +1 -1
  48. data/gems/server/lib/itsi/server/version.rb +1 -1
  49. data/gems/server/lib/itsi/server.rb +22 -2
  50. data/lib/itsi/version.rb +1 -1
  51. data/sandbox/deploy/main.tf +237 -0
  52. data/sandbox/deploy/outputs.tf +4 -0
  53. data/sandbox/deploy/vars.tf +11 -0
  54. data/sandbox/falcon_benchmark/Gemfile +10 -0
  55. data/sandbox/falcon_benchmark/Gemfile.lock +140 -0
  56. data/sandbox/falcon_benchmark/config.ru +54 -0
  57. data/sandbox/itsi_sandbox_async/Gemfile +10 -0
  58. data/sandbox/itsi_sandbox_async/Gemfile.lock +69 -0
  59. data/sandbox/itsi_sandbox_async/config.ru +10 -0
  60. data/sandbox/itsi_sandbox_hanami/.env +2 -0
  61. data/sandbox/itsi_sandbox_hanami/.gitignore +6 -0
  62. data/sandbox/itsi_sandbox_hanami/.rspec +1 -0
  63. data/sandbox/itsi_sandbox_hanami/Gemfile +49 -0
  64. data/sandbox/itsi_sandbox_hanami/Gemfile.lock +440 -0
  65. data/sandbox/itsi_sandbox_hanami/Guardfile +9 -0
  66. data/sandbox/itsi_sandbox_hanami/Procfile.dev +2 -0
  67. data/sandbox/itsi_sandbox_hanami/README.md +1 -0
  68. data/sandbox/itsi_sandbox_hanami/Rakefile +3 -0
  69. data/sandbox/itsi_sandbox_hanami/app/action.rb +12 -0
  70. data/sandbox/itsi_sandbox_hanami/app/actions/.keep +0 -0
  71. data/sandbox/itsi_sandbox_hanami/app/assets/css/app.css +5 -0
  72. data/sandbox/itsi_sandbox_hanami/app/assets/images/favicon.ico +0 -0
  73. data/sandbox/itsi_sandbox_hanami/app/assets/js/app.js +1 -0
  74. data/sandbox/itsi_sandbox_hanami/app/db/relation.rb +10 -0
  75. data/sandbox/itsi_sandbox_hanami/app/db/repo.rb +10 -0
  76. data/sandbox/itsi_sandbox_hanami/app/db/struct.rb +10 -0
  77. data/sandbox/itsi_sandbox_hanami/app/operation.rb +9 -0
  78. data/sandbox/itsi_sandbox_hanami/app/relations/.keep +0 -0
  79. data/sandbox/itsi_sandbox_hanami/app/repos/.keep +0 -0
  80. data/sandbox/itsi_sandbox_hanami/app/structs/.keep +0 -0
  81. data/sandbox/itsi_sandbox_hanami/app/templates/layouts/app.html.erb +14 -0
  82. data/sandbox/itsi_sandbox_hanami/app/view.rb +9 -0
  83. data/sandbox/itsi_sandbox_hanami/app/views/helpers.rb +10 -0
  84. data/sandbox/itsi_sandbox_hanami/bin/dev +8 -0
  85. data/sandbox/itsi_sandbox_hanami/config/app.rb +8 -0
  86. data/sandbox/itsi_sandbox_hanami/config/assets.js +16 -0
  87. data/sandbox/itsi_sandbox_hanami/config/db/migrate/.keep +0 -0
  88. data/sandbox/itsi_sandbox_hanami/config/db/seeds.rb +15 -0
  89. data/sandbox/itsi_sandbox_hanami/config/puma.rb +47 -0
  90. data/sandbox/itsi_sandbox_hanami/config/routes.rb +7 -0
  91. data/sandbox/itsi_sandbox_hanami/config/settings.rb +9 -0
  92. data/sandbox/itsi_sandbox_hanami/config.ru +5 -0
  93. data/sandbox/itsi_sandbox_hanami/db/.keep +0 -0
  94. data/sandbox/itsi_sandbox_hanami/lib/itsi_hanami/types.rb +11 -0
  95. data/sandbox/itsi_sandbox_hanami/lib/tasks/.keep +0 -0
  96. data/sandbox/itsi_sandbox_hanami/package-lock.json +946 -0
  97. data/sandbox/itsi_sandbox_hanami/package.json +8 -0
  98. data/sandbox/itsi_sandbox_hanami/spec/requests/root_spec.rb +11 -0
  99. data/sandbox/itsi_sandbox_hanami/spec/spec_helper.rb +9 -0
  100. data/sandbox/itsi_sandbox_hanami/spec/support/db/cleaning.rb +42 -0
  101. data/sandbox/itsi_sandbox_hanami/spec/support/db.rb +10 -0
  102. data/sandbox/itsi_sandbox_hanami/spec/support/features.rb +5 -0
  103. data/sandbox/itsi_sandbox_hanami/spec/support/operations.rb +8 -0
  104. data/sandbox/itsi_sandbox_hanami/spec/support/requests.rb +13 -0
  105. data/sandbox/itsi_sandbox_hanami/spec/support/rspec.rb +61 -0
  106. data/sandbox/itsi_sandbox_rack/Gemfile +17 -0
  107. data/sandbox/itsi_sandbox_rack/Gemfile.lock +153 -0
  108. data/sandbox/itsi_sandbox_rack/config.ru +18 -0
  109. data/sandbox/itsi_sandbox_rack_lint/Gemfile +7 -0
  110. data/sandbox/itsi_sandbox_rack_lint/Gemfile.lock +27 -0
  111. data/sandbox/itsi_sandbox_rack_lint/config.ru +3 -0
  112. data/sandbox/itsi_sandbox_rails/.dockerignore +51 -0
  113. data/sandbox/itsi_sandbox_rails/.gitattributes +9 -0
  114. data/sandbox/itsi_sandbox_rails/.github/dependabot.yml +12 -0
  115. data/sandbox/itsi_sandbox_rails/.github/workflows/ci.yml +90 -0
  116. data/sandbox/itsi_sandbox_rails/.gitignore +34 -0
  117. data/sandbox/itsi_sandbox_rails/.kamal/hooks/docker-setup.sample +3 -0
  118. data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-app-boot.sample +3 -0
  119. data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-deploy.sample +14 -0
  120. data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-proxy-reboot.sample +3 -0
  121. data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-app-boot.sample +3 -0
  122. data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-build.sample +51 -0
  123. data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-connect.sample +47 -0
  124. data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-deploy.sample +109 -0
  125. data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-proxy-reboot.sample +3 -0
  126. data/sandbox/itsi_sandbox_rails/.kamal/secrets +17 -0
  127. data/sandbox/itsi_sandbox_rails/.rubocop.yml +8 -0
  128. data/sandbox/itsi_sandbox_rails/.ruby-version +1 -0
  129. data/sandbox/itsi_sandbox_rails/Dockerfile +72 -0
  130. data/sandbox/itsi_sandbox_rails/Gemfile +72 -0
  131. data/sandbox/itsi_sandbox_rails/Gemfile.lock +480 -0
  132. data/sandbox/itsi_sandbox_rails/README.md +24 -0
  133. data/sandbox/itsi_sandbox_rails/Rakefile +6 -0
  134. data/sandbox/itsi_sandbox_rails/app/assets/images/.keep +0 -0
  135. data/sandbox/itsi_sandbox_rails/app/assets/stylesheets/application.css +10 -0
  136. data/sandbox/itsi_sandbox_rails/app/controllers/application_controller.rb +4 -0
  137. data/sandbox/itsi_sandbox_rails/app/controllers/concerns/.keep +0 -0
  138. data/sandbox/itsi_sandbox_rails/app/controllers/home_controller.rb +51 -0
  139. data/sandbox/itsi_sandbox_rails/app/controllers/live_controller.rb +41 -0
  140. data/sandbox/itsi_sandbox_rails/app/controllers/uploads_controller.rb +32 -0
  141. data/sandbox/itsi_sandbox_rails/app/helpers/application_helper.rb +2 -0
  142. data/sandbox/itsi_sandbox_rails/app/javascript/application.js +3 -0
  143. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/application.js +9 -0
  144. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/hello_controller.js +7 -0
  145. data/sandbox/itsi_sandbox_rails/app/javascript/controllers/index.js +4 -0
  146. data/sandbox/itsi_sandbox_rails/app/jobs/application_job.rb +7 -0
  147. data/sandbox/itsi_sandbox_rails/app/mailers/application_mailer.rb +4 -0
  148. data/sandbox/itsi_sandbox_rails/app/models/application_record.rb +3 -0
  149. data/sandbox/itsi_sandbox_rails/app/models/concerns/.keep +0 -0
  150. data/sandbox/itsi_sandbox_rails/app/models/post.rb +2 -0
  151. data/sandbox/itsi_sandbox_rails/app/views/layouts/application.html.erb +28 -0
  152. data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.html.erb +13 -0
  153. data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.text.erb +1 -0
  154. data/sandbox/itsi_sandbox_rails/app/views/pwa/manifest.json.erb +22 -0
  155. data/sandbox/itsi_sandbox_rails/app/views/pwa/service-worker.js +26 -0
  156. data/sandbox/itsi_sandbox_rails/bin/brakeman +7 -0
  157. data/sandbox/itsi_sandbox_rails/bin/bundle +109 -0
  158. data/sandbox/itsi_sandbox_rails/bin/dev +2 -0
  159. data/sandbox/itsi_sandbox_rails/bin/docker-entrypoint +14 -0
  160. data/sandbox/itsi_sandbox_rails/bin/importmap +4 -0
  161. data/sandbox/itsi_sandbox_rails/bin/jobs +6 -0
  162. data/sandbox/itsi_sandbox_rails/bin/kamal +27 -0
  163. data/sandbox/itsi_sandbox_rails/bin/rails +4 -0
  164. data/sandbox/itsi_sandbox_rails/bin/rake +4 -0
  165. data/sandbox/itsi_sandbox_rails/bin/rubocop +8 -0
  166. data/sandbox/itsi_sandbox_rails/bin/setup +34 -0
  167. data/sandbox/itsi_sandbox_rails/bin/thrust +5 -0
  168. data/sandbox/itsi_sandbox_rails/config/application.rb +61 -0
  169. data/sandbox/itsi_sandbox_rails/config/boot.rb +4 -0
  170. data/sandbox/itsi_sandbox_rails/config/cable.yml +17 -0
  171. data/sandbox/itsi_sandbox_rails/config/cache.yml +16 -0
  172. data/sandbox/itsi_sandbox_rails/config/credentials.yml.enc +1 -0
  173. data/sandbox/itsi_sandbox_rails/config/database.yml +40 -0
  174. data/sandbox/itsi_sandbox_rails/config/deploy.yml +116 -0
  175. data/sandbox/itsi_sandbox_rails/config/environment.rb +5 -0
  176. data/sandbox/itsi_sandbox_rails/config/environments/development.rb +72 -0
  177. data/sandbox/itsi_sandbox_rails/config/environments/production.rb +90 -0
  178. data/sandbox/itsi_sandbox_rails/config/environments/test.rb +53 -0
  179. data/sandbox/itsi_sandbox_rails/config/importmap.rb +7 -0
  180. data/sandbox/itsi_sandbox_rails/config/initializers/assets.rb +7 -0
  181. data/sandbox/itsi_sandbox_rails/config/initializers/content_security_policy.rb +25 -0
  182. data/sandbox/itsi_sandbox_rails/config/initializers/filter_parameter_logging.rb +8 -0
  183. data/sandbox/itsi_sandbox_rails/config/initializers/inflections.rb +16 -0
  184. data/sandbox/itsi_sandbox_rails/config/locales/en.yml +31 -0
  185. data/sandbox/itsi_sandbox_rails/config/puma.rb +41 -0
  186. data/sandbox/itsi_sandbox_rails/config/queue.yml +18 -0
  187. data/sandbox/itsi_sandbox_rails/config/recurring.yml +10 -0
  188. data/sandbox/itsi_sandbox_rails/config/routes.rb +21 -0
  189. data/sandbox/itsi_sandbox_rails/config/storage.yml +34 -0
  190. data/sandbox/itsi_sandbox_rails/config.ru +7 -0
  191. data/sandbox/itsi_sandbox_rails/db/cable_schema.rb +11 -0
  192. data/sandbox/itsi_sandbox_rails/db/cache_schema.rb +14 -0
  193. data/sandbox/itsi_sandbox_rails/db/migrate/20250301041554_create_posts.rb +10 -0
  194. data/sandbox/itsi_sandbox_rails/db/queue_schema.rb +129 -0
  195. data/sandbox/itsi_sandbox_rails/db/schema.rb +23 -0
  196. data/sandbox/itsi_sandbox_rails/db/seeds.rb +9 -0
  197. data/sandbox/itsi_sandbox_rails/lib/tasks/.keep +0 -0
  198. data/sandbox/itsi_sandbox_rails/log/.keep +0 -0
  199. data/sandbox/itsi_sandbox_rails/public/400.html +114 -0
  200. data/sandbox/itsi_sandbox_rails/public/404.html +114 -0
  201. data/sandbox/itsi_sandbox_rails/public/406-unsupported-browser.html +114 -0
  202. data/sandbox/itsi_sandbox_rails/public/422.html +114 -0
  203. data/sandbox/itsi_sandbox_rails/public/500.html +114 -0
  204. data/sandbox/itsi_sandbox_rails/public/icon.png +0 -0
  205. data/sandbox/itsi_sandbox_rails/public/icon.svg +3 -0
  206. data/sandbox/itsi_sandbox_rails/public/robots.txt +1 -0
  207. data/sandbox/itsi_sandbox_rails/script/.keep +0 -0
  208. data/sandbox/itsi_sandbox_rails/storage/.keep +0 -0
  209. data/sandbox/itsi_sandbox_rails/test/application_system_test_case.rb +5 -0
  210. data/sandbox/itsi_sandbox_rails/test/controllers/.keep +0 -0
  211. data/sandbox/itsi_sandbox_rails/test/fixtures/files/.keep +0 -0
  212. data/sandbox/itsi_sandbox_rails/test/fixtures/posts.yml +9 -0
  213. data/sandbox/itsi_sandbox_rails/test/helpers/.keep +0 -0
  214. data/sandbox/itsi_sandbox_rails/test/integration/.keep +0 -0
  215. data/sandbox/itsi_sandbox_rails/test/mailers/.keep +0 -0
  216. data/sandbox/itsi_sandbox_rails/test/models/.keep +0 -0
  217. data/sandbox/itsi_sandbox_rails/test/models/post_test.rb +7 -0
  218. data/sandbox/itsi_sandbox_rails/test/system/.keep +0 -0
  219. data/sandbox/itsi_sandbox_rails/test/test_helper.rb +15 -0
  220. data/sandbox/itsi_sandbox_rails/tmp/.keep +0 -0
  221. data/sandbox/itsi_sandbox_rails/tmp/pids/.keep +0 -0
  222. data/sandbox/itsi_sandbox_rails/tmp/storage/.keep +0 -0
  223. data/sandbox/itsi_sandbox_rails/vendor/.keep +0 -0
  224. data/sandbox/itsi_sandbox_rails/vendor/javascript/.keep +0 -0
  225. data/sandbox/itsi_sandbox_roda/Gemfile +5 -0
  226. data/sandbox/itsi_sandbox_roda/Gemfile.lock +44 -0
  227. data/sandbox/itsi_sandbox_roda/config.ru +39 -0
  228. data/sandbox/itsi_sinatra/Gemfile +9 -0
  229. data/sandbox/itsi_sinatra/Gemfile.lock +81 -0
  230. data/sandbox/itsi_sinatra/app.rb +9 -0
  231. data/sandbox/pebble/docker-compose.yml +11 -0
  232. data/tasks.txt +10 -4
  233. metadata +196 -12
  234. data/crates/itsi_server/src/server/itsi_ca/itsi_ca.crt +0 -13
  235. data/crates/itsi_server/src/server/itsi_ca/itsi_ca.key +0 -5
  236. data/gems/scheduler/ext/itsi_server/src/server/itsi_ca/itsi_ca.crt +0 -13
  237. data/gems/scheduler/ext/itsi_server/src/server/itsi_ca/itsi_ca.key +0 -5
  238. data/gems/server/ext/itsi_server/src/server/itsi_ca/itsi_ca.crt +0 -13
  239. data/gems/server/ext/itsi_server/src/server/itsi_ca/itsi_ca.key +0 -5
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "itsi_hanami",
3
+ "private": true,
4
+ "type": "module",
5
+ "dependencies": {
6
+ "hanami-assets": "^2.2.1"
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe "Root", type: :request do
4
+ it "is not found" do
5
+ get "/"
6
+
7
+ # Generate new action via:
8
+ # `bundle exec hanami generate action home.index --url=/`
9
+ expect(last_response.status).to be(404)
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ SPEC_ROOT = Pathname(__dir__).realpath.freeze
5
+
6
+ ENV["HANAMI_ENV"] ||= "test"
7
+ require "hanami/prepare"
8
+
9
+ SPEC_ROOT.glob("support/**/*.rb").each { |f| require f }
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "database_cleaner/sequel"
4
+
5
+ # Clean the databases between tests tagged as `:db`
6
+ RSpec.configure do |config|
7
+ # Returns all the configured databases across the app and its slices.
8
+ #
9
+ # Used in the before/after hooks below to ensure each database is cleaned between examples.
10
+ #
11
+ # Modify this proc (or any code below) if you only need specific databases cleaned.
12
+ all_databases = -> {
13
+ slices = [Hanami.app] + Hanami.app.slices.with_nested
14
+
15
+ slices.each_with_object([]) { |slice, dbs|
16
+ next unless slice.key?("db.rom")
17
+
18
+ dbs.concat slice["db.rom"].gateways.values.map(&:connection)
19
+ }.uniq
20
+ }
21
+
22
+ config.before :suite do
23
+ all_databases.call.each do |db|
24
+ DatabaseCleaner[:sequel, db: db].clean_with :truncation, except: ["schema_migrations"]
25
+ end
26
+ end
27
+
28
+ config.before :each, :db do |example|
29
+ strategy = example.metadata[:js] ? :truncation : :transaction
30
+
31
+ all_databases.call.each do |db|
32
+ DatabaseCleaner[:sequel, db: db].strategy = strategy
33
+ DatabaseCleaner[:sequel, db: db].start
34
+ end
35
+ end
36
+
37
+ config.after :each, :db do
38
+ all_databases.call.each do |db|
39
+ DatabaseCleaner[:sequel, db: db].clean
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Tag feature spec examples as `:db`
4
+ #
5
+ # See support/db/cleaning.rb for how the database is cleaned around these `:db` examples.
6
+ RSpec.configure do |config|
7
+ config.define_derived_metadata(type: :feature) do |metadata|
8
+ metadata[:db] = true
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "capybara/rspec"
4
+
5
+ Capybara.app = Hanami.app
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry/monads"
4
+
5
+ RSpec.configure do |config|
6
+ # Provide `Success` and `Failure` for testing operation results
7
+ config.include Dry::Monads[:result]
8
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rack/test"
4
+
5
+ RSpec.shared_context "Rack::Test" do
6
+ # Define the app for Rack::Test requests
7
+ let(:app) { Hanami.app }
8
+ end
9
+
10
+ RSpec.configure do |config|
11
+ config.include Rack::Test::Methods, type: :request
12
+ config.include_context "Rack::Test", type: :request
13
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ # Use the recommended non-monkey patched syntax.
5
+ config.disable_monkey_patching!
6
+
7
+ # Use and configure rspec-expectations.
8
+ config.expect_with :rspec do |expectations|
9
+ # This option will default to `true` in RSpec 4.
10
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
11
+ end
12
+
13
+ # Use and configure rspec-mocks.
14
+ config.mock_with :rspec do |mocks|
15
+ # Prevents you from mocking or stubbing a method that does not exist on a
16
+ # real object.
17
+ mocks.verify_partial_doubles = true
18
+ end
19
+
20
+ # This option will default to `:apply_to_host_groups` in RSpec 4.
21
+ config.shared_context_metadata_behavior = :apply_to_host_groups
22
+
23
+ # Limit a spec run to individual examples or groups you care about by tagging
24
+ # them with `:focus` metadata. When nothing is tagged with `:focus`, all
25
+ # examples get run.
26
+ #
27
+ # RSpec also provides aliases for `it`, `describe`, and `context` that include
28
+ # `:focus` metadata: `fit`, `fdescribe` and `fcontext`, respectively.
29
+ config.filter_run_when_matching :focus
30
+
31
+ # Allow RSpec to persist some state between runs in order to support the
32
+ # `--only-failures` and `--next-failure` CLI options. We recommend you
33
+ # configure your source control system to ignore this file.
34
+ config.example_status_persistence_file_path = "spec/examples.txt"
35
+
36
+ # Uncomment this to enable warnings. This is recommended, but in some cases
37
+ # may be too noisy due to issues in dependencies.
38
+ # config.warnings = true
39
+
40
+ # Show more verbose output when running an individual spec file.
41
+ if config.files_to_run.one?
42
+ config.default_formatter = "doc"
43
+ end
44
+
45
+ # Print the 10 slowest examples and example groups at the end of the spec run,
46
+ # to help surface which specs are running particularly slow.
47
+ config.profile_examples = 10
48
+
49
+ # Run specs in random order to surface order dependencies. If you find an
50
+ # order dependency and want to debug it, you can fix the order by providing
51
+ # the seed, which is printed after each run:
52
+ #
53
+ # --seed 1234
54
+ config.order = :random
55
+
56
+ # Seed global randomization in this process using the `--seed` CLI option.
57
+ # This allows you to use `--seed` to deterministically reproduce test failures
58
+ # related to randomization by passing the same `--seed` value as the one that
59
+ # triggered the failure.
60
+ Kernel.srand config.seed
61
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # gem "rails"
6
+
7
+ gem "itsi-server", path: "../../gems/server"
8
+ gem "itsi-scheduler", path: "../../gems/scheduler"
9
+
10
+ gem 'unicorn'
11
+ gem 'pitchfork'
12
+ gem 'async'
13
+ gem 'falcon'
14
+ gem 'agoo'
15
+ gem 'iodine'
16
+ gem 'debug'
17
+ gem 'pry-byebug'
@@ -0,0 +1,153 @@
1
+ PATH
2
+ remote: ../../gems/scheduler
3
+ specs:
4
+ itsi-scheduler (0.1.7)
5
+ rb_sys (~> 0.9.91)
6
+
7
+ PATH
8
+ remote: ../../gems/server
9
+ specs:
10
+ itsi-server (0.1.7)
11
+ rack (>= 1.6)
12
+ rb_sys (~> 0.9.91)
13
+
14
+ GEM
15
+ remote: https://rubygems.org/
16
+ specs:
17
+ agoo (2.15.13)
18
+ async (2.23.0)
19
+ console (~> 1.29)
20
+ fiber-annotation
21
+ io-event (~> 1.9)
22
+ metrics (~> 0.12)
23
+ traces (~> 0.15)
24
+ async-container (0.24.0)
25
+ async (~> 2.22)
26
+ async-container-supervisor (0.5.1)
27
+ async-container (~> 0.22)
28
+ async-service
29
+ io-endpoint
30
+ memory-leak (~> 0.5)
31
+ async-http (0.87.0)
32
+ async (>= 2.10.2)
33
+ async-pool (~> 0.9)
34
+ io-endpoint (~> 0.14)
35
+ io-stream (~> 0.6)
36
+ metrics (~> 0.12)
37
+ protocol-http (~> 0.49)
38
+ protocol-http1 (~> 0.30)
39
+ protocol-http2 (~> 0.22)
40
+ traces (~> 0.10)
41
+ async-http-cache (0.4.5)
42
+ async-http (~> 0.56)
43
+ async-pool (0.10.3)
44
+ async (>= 1.25)
45
+ async-service (0.13.0)
46
+ async
47
+ async-container (~> 0.16)
48
+ byebug (11.1.3)
49
+ coderay (1.1.3)
50
+ console (1.30.0)
51
+ fiber-annotation
52
+ fiber-local (~> 1.1)
53
+ json
54
+ date (3.4.1)
55
+ debug (1.10.0)
56
+ irb (~> 1.10)
57
+ reline (>= 0.3.8)
58
+ falcon (0.51.1)
59
+ async
60
+ async-container (~> 0.20)
61
+ async-container-supervisor (~> 0.5.0)
62
+ async-http (~> 0.75)
63
+ async-http-cache (~> 0.4)
64
+ async-service (~> 0.10)
65
+ bundler
66
+ localhost (~> 1.1)
67
+ openssl (~> 3.0)
68
+ protocol-http (~> 0.31)
69
+ protocol-rack (~> 0.7)
70
+ samovar (~> 2.3)
71
+ fiber-annotation (0.2.0)
72
+ fiber-local (1.1.0)
73
+ fiber-storage
74
+ fiber-storage (1.0.0)
75
+ io-console (0.8.0)
76
+ io-endpoint (0.15.2)
77
+ io-event (1.9.0)
78
+ io-stream (0.6.1)
79
+ iodine (0.7.58)
80
+ irb (1.15.1)
81
+ pp (>= 0.6.0)
82
+ rdoc (>= 4.0.0)
83
+ reline (>= 0.4.2)
84
+ json (2.10.1)
85
+ kgio (2.11.4)
86
+ localhost (1.3.1)
87
+ logger (1.6.6)
88
+ mapping (1.1.1)
89
+ memory-leak (0.5.2)
90
+ method_source (1.1.0)
91
+ metrics (0.12.2)
92
+ openssl (3.3.0)
93
+ pitchfork (0.16.0)
94
+ logger
95
+ rack (>= 2.0)
96
+ pp (0.6.2)
97
+ prettyprint
98
+ prettyprint (0.2.0)
99
+ protocol-hpack (1.5.1)
100
+ protocol-http (0.49.0)
101
+ protocol-http1 (0.30.0)
102
+ protocol-http (~> 0.22)
103
+ protocol-http2 (0.22.1)
104
+ protocol-hpack (~> 1.4)
105
+ protocol-http (~> 0.47)
106
+ protocol-rack (0.11.2)
107
+ protocol-http (~> 0.43)
108
+ rack (>= 1.0)
109
+ pry (0.14.2)
110
+ coderay (~> 1.1)
111
+ method_source (~> 1.0)
112
+ pry-byebug (3.10.1)
113
+ byebug (~> 11.0)
114
+ pry (>= 0.13, < 0.15)
115
+ psych (5.2.3)
116
+ date
117
+ stringio
118
+ rack (2.2.12)
119
+ raindrops (0.20.1)
120
+ rake-compiler-dock (1.9.1)
121
+ rb_sys (0.9.111)
122
+ rake-compiler-dock (= 1.9.1)
123
+ rdoc (6.12.0)
124
+ psych (>= 4.0.0)
125
+ reline (0.6.0)
126
+ io-console (~> 0.5)
127
+ samovar (2.3.0)
128
+ console (~> 1.0)
129
+ mapping (~> 1.0)
130
+ stringio (3.1.5)
131
+ traces (0.15.2)
132
+ unicorn (6.1.0)
133
+ kgio (~> 2.6)
134
+ raindrops (~> 0.7)
135
+
136
+ PLATFORMS
137
+ arm64-darwin-23
138
+ ruby
139
+
140
+ DEPENDENCIES
141
+ agoo
142
+ async
143
+ debug
144
+ falcon
145
+ iodine
146
+ itsi-scheduler!
147
+ itsi-server!
148
+ pitchfork
149
+ pry-byebug
150
+ unicorn
151
+
152
+ BUNDLED WITH
153
+ 2.6.3
@@ -0,0 +1,18 @@
1
+ require 'itsi/scheduler'
2
+ require 'async'
3
+ require 'debug'
4
+ def looper
5
+ i = 0
6
+ loop do
7
+ i += 1
8
+ yield "#{i}\n"
9
+ end
10
+ end
11
+
12
+ require 'itsi/server'
13
+
14
+ memory_leak = []
15
+
16
+ run lambda { |env|
17
+ [200, { 'Content-Type' => 'text/plain' }, ['foo']]
18
+ }
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # gem "rails"
6
+
7
+ gem "itsi-server", path: "../../gems/server"
@@ -0,0 +1,27 @@
1
+ PATH
2
+ remote: ../../gems/server
3
+ specs:
4
+ itsi-server (0.1.7)
5
+ rack (>= 1.6)
6
+ rb_sys (~> 0.9.91)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ rack (2.2.12)
12
+ rake-compiler-dock (1.9.1)
13
+ rb_sys (0.9.111)
14
+ rake-compiler-dock (= 1.9.1)
15
+
16
+ PLATFORMS
17
+ aarch64-linux
18
+ arm64-darwin
19
+ x86_64-darwin
20
+ x86_64-linux
21
+ x86_64-linux-musl
22
+
23
+ DEPENDENCIES
24
+ itsi-server!
25
+
26
+ BUNDLED WITH
27
+ 2.6.3
@@ -0,0 +1,3 @@
1
+ require 'uri'
2
+ use Rack::Lint
3
+ run ->(env) { [200, { 'content-type' => 'text/plain' }, ['Hello, World!']] }
@@ -0,0 +1,51 @@
1
+ # See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2
+
3
+ # Ignore git directory.
4
+ /.git/
5
+ /.gitignore
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore all environment files.
11
+ /.env*
12
+
13
+ # Ignore all default key files.
14
+ /config/master.key
15
+ /config/credentials/*.key
16
+
17
+ # Ignore all logfiles and tempfiles.
18
+ /log/*
19
+ /tmp/*
20
+ !/log/.keep
21
+ !/tmp/.keep
22
+
23
+ # Ignore pidfiles, but keep the directory.
24
+ /tmp/pids/*
25
+ !/tmp/pids/.keep
26
+
27
+ # Ignore storage (uploaded files in development and any SQLite databases).
28
+ /storage/*
29
+ !/storage/.keep
30
+ /tmp/storage/*
31
+ !/tmp/storage/.keep
32
+
33
+ # Ignore assets.
34
+ /node_modules/
35
+ /app/assets/builds/*
36
+ !/app/assets/builds/.keep
37
+ /public/assets
38
+
39
+ # Ignore CI service files.
40
+ /.github
41
+
42
+ # Ignore Kamal files.
43
+ /config/deploy*.yml
44
+ /.kamal
45
+
46
+ # Ignore development files
47
+ /.devcontainer
48
+
49
+ # Ignore Docker-related files
50
+ /.dockerignore
51
+ /Dockerfile*
@@ -0,0 +1,9 @@
1
+ # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
+
3
+ # Mark the database schema as having been generated.
4
+ db/schema.rb linguist-generated
5
+
6
+ # Mark any vendored files as having been vendored.
7
+ vendor/* linguist-vendored
8
+ config/credentials/*.yml.enc diff=rails_credentials
9
+ config/credentials.yml.enc diff=rails_credentials
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
8
+ - package-ecosystem: github-actions
9
+ directory: "/"
10
+ schedule:
11
+ interval: daily
12
+ open-pull-requests-limit: 10
@@ -0,0 +1,90 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [ main ]
7
+
8
+ jobs:
9
+ scan_ruby:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: .ruby-version
20
+ bundler-cache: true
21
+
22
+ - name: Scan for common Rails security vulnerabilities using static analysis
23
+ run: bin/brakeman --no-pager
24
+
25
+ scan_js:
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - name: Checkout code
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: .ruby-version
36
+ bundler-cache: true
37
+
38
+ - name: Scan for security vulnerabilities in JavaScript dependencies
39
+ run: bin/importmap audit
40
+
41
+ lint:
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - name: Checkout code
45
+ uses: actions/checkout@v4
46
+
47
+ - name: Set up Ruby
48
+ uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: .ruby-version
51
+ bundler-cache: true
52
+
53
+ - name: Lint code for consistent style
54
+ run: bin/rubocop -f github
55
+
56
+ test:
57
+ runs-on: ubuntu-latest
58
+
59
+ # services:
60
+ # redis:
61
+ # image: redis
62
+ # ports:
63
+ # - 6379:6379
64
+ # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
65
+ steps:
66
+ - name: Install packages
67
+ run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config google-chrome-stable
68
+
69
+ - name: Checkout code
70
+ uses: actions/checkout@v4
71
+
72
+ - name: Set up Ruby
73
+ uses: ruby/setup-ruby@v1
74
+ with:
75
+ ruby-version: .ruby-version
76
+ bundler-cache: true
77
+
78
+ - name: Run tests
79
+ env:
80
+ RAILS_ENV: test
81
+ # REDIS_URL: redis://localhost:6379/0
82
+ run: bin/rails db:test:prepare test test:system
83
+
84
+ - name: Keep screenshots from failed system tests
85
+ uses: actions/upload-artifact@v4
86
+ if: failure()
87
+ with:
88
+ name: screenshots
89
+ path: ${{ github.workspace }}/tmp/screenshots
90
+ if-no-files-found: ignore
@@ -0,0 +1,34 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # Temporary files generated by your text editor or operating system
4
+ # belong in git's global ignore instead:
5
+ # `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore all environment files.
11
+ /.env*
12
+
13
+ # Ignore all logfiles and tempfiles.
14
+ /log/*
15
+ /tmp/*
16
+ !/log/.keep
17
+ !/tmp/.keep
18
+
19
+ # Ignore pidfiles, but keep the directory.
20
+ /tmp/pids/*
21
+ !/tmp/pids/
22
+ !/tmp/pids/.keep
23
+
24
+ # Ignore storage (uploaded files in development and any SQLite databases).
25
+ /storage/*
26
+ !/storage/.keep
27
+ /tmp/storage/*
28
+ !/tmp/storage/
29
+ !/tmp/storage/.keep
30
+
31
+ /public/assets
32
+
33
+ # Ignore master key for decrypting credentials and more.
34
+ /config/master.key
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo "Docker set up on $KAMAL_HOSTS..."
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo "Booted app version $KAMAL_VERSION on $KAMAL_HOSTS..."
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+
3
+ # A sample post-deploy hook
4
+ #
5
+ # These environment variables are available:
6
+ # KAMAL_RECORDED_AT
7
+ # KAMAL_PERFORMER
8
+ # KAMAL_VERSION
9
+ # KAMAL_HOSTS
10
+ # KAMAL_ROLE (if set)
11
+ # KAMAL_DESTINATION (if set)
12
+ # KAMAL_RUNTIME
13
+
14
+ echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds"
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo "Rebooted kamal-proxy on $KAMAL_HOSTS"
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo "Booting app version $KAMAL_VERSION on $KAMAL_HOSTS..."