itsi 0.1.7 → 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.
- checksums.yaml +4 -4
- data/Rakefile +20 -0
- data/crates/itsi_error/src/from.rs +26 -29
- data/crates/itsi_server/Cargo.lock +2956 -0
- data/crates/itsi_server/Cargo.toml +1 -1
- data/crates/itsi_server/src/request/itsi_request.rs +7 -7
- data/crates/itsi_server/src/server/bind.rs +4 -3
- data/crates/itsi_server/src/server/itsi_server.rs +1 -8
- data/crates/itsi_server/src/server/listener.rs +98 -107
- data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
- data/crates/itsi_server/src/server/tls.rs +9 -5
- data/gems/scheduler/ext/itsi_error/src/from.rs +26 -29
- data/gems/scheduler/ext/itsi_server/Cargo.lock +2956 -0
- data/gems/scheduler/ext/itsi_server/Cargo.toml +1 -1
- data/gems/scheduler/ext/itsi_server/src/request/itsi_request.rs +7 -7
- data/gems/scheduler/ext/itsi_server/src/server/bind.rs +4 -3
- data/gems/scheduler/ext/itsi_server/src/server/itsi_server.rs +1 -8
- data/gems/scheduler/ext/itsi_server/src/server/listener.rs +98 -107
- data/gems/scheduler/ext/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
- data/gems/scheduler/ext/itsi_server/src/server/tls.rs +9 -5
- data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
- data/gems/server/Cargo.lock +2917 -0
- data/gems/server/Cargo.toml +7 -0
- data/gems/server/ext/itsi_error/src/from.rs +26 -29
- data/gems/server/ext/itsi_server/Cargo.lock +2956 -0
- data/gems/server/ext/itsi_server/Cargo.toml +1 -1
- data/gems/server/ext/itsi_server/src/request/itsi_request.rs +7 -7
- data/gems/server/ext/itsi_server/src/server/bind.rs +4 -3
- data/gems/server/ext/itsi_server/src/server/itsi_server.rs +1 -8
- data/gems/server/ext/itsi_server/src/server/listener.rs +98 -107
- data/gems/server/ext/itsi_server/src/server/serve_strategy/single_mode.rs +22 -12
- data/gems/server/ext/itsi_server/src/server/tls.rs +9 -5
- data/gems/server/lib/itsi/index.html.erb +91 -0
- data/gems/server/lib/itsi/server/scheduler_mode.rb +1 -1
- data/gems/server/lib/itsi/server/version.rb +1 -1
- data/gems/server/lib/itsi/server.rb +22 -2
- data/lib/itsi/version.rb +1 -1
- data/sandbox/deploy/main.tf +237 -0
- data/sandbox/deploy/outputs.tf +4 -0
- data/sandbox/deploy/vars.tf +11 -0
- data/sandbox/falcon_benchmark/Gemfile +10 -0
- data/sandbox/falcon_benchmark/Gemfile.lock +140 -0
- data/sandbox/falcon_benchmark/config.ru +54 -0
- data/sandbox/itsi_sandbox_async/Gemfile +10 -0
- data/sandbox/itsi_sandbox_async/Gemfile.lock +69 -0
- data/sandbox/itsi_sandbox_async/config.ru +10 -0
- data/sandbox/itsi_sandbox_hanami/.env +2 -0
- data/sandbox/itsi_sandbox_hanami/.gitignore +6 -0
- data/sandbox/itsi_sandbox_hanami/.rspec +1 -0
- data/sandbox/itsi_sandbox_hanami/Gemfile +49 -0
- data/sandbox/itsi_sandbox_hanami/Gemfile.lock +440 -0
- data/sandbox/itsi_sandbox_hanami/Guardfile +9 -0
- data/sandbox/itsi_sandbox_hanami/Procfile.dev +2 -0
- data/sandbox/itsi_sandbox_hanami/README.md +1 -0
- data/sandbox/itsi_sandbox_hanami/Rakefile +3 -0
- data/sandbox/itsi_sandbox_hanami/app/action.rb +12 -0
- data/sandbox/itsi_sandbox_hanami/app/actions/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/app/assets/css/app.css +5 -0
- data/sandbox/itsi_sandbox_hanami/app/assets/images/favicon.ico +0 -0
- data/sandbox/itsi_sandbox_hanami/app/assets/js/app.js +1 -0
- data/sandbox/itsi_sandbox_hanami/app/db/relation.rb +10 -0
- data/sandbox/itsi_sandbox_hanami/app/db/repo.rb +10 -0
- data/sandbox/itsi_sandbox_hanami/app/db/struct.rb +10 -0
- data/sandbox/itsi_sandbox_hanami/app/operation.rb +9 -0
- data/sandbox/itsi_sandbox_hanami/app/relations/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/app/repos/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/app/structs/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/app/templates/layouts/app.html.erb +14 -0
- data/sandbox/itsi_sandbox_hanami/app/view.rb +9 -0
- data/sandbox/itsi_sandbox_hanami/app/views/helpers.rb +10 -0
- data/sandbox/itsi_sandbox_hanami/bin/dev +8 -0
- data/sandbox/itsi_sandbox_hanami/config/app.rb +8 -0
- data/sandbox/itsi_sandbox_hanami/config/assets.js +16 -0
- data/sandbox/itsi_sandbox_hanami/config/db/migrate/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/config/db/seeds.rb +15 -0
- data/sandbox/itsi_sandbox_hanami/config/puma.rb +47 -0
- data/sandbox/itsi_sandbox_hanami/config/routes.rb +7 -0
- data/sandbox/itsi_sandbox_hanami/config/settings.rb +9 -0
- data/sandbox/itsi_sandbox_hanami/config.ru +5 -0
- data/sandbox/itsi_sandbox_hanami/db/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/lib/itsi_hanami/types.rb +11 -0
- data/sandbox/itsi_sandbox_hanami/lib/tasks/.keep +0 -0
- data/sandbox/itsi_sandbox_hanami/package-lock.json +946 -0
- data/sandbox/itsi_sandbox_hanami/package.json +8 -0
- data/sandbox/itsi_sandbox_hanami/spec/requests/root_spec.rb +11 -0
- data/sandbox/itsi_sandbox_hanami/spec/spec_helper.rb +9 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/db/cleaning.rb +42 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/db.rb +10 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/features.rb +5 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/operations.rb +8 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/requests.rb +13 -0
- data/sandbox/itsi_sandbox_hanami/spec/support/rspec.rb +61 -0
- data/sandbox/itsi_sandbox_rack/Gemfile +17 -0
- data/sandbox/itsi_sandbox_rack/Gemfile.lock +153 -0
- data/sandbox/itsi_sandbox_rack/config.ru +18 -0
- data/sandbox/itsi_sandbox_rack_lint/Gemfile +7 -0
- data/sandbox/itsi_sandbox_rack_lint/Gemfile.lock +27 -0
- data/sandbox/itsi_sandbox_rack_lint/config.ru +3 -0
- data/sandbox/itsi_sandbox_rails/.dockerignore +51 -0
- data/sandbox/itsi_sandbox_rails/.gitattributes +9 -0
- data/sandbox/itsi_sandbox_rails/.github/dependabot.yml +12 -0
- data/sandbox/itsi_sandbox_rails/.github/workflows/ci.yml +90 -0
- data/sandbox/itsi_sandbox_rails/.gitignore +34 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/docker-setup.sample +3 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-app-boot.sample +3 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-deploy.sample +14 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-proxy-reboot.sample +3 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-app-boot.sample +3 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-build.sample +51 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-connect.sample +47 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-deploy.sample +109 -0
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-proxy-reboot.sample +3 -0
- data/sandbox/itsi_sandbox_rails/.kamal/secrets +17 -0
- data/sandbox/itsi_sandbox_rails/.rubocop.yml +8 -0
- data/sandbox/itsi_sandbox_rails/.ruby-version +1 -0
- data/sandbox/itsi_sandbox_rails/Dockerfile +72 -0
- data/sandbox/itsi_sandbox_rails/Gemfile +72 -0
- data/sandbox/itsi_sandbox_rails/Gemfile.lock +480 -0
- data/sandbox/itsi_sandbox_rails/README.md +24 -0
- data/sandbox/itsi_sandbox_rails/Rakefile +6 -0
- data/sandbox/itsi_sandbox_rails/app/assets/images/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/app/assets/stylesheets/application.css +10 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/application_controller.rb +4 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/concerns/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/home_controller.rb +51 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/live_controller.rb +41 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/uploads_controller.rb +32 -0
- data/sandbox/itsi_sandbox_rails/app/helpers/application_helper.rb +2 -0
- data/sandbox/itsi_sandbox_rails/app/javascript/application.js +3 -0
- data/sandbox/itsi_sandbox_rails/app/javascript/controllers/application.js +9 -0
- data/sandbox/itsi_sandbox_rails/app/javascript/controllers/hello_controller.js +7 -0
- data/sandbox/itsi_sandbox_rails/app/javascript/controllers/index.js +4 -0
- data/sandbox/itsi_sandbox_rails/app/jobs/application_job.rb +7 -0
- data/sandbox/itsi_sandbox_rails/app/mailers/application_mailer.rb +4 -0
- data/sandbox/itsi_sandbox_rails/app/models/application_record.rb +3 -0
- data/sandbox/itsi_sandbox_rails/app/models/concerns/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/app/models/post.rb +2 -0
- data/sandbox/itsi_sandbox_rails/app/views/layouts/application.html.erb +28 -0
- data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.html.erb +13 -0
- data/sandbox/itsi_sandbox_rails/app/views/layouts/mailer.text.erb +1 -0
- data/sandbox/itsi_sandbox_rails/app/views/pwa/manifest.json.erb +22 -0
- data/sandbox/itsi_sandbox_rails/app/views/pwa/service-worker.js +26 -0
- data/sandbox/itsi_sandbox_rails/bin/brakeman +7 -0
- data/sandbox/itsi_sandbox_rails/bin/bundle +109 -0
- data/sandbox/itsi_sandbox_rails/bin/dev +2 -0
- data/sandbox/itsi_sandbox_rails/bin/docker-entrypoint +14 -0
- data/sandbox/itsi_sandbox_rails/bin/importmap +4 -0
- data/sandbox/itsi_sandbox_rails/bin/jobs +6 -0
- data/sandbox/itsi_sandbox_rails/bin/kamal +27 -0
- data/sandbox/itsi_sandbox_rails/bin/rails +4 -0
- data/sandbox/itsi_sandbox_rails/bin/rake +4 -0
- data/sandbox/itsi_sandbox_rails/bin/rubocop +8 -0
- data/sandbox/itsi_sandbox_rails/bin/setup +34 -0
- data/sandbox/itsi_sandbox_rails/bin/thrust +5 -0
- data/sandbox/itsi_sandbox_rails/config/application.rb +61 -0
- data/sandbox/itsi_sandbox_rails/config/boot.rb +4 -0
- data/sandbox/itsi_sandbox_rails/config/cable.yml +17 -0
- data/sandbox/itsi_sandbox_rails/config/cache.yml +16 -0
- data/sandbox/itsi_sandbox_rails/config/credentials.yml.enc +1 -0
- data/sandbox/itsi_sandbox_rails/config/database.yml +40 -0
- data/sandbox/itsi_sandbox_rails/config/deploy.yml +116 -0
- data/sandbox/itsi_sandbox_rails/config/environment.rb +5 -0
- data/sandbox/itsi_sandbox_rails/config/environments/development.rb +72 -0
- data/sandbox/itsi_sandbox_rails/config/environments/production.rb +90 -0
- data/sandbox/itsi_sandbox_rails/config/environments/test.rb +53 -0
- data/sandbox/itsi_sandbox_rails/config/importmap.rb +7 -0
- data/sandbox/itsi_sandbox_rails/config/initializers/assets.rb +7 -0
- data/sandbox/itsi_sandbox_rails/config/initializers/content_security_policy.rb +25 -0
- data/sandbox/itsi_sandbox_rails/config/initializers/filter_parameter_logging.rb +8 -0
- data/sandbox/itsi_sandbox_rails/config/initializers/inflections.rb +16 -0
- data/sandbox/itsi_sandbox_rails/config/locales/en.yml +31 -0
- data/sandbox/itsi_sandbox_rails/config/puma.rb +41 -0
- data/sandbox/itsi_sandbox_rails/config/queue.yml +18 -0
- data/sandbox/itsi_sandbox_rails/config/recurring.yml +10 -0
- data/sandbox/itsi_sandbox_rails/config/routes.rb +21 -0
- data/sandbox/itsi_sandbox_rails/config/storage.yml +34 -0
- data/sandbox/itsi_sandbox_rails/config.ru +7 -0
- data/sandbox/itsi_sandbox_rails/db/cable_schema.rb +11 -0
- data/sandbox/itsi_sandbox_rails/db/cache_schema.rb +14 -0
- data/sandbox/itsi_sandbox_rails/db/migrate/20250301041554_create_posts.rb +10 -0
- data/sandbox/itsi_sandbox_rails/db/queue_schema.rb +129 -0
- data/sandbox/itsi_sandbox_rails/db/schema.rb +23 -0
- data/sandbox/itsi_sandbox_rails/db/seeds.rb +9 -0
- data/sandbox/itsi_sandbox_rails/lib/tasks/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/log/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/public/400.html +114 -0
- data/sandbox/itsi_sandbox_rails/public/404.html +114 -0
- data/sandbox/itsi_sandbox_rails/public/406-unsupported-browser.html +114 -0
- data/sandbox/itsi_sandbox_rails/public/422.html +114 -0
- data/sandbox/itsi_sandbox_rails/public/500.html +114 -0
- data/sandbox/itsi_sandbox_rails/public/icon.png +0 -0
- data/sandbox/itsi_sandbox_rails/public/icon.svg +3 -0
- data/sandbox/itsi_sandbox_rails/public/robots.txt +1 -0
- data/sandbox/itsi_sandbox_rails/script/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/storage/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/application_system_test_case.rb +5 -0
- data/sandbox/itsi_sandbox_rails/test/controllers/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/fixtures/files/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/fixtures/posts.yml +9 -0
- data/sandbox/itsi_sandbox_rails/test/helpers/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/integration/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/mailers/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/models/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/models/post_test.rb +7 -0
- data/sandbox/itsi_sandbox_rails/test/system/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/test/test_helper.rb +15 -0
- data/sandbox/itsi_sandbox_rails/tmp/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/tmp/pids/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/tmp/storage/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/vendor/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/vendor/javascript/.keep +0 -0
- data/sandbox/itsi_sandbox_roda/Gemfile +5 -0
- data/sandbox/itsi_sandbox_roda/Gemfile.lock +44 -0
- data/sandbox/itsi_sandbox_roda/config.ru +39 -0
- data/sandbox/itsi_sinatra/Gemfile +9 -0
- data/sandbox/itsi_sinatra/Gemfile.lock +81 -0
- data/sandbox/itsi_sinatra/app.rb +9 -0
- data/sandbox/pebble/docker-compose.yml +11 -0
- data/tasks.txt +10 -4
- metadata +192 -5
@@ -1,5 +1,12 @@
|
|
1
|
+
use magnus::{
|
2
|
+
Error,
|
3
|
+
error::ErrorType,
|
4
|
+
exception::{self, arg_error, exception},
|
5
|
+
};
|
6
|
+
use nix::errno::Errno;
|
7
|
+
|
1
8
|
use crate::ItsiError;
|
2
|
-
use std::ffi::NulError;
|
9
|
+
use std::{ffi::NulError, io};
|
3
10
|
|
4
11
|
pub static CLIENT_CONNECTION_CLOSED: &str = "Client disconnected";
|
5
12
|
|
@@ -9,14 +16,14 @@ impl From<httparse::Error> for ItsiError {
|
|
9
16
|
}
|
10
17
|
}
|
11
18
|
|
12
|
-
impl From<
|
13
|
-
fn from(err:
|
19
|
+
impl From<Errno> for ItsiError {
|
20
|
+
fn from(err: Errno) -> Self {
|
14
21
|
ItsiError::ArgumentError(err.to_string())
|
15
22
|
}
|
16
23
|
}
|
17
24
|
|
18
|
-
impl From<
|
19
|
-
fn from(err:
|
25
|
+
impl From<io::Error> for ItsiError {
|
26
|
+
fn from(err: io::Error) -> Self {
|
20
27
|
ItsiError::ArgumentError(err.to_string())
|
21
28
|
}
|
22
29
|
}
|
@@ -33,39 +40,29 @@ impl From<NulError> for ItsiError {
|
|
33
40
|
}
|
34
41
|
}
|
35
42
|
|
36
|
-
impl From<
|
37
|
-
fn from(err:
|
43
|
+
impl From<Error> for ItsiError {
|
44
|
+
fn from(err: Error) -> Self {
|
38
45
|
match err.error_type() {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
magnus::error::ErrorType::Exception(exception) => {
|
44
|
-
ItsiError::ArgumentError(exception.to_string())
|
45
|
-
}
|
46
|
+
ErrorType::Jump(tag) => ItsiError::Jump(tag.to_string()),
|
47
|
+
ErrorType::Error(_exception_class, cow) => ItsiError::ArgumentError(cow.to_string()),
|
48
|
+
ErrorType::Exception(exception) => ItsiError::ArgumentError(exception.to_string()),
|
46
49
|
}
|
47
50
|
}
|
48
51
|
}
|
49
52
|
|
50
|
-
impl From<ItsiError> for
|
53
|
+
impl From<ItsiError> for Error {
|
51
54
|
fn from(err: ItsiError) -> Self {
|
52
55
|
match err {
|
53
|
-
ItsiError::InvalidInput(msg) =>
|
54
|
-
ItsiError::InternalServerError(msg) =>
|
55
|
-
|
56
|
-
|
57
|
-
ItsiError::
|
58
|
-
|
59
|
-
}
|
60
|
-
ItsiError::ArgumentError(msg) => {
|
61
|
-
magnus::Error::new(magnus::exception::arg_error(), msg)
|
62
|
-
}
|
63
|
-
ItsiError::Jump(msg) => magnus::Error::new(magnus::exception::local_jump_error(), msg),
|
64
|
-
ItsiError::Break() => magnus::Error::new(magnus::exception::interrupt(), "Break"),
|
56
|
+
ItsiError::InvalidInput(msg) => Error::new(arg_error(), msg),
|
57
|
+
ItsiError::InternalServerError(msg) => Error::new(exception(), msg),
|
58
|
+
ItsiError::UnsupportedProtocol(msg) => Error::new(arg_error(), msg),
|
59
|
+
ItsiError::ArgumentError(msg) => Error::new(arg_error(), msg),
|
60
|
+
ItsiError::Jump(msg) => Error::new(exception::local_jump_error(), msg),
|
61
|
+
ItsiError::Break() => Error::new(exception::interrupt(), "Break"),
|
65
62
|
ItsiError::ClientConnectionClosed => {
|
66
|
-
|
63
|
+
Error::new(exception::eof_error(), CLIENT_CONNECTION_CLOSED)
|
67
64
|
}
|
68
|
-
ItsiError::Pass() =>
|
65
|
+
ItsiError::Pass() => Error::new(exception::interrupt(), "Pass"),
|
69
66
|
}
|
70
67
|
}
|
71
68
|
}
|