itsi 0.1.9 → 0.1.12
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/Cargo.lock +1542 -43
- data/Itsi.rb +125 -0
- data/Rakefile +8 -4
- data/crates/itsi_error/src/lib.rs +9 -0
- data/crates/itsi_rb_helpers/Cargo.toml +1 -0
- data/crates/itsi_rb_helpers/src/heap_value.rs +18 -0
- data/crates/itsi_rb_helpers/src/lib.rs +59 -9
- data/crates/itsi_server/Cargo.toml +70 -28
- data/crates/itsi_server/src/lib.rs +80 -80
- data/crates/itsi_server/src/{body_proxy → ruby_types/itsi_body_proxy}/big_bytes.rs +10 -5
- data/{gems/server/ext/itsi_server/src/body_proxy/itsi_body_proxy.rs → crates/itsi_server/src/ruby_types/itsi_body_proxy/mod.rs} +22 -3
- data/crates/itsi_server/src/ruby_types/itsi_grpc_request.rs +147 -0
- data/crates/itsi_server/src/ruby_types/itsi_grpc_response.rs +19 -0
- data/crates/itsi_server/src/ruby_types/itsi_grpc_stream/mod.rs +216 -0
- data/crates/itsi_server/src/ruby_types/itsi_http_request.rs +282 -0
- data/crates/itsi_server/src/{response/itsi_response.rs → ruby_types/itsi_http_response.rs} +72 -41
- data/crates/itsi_server/src/ruby_types/itsi_server/file_watcher.rs +225 -0
- data/crates/itsi_server/src/ruby_types/itsi_server/itsi_server_config.rs +355 -0
- data/crates/itsi_server/src/ruby_types/itsi_server.rs +82 -0
- data/crates/itsi_server/src/ruby_types/mod.rs +55 -0
- data/crates/itsi_server/src/server/bind.rs +29 -17
- data/crates/itsi_server/src/server/byte_frame.rs +32 -0
- data/crates/itsi_server/src/server/cache_store.rs +74 -0
- data/crates/itsi_server/src/server/itsi_service.rs +172 -0
- data/crates/itsi_server/src/server/lifecycle_event.rs +3 -0
- data/crates/itsi_server/src/server/listener.rs +111 -11
- data/crates/itsi_server/src/server/middleware_stack/middleware.rs +153 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/allow_list.rs +47 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_api_key.rs +58 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_basic.rs +82 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_jwt.rs +321 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/cache_control.rs +139 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/compression.rs +300 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/cors.rs +287 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/deny_list.rs +48 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/error_response.rs +127 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/etag.rs +191 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/grpc_service.rs +72 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/header_interpretation.rs +85 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/intrusion_protection.rs +195 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/log_requests.rs +82 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/mod.rs +82 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/proxy.rs +216 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/rate_limit.rs +124 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/redirect.rs +76 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/request_headers.rs +43 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/response_headers.rs +34 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/ruby_app.rs +93 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/static_assets.rs +162 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/string_rewrite.rs +158 -0
- data/crates/itsi_server/src/server/middleware_stack/middlewares/token_source.rs +12 -0
- data/crates/itsi_server/src/server/middleware_stack/mod.rs +315 -0
- data/crates/itsi_server/src/server/mod.rs +8 -1
- data/crates/itsi_server/src/server/process_worker.rs +44 -11
- data/crates/itsi_server/src/server/rate_limiter.rs +565 -0
- data/crates/itsi_server/src/server/request_job.rs +11 -0
- data/crates/itsi_server/src/server/serve_strategy/cluster_mode.rs +129 -46
- data/crates/itsi_server/src/server/serve_strategy/mod.rs +9 -6
- data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +325 -167
- data/crates/itsi_server/src/server/signal.rs +20 -4
- data/crates/itsi_server/src/server/static_file_server.rs +984 -0
- data/crates/itsi_server/src/server/thread_worker.rs +165 -88
- data/crates/itsi_server/src/server/tls.rs +1 -1
- data/crates/itsi_server/src/server/types.rs +43 -0
- data/crates/itsi_server/test.md +14 -0
- data/crates/itsi_tracing/Cargo.toml +1 -0
- data/crates/itsi_tracing/src/lib.rs +216 -45
- data/docs/.gitignore +7 -0
- data/docs/.gitpod.yml +15 -0
- data/docs/Itsi.rb +17 -0
- data/docs/content/_index.md +17 -0
- data/docs/content/about.md +6 -0
- data/docs/content/docs/_index.md +18 -0
- data/docs/content/docs/first-page.md +9 -0
- data/docs/content/docs/folder/_index.md +10 -0
- data/docs/content/docs/folder/leaf.md +7 -0
- data/docs/go.mod +5 -0
- data/docs/go.sum +2 -0
- data/docs/hugo.yaml +77 -0
- data/examples/static_assets_example.rb +83 -0
- data/gems/_index.md +18 -0
- data/gems/scheduler/CODE_OF_CONDUCT.md +7 -0
- data/gems/scheduler/Cargo.lock +75 -14
- data/gems/scheduler/README.md +5 -0
- data/gems/scheduler/_index.md +7 -0
- data/gems/scheduler/itsi-scheduler.gemspec +4 -1
- data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
- data/gems/scheduler/lib/itsi/scheduler.rb +2 -2
- data/gems/scheduler/test/test_file_io.rb +0 -1
- data/gems/scheduler/test/test_itsi_scheduler.rb +1 -1
- data/gems/server/CHANGELOG.md +5 -0
- data/gems/server/CODE_OF_CONDUCT.md +7 -0
- data/gems/server/Cargo.lock +1543 -43
- data/gems/server/README.md +4 -0
- data/gems/server/_index.md +6 -0
- data/gems/server/exe/itsi +46 -57
- data/gems/server/itsi-server.gemspec +3 -2
- data/gems/server/lib/itsi/{request.rb → http_request.rb} +29 -5
- data/gems/server/lib/itsi/http_response.rb +39 -0
- data/gems/server/lib/itsi/server/Itsi.rb +119 -0
- data/gems/server/lib/itsi/server/config/dsl.rb +506 -0
- data/gems/server/lib/itsi/server/config.rb +131 -0
- data/gems/server/lib/itsi/server/default_app/default_app.rb +38 -0
- data/gems/server/lib/itsi/server/grpc_interface.rb +213 -0
- data/gems/server/lib/itsi/server/rack/handler/itsi.rb +9 -6
- data/gems/server/lib/itsi/server/rack_interface.rb +24 -9
- data/gems/server/lib/itsi/server/scheduler_interface.rb +1 -1
- data/gems/server/lib/itsi/server/scheduler_mode.rb +4 -0
- data/gems/server/lib/itsi/server/signal_trap.rb +6 -1
- data/gems/server/lib/itsi/server/version.rb +1 -1
- data/gems/server/lib/itsi/server.rb +75 -60
- data/gems/server/lib/itsi/standard_headers.rb +86 -0
- data/gems/server/test/helpers/test_helper.rb +14 -12
- data/gems/server/test/test_itsi_server.rb +21 -2
- data/lib/itsi/version.rb +1 -1
- data/sandbox/itsi_file/Gemfile +11 -0
- data/sandbox/itsi_file/Gemfile.lock +69 -0
- data/sandbox/itsi_file/Itsi.rb +276 -0
- data/sandbox/itsi_file/error.html +2 -0
- data/sandbox/itsi_file/organisations_controller.rb +20 -0
- data/sandbox/itsi_file/public/assets/image.png +0 -0
- data/sandbox/itsi_file/public/assets/index.html +1 -0
- data/sandbox/itsi_sandbox_async/Gemfile +1 -1
- data/sandbox/itsi_sandbox_hanami/Gemfile.lock +2 -2
- data/sandbox/itsi_sandbox_rack/Gemfile.lock +2 -2
- data/sandbox/itsi_sandbox_rack/config.ru +2 -15
- data/sandbox/itsi_sandbox_rails/.dockerignore +2 -5
- data/sandbox/itsi_sandbox_rails/.github/workflows/ci.yml +1 -1
- data/sandbox/itsi_sandbox_rails/.gitignore +2 -1
- data/sandbox/itsi_sandbox_rails/Dockerfile +6 -9
- data/sandbox/itsi_sandbox_rails/Gemfile +16 -22
- data/sandbox/itsi_sandbox_rails/Gemfile.lock +100 -225
- data/sandbox/itsi_sandbox_rails/app/assets/config/manifest.js +4 -0
- data/sandbox/itsi_sandbox_rails/app/assets/stylesheets/application.css +11 -6
- data/sandbox/itsi_sandbox_rails/app/channels/application_cable/channel.rb +4 -0
- data/sandbox/itsi_sandbox_rails/app/channels/application_cable/connection.rb +4 -0
- data/sandbox/itsi_sandbox_rails/app/controllers/live_controller.rb +7 -8
- data/sandbox/itsi_sandbox_rails/app/controllers/uploads_controller.rb +0 -3
- data/sandbox/itsi_sandbox_rails/app/views/layouts/application.html.erb +2 -7
- data/sandbox/itsi_sandbox_rails/bin/docker-entrypoint +3 -4
- data/sandbox/itsi_sandbox_rails/bin/setup +8 -5
- data/sandbox/itsi_sandbox_rails/config/application.rb +1 -35
- data/sandbox/itsi_sandbox_rails/config/cable.yml +3 -10
- data/sandbox/itsi_sandbox_rails/config/credentials.yml.enc +1 -1
- data/sandbox/itsi_sandbox_rails/config/database.yml +9 -19
- data/sandbox/itsi_sandbox_rails/config/environment.rb +1 -1
- data/sandbox/itsi_sandbox_rails/config/environments/development.rb +21 -12
- data/sandbox/itsi_sandbox_rails/config/environments/production.rb +49 -34
- data/sandbox/itsi_sandbox_rails/config/environments/test.rb +19 -5
- data/sandbox/itsi_sandbox_rails/config/initializers/assets.rb +5 -0
- data/sandbox/itsi_sandbox_rails/config/initializers/filter_parameter_logging.rb +1 -1
- data/sandbox/itsi_sandbox_rails/config/initializers/permissions_policy.rb +13 -0
- data/sandbox/itsi_sandbox_rails/config/puma.rb +2 -9
- data/sandbox/itsi_sandbox_rails/config.ru +0 -1
- data/sandbox/itsi_sandbox_rails/db/migrate/20250301041554_create_posts.rb +1 -1
- data/sandbox/itsi_sandbox_rails/db/schema.rb +2 -2
- data/sandbox/itsi_sandbox_rails/lib/assets/.keep +0 -0
- data/sandbox/itsi_sandbox_rails/public/404.html +66 -113
- data/sandbox/itsi_sandbox_rails/public/406-unsupported-browser.html +65 -113
- data/sandbox/itsi_sandbox_rails/public/422.html +66 -113
- data/sandbox/itsi_sandbox_rails/public/500.html +65 -113
- data/sandbox/itsi_sandbox_rails/public/icon.png +0 -0
- data/sandbox/itsi_sandbox_rails/public/icon.svg +2 -2
- data/sandbox/itsi_sandbox_rails/test/channels/application_cable/connection_test.rb +13 -0
- data/sandbox/itsi_sandbox_roda/Gemfile.lock +3 -10
- data/tasks.txt +72 -12
- metadata +94 -139
- data/crates/itsi_server/src/body_proxy/itsi_body_proxy.rs +0 -122
- data/crates/itsi_server/src/body_proxy/mod.rs +0 -2
- data/crates/itsi_server/src/request/itsi_request.rs +0 -305
- data/crates/itsi_server/src/request/mod.rs +0 -1
- data/crates/itsi_server/src/response/mod.rs +0 -1
- data/crates/itsi_server/src/server/itsi_server.rs +0 -294
- data/gems/scheduler/ext/itsi_error/Cargo.lock +0 -368
- data/gems/scheduler/ext/itsi_error/Cargo.toml +0 -11
- data/gems/scheduler/ext/itsi_error/src/from.rs +0 -68
- data/gems/scheduler/ext/itsi_error/src/lib.rs +0 -24
- data/gems/scheduler/ext/itsi_instrument_entry/Cargo.toml +0 -15
- data/gems/scheduler/ext/itsi_instrument_entry/src/lib.rs +0 -31
- data/gems/scheduler/ext/itsi_rb_helpers/Cargo.lock +0 -355
- data/gems/scheduler/ext/itsi_rb_helpers/Cargo.toml +0 -10
- data/gems/scheduler/ext/itsi_rb_helpers/src/heap_value.rs +0 -121
- data/gems/scheduler/ext/itsi_rb_helpers/src/lib.rs +0 -178
- data/gems/scheduler/ext/itsi_scheduler/Cargo.toml +0 -24
- data/gems/scheduler/ext/itsi_scheduler/extconf.rb +0 -6
- data/gems/scheduler/ext/itsi_scheduler/src/itsi_scheduler/io_helpers.rs +0 -56
- data/gems/scheduler/ext/itsi_scheduler/src/itsi_scheduler/io_waiter.rs +0 -44
- data/gems/scheduler/ext/itsi_scheduler/src/itsi_scheduler/timer.rs +0 -44
- data/gems/scheduler/ext/itsi_scheduler/src/itsi_scheduler.rs +0 -308
- data/gems/scheduler/ext/itsi_scheduler/src/lib.rs +0 -38
- data/gems/scheduler/ext/itsi_server/Cargo.lock +0 -2956
- data/gems/scheduler/ext/itsi_server/Cargo.toml +0 -47
- data/gems/scheduler/ext/itsi_server/extconf.rb +0 -6
- data/gems/scheduler/ext/itsi_server/src/body_proxy/big_bytes.rs +0 -104
- data/gems/scheduler/ext/itsi_server/src/body_proxy/itsi_body_proxy.rs +0 -122
- data/gems/scheduler/ext/itsi_server/src/body_proxy/mod.rs +0 -2
- data/gems/scheduler/ext/itsi_server/src/env.rs +0 -43
- data/gems/scheduler/ext/itsi_server/src/lib.rs +0 -112
- data/gems/scheduler/ext/itsi_server/src/request/itsi_request.rs +0 -305
- data/gems/scheduler/ext/itsi_server/src/request/mod.rs +0 -1
- data/gems/scheduler/ext/itsi_server/src/response/itsi_response.rs +0 -357
- data/gems/scheduler/ext/itsi_server/src/response/mod.rs +0 -1
- data/gems/scheduler/ext/itsi_server/src/server/bind.rs +0 -170
- data/gems/scheduler/ext/itsi_server/src/server/bind_protocol.rs +0 -37
- data/gems/scheduler/ext/itsi_server/src/server/io_stream.rs +0 -104
- data/gems/scheduler/ext/itsi_server/src/server/itsi_server.rs +0 -294
- data/gems/scheduler/ext/itsi_server/src/server/lifecycle_event.rs +0 -9
- data/gems/scheduler/ext/itsi_server/src/server/listener.rs +0 -318
- data/gems/scheduler/ext/itsi_server/src/server/mod.rs +0 -11
- data/gems/scheduler/ext/itsi_server/src/server/process_worker.rs +0 -196
- data/gems/scheduler/ext/itsi_server/src/server/serve_strategy/cluster_mode.rs +0 -254
- data/gems/scheduler/ext/itsi_server/src/server/serve_strategy/mod.rs +0 -27
- data/gems/scheduler/ext/itsi_server/src/server/serve_strategy/single_mode.rs +0 -263
- data/gems/scheduler/ext/itsi_server/src/server/signal.rs +0 -77
- data/gems/scheduler/ext/itsi_server/src/server/thread_worker.rs +0 -367
- data/gems/scheduler/ext/itsi_server/src/server/tls/locked_dir_cache.rs +0 -132
- data/gems/scheduler/ext/itsi_server/src/server/tls.rs +0 -265
- data/gems/scheduler/ext/itsi_tracing/Cargo.lock +0 -274
- data/gems/scheduler/ext/itsi_tracing/Cargo.toml +0 -16
- data/gems/scheduler/ext/itsi_tracing/src/lib.rs +0 -58
- data/gems/server/ext/itsi_error/Cargo.lock +0 -368
- data/gems/server/ext/itsi_error/Cargo.toml +0 -11
- data/gems/server/ext/itsi_error/src/from.rs +0 -68
- data/gems/server/ext/itsi_error/src/lib.rs +0 -24
- data/gems/server/ext/itsi_instrument_entry/Cargo.toml +0 -15
- data/gems/server/ext/itsi_instrument_entry/src/lib.rs +0 -31
- data/gems/server/ext/itsi_rb_helpers/Cargo.lock +0 -355
- data/gems/server/ext/itsi_rb_helpers/Cargo.toml +0 -10
- data/gems/server/ext/itsi_rb_helpers/src/heap_value.rs +0 -121
- data/gems/server/ext/itsi_rb_helpers/src/lib.rs +0 -178
- data/gems/server/ext/itsi_scheduler/Cargo.toml +0 -24
- data/gems/server/ext/itsi_scheduler/extconf.rb +0 -6
- data/gems/server/ext/itsi_scheduler/src/itsi_scheduler/io_helpers.rs +0 -56
- data/gems/server/ext/itsi_scheduler/src/itsi_scheduler/io_waiter.rs +0 -44
- data/gems/server/ext/itsi_scheduler/src/itsi_scheduler/timer.rs +0 -44
- data/gems/server/ext/itsi_scheduler/src/itsi_scheduler.rs +0 -308
- data/gems/server/ext/itsi_scheduler/src/lib.rs +0 -38
- data/gems/server/ext/itsi_server/Cargo.lock +0 -2956
- data/gems/server/ext/itsi_server/Cargo.toml +0 -47
- data/gems/server/ext/itsi_server/extconf.rb +0 -6
- data/gems/server/ext/itsi_server/src/body_proxy/big_bytes.rs +0 -104
- data/gems/server/ext/itsi_server/src/body_proxy/mod.rs +0 -2
- data/gems/server/ext/itsi_server/src/env.rs +0 -43
- data/gems/server/ext/itsi_server/src/lib.rs +0 -112
- data/gems/server/ext/itsi_server/src/request/itsi_request.rs +0 -305
- data/gems/server/ext/itsi_server/src/request/mod.rs +0 -1
- data/gems/server/ext/itsi_server/src/response/itsi_response.rs +0 -357
- data/gems/server/ext/itsi_server/src/response/mod.rs +0 -1
- data/gems/server/ext/itsi_server/src/server/bind.rs +0 -170
- data/gems/server/ext/itsi_server/src/server/bind_protocol.rs +0 -37
- data/gems/server/ext/itsi_server/src/server/io_stream.rs +0 -104
- data/gems/server/ext/itsi_server/src/server/itsi_server.rs +0 -294
- data/gems/server/ext/itsi_server/src/server/lifecycle_event.rs +0 -9
- data/gems/server/ext/itsi_server/src/server/listener.rs +0 -318
- data/gems/server/ext/itsi_server/src/server/mod.rs +0 -11
- data/gems/server/ext/itsi_server/src/server/process_worker.rs +0 -196
- data/gems/server/ext/itsi_server/src/server/serve_strategy/cluster_mode.rs +0 -254
- data/gems/server/ext/itsi_server/src/server/serve_strategy/mod.rs +0 -27
- data/gems/server/ext/itsi_server/src/server/serve_strategy/single_mode.rs +0 -263
- data/gems/server/ext/itsi_server/src/server/signal.rs +0 -77
- data/gems/server/ext/itsi_server/src/server/thread_worker.rs +0 -367
- data/gems/server/ext/itsi_server/src/server/tls/locked_dir_cache.rs +0 -132
- data/gems/server/ext/itsi_server/src/server/tls.rs +0 -265
- data/gems/server/ext/itsi_tracing/Cargo.lock +0 -274
- data/gems/server/ext/itsi_tracing/Cargo.toml +0 -16
- data/gems/server/ext/itsi_tracing/src/lib.rs +0 -58
- data/gems/server/lib/itsi/stream_io.rb +0 -38
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/docker-setup.sample +0 -3
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-app-boot.sample +0 -3
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-deploy.sample +0 -14
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/post-proxy-reboot.sample +0 -3
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-app-boot.sample +0 -3
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-build.sample +0 -51
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-connect.sample +0 -47
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-deploy.sample +0 -109
- data/sandbox/itsi_sandbox_rails/.kamal/hooks/pre-proxy-reboot.sample +0 -3
- data/sandbox/itsi_sandbox_rails/.kamal/secrets +0 -17
- data/sandbox/itsi_sandbox_rails/bin/dev +0 -2
- data/sandbox/itsi_sandbox_rails/bin/jobs +0 -6
- data/sandbox/itsi_sandbox_rails/bin/kamal +0 -27
- data/sandbox/itsi_sandbox_rails/bin/thrust +0 -5
- data/sandbox/itsi_sandbox_rails/config/cache.yml +0 -16
- data/sandbox/itsi_sandbox_rails/config/deploy.yml +0 -116
- data/sandbox/itsi_sandbox_rails/config/queue.yml +0 -18
- data/sandbox/itsi_sandbox_rails/config/recurring.yml +0 -10
- data/sandbox/itsi_sandbox_rails/db/cable_schema.rb +0 -11
- data/sandbox/itsi_sandbox_rails/db/cache_schema.rb +0 -14
- data/sandbox/itsi_sandbox_rails/db/queue_schema.rb +0 -129
- data/sandbox/itsi_sandbox_rails/public/400.html +0 -114
- data/sandbox/itsi_sandbox_rails/test/fixtures/posts.yml +0 -9
- data/sandbox/itsi_sandbox_rails/test/models/post_test.rb +0 -7
- /data/{sandbox/itsi_sandbox_rails/script/.keep → crates/_index.md} +0 -0
- /data/gems/server/lib/itsi/{index.html → server/default_app/index.html} +0 -0
@@ -1,58 +0,0 @@
|
|
1
|
-
use std::env;
|
2
|
-
|
3
|
-
use atty::{Stream, is};
|
4
|
-
use tracing::level_filters::LevelFilter;
|
5
|
-
pub use tracing::{debug, error, info, trace, warn};
|
6
|
-
pub use tracing_attributes::instrument; // Explicitly export from tracing-attributes
|
7
|
-
use tracing_subscriber::{
|
8
|
-
EnvFilter, Layer,
|
9
|
-
fmt::{self, format},
|
10
|
-
layer::SubscriberExt,
|
11
|
-
};
|
12
|
-
|
13
|
-
#[instrument]
|
14
|
-
pub fn init() {
|
15
|
-
let env_filter = EnvFilter::builder()
|
16
|
-
.with_env_var("ITSI_LOG")
|
17
|
-
.try_from_env()
|
18
|
-
.unwrap_or_else(|_| EnvFilter::new("info"));
|
19
|
-
|
20
|
-
let format = fmt::format()
|
21
|
-
.compact()
|
22
|
-
.with_file(false)
|
23
|
-
.with_level(true)
|
24
|
-
.with_line_number(false)
|
25
|
-
.with_source_location(false)
|
26
|
-
.with_target(false)
|
27
|
-
.with_thread_ids(false);
|
28
|
-
|
29
|
-
let is_tty = is(Stream::Stdout);
|
30
|
-
|
31
|
-
let subscriber = tracing_subscriber::fmt()
|
32
|
-
.event_format(format)
|
33
|
-
.with_env_filter(env_filter);
|
34
|
-
|
35
|
-
if (is_tty && env::var("ITSI_LOG_PLAIN").is_err()) || env::var("ITSI_LOG_ANSI").is_ok() {
|
36
|
-
subscriber.with_ansi(true).init();
|
37
|
-
} else {
|
38
|
-
subscriber
|
39
|
-
.fmt_fields(format::JsonFields::default())
|
40
|
-
.event_format(fmt::format().json())
|
41
|
-
.init();
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
pub fn run_silently<F, R>(f: F) -> R
|
46
|
-
where
|
47
|
-
F: FnOnce() -> R,
|
48
|
-
{
|
49
|
-
// Build a minimal subscriber that filters *everything* out
|
50
|
-
let no_op_subscriber =
|
51
|
-
tracing_subscriber::registry().with(fmt::layer().with_filter(LevelFilter::OFF));
|
52
|
-
|
53
|
-
// Turn that subscriber into a `Dispatch`
|
54
|
-
let no_op_dispatch = tracing::dispatcher::Dispatch::new(no_op_subscriber);
|
55
|
-
|
56
|
-
// Temporarily set `no_op_dispatch` as the *default* within this closure
|
57
|
-
tracing::dispatcher::with_default(&no_op_dispatch, f)
|
58
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Itsi
|
2
|
-
class StreamIO
|
3
|
-
attr :response
|
4
|
-
def initialize(response)
|
5
|
-
@response = response
|
6
|
-
end
|
7
|
-
|
8
|
-
def read
|
9
|
-
response.recv_frame
|
10
|
-
end
|
11
|
-
|
12
|
-
def write(string)
|
13
|
-
response.send_frame(string)
|
14
|
-
end
|
15
|
-
|
16
|
-
def <<(string)
|
17
|
-
response.send_frame(string)
|
18
|
-
end
|
19
|
-
|
20
|
-
def flush
|
21
|
-
# No-op
|
22
|
-
end
|
23
|
-
|
24
|
-
def close
|
25
|
-
close_read
|
26
|
-
close_write
|
27
|
-
end
|
28
|
-
|
29
|
-
def close_read
|
30
|
-
response.close_read
|
31
|
-
end
|
32
|
-
|
33
|
-
def close_write
|
34
|
-
response.close_write
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
@@ -1,14 +0,0 @@
|
|
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"
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# A sample pre-build hook
|
4
|
-
#
|
5
|
-
# Checks:
|
6
|
-
# 1. We have a clean checkout
|
7
|
-
# 2. A remote is configured
|
8
|
-
# 3. The branch has been pushed to the remote
|
9
|
-
# 4. The version we are deploying matches the remote
|
10
|
-
#
|
11
|
-
# These environment variables are available:
|
12
|
-
# KAMAL_RECORDED_AT
|
13
|
-
# KAMAL_PERFORMER
|
14
|
-
# KAMAL_VERSION
|
15
|
-
# KAMAL_HOSTS
|
16
|
-
# KAMAL_ROLE (if set)
|
17
|
-
# KAMAL_DESTINATION (if set)
|
18
|
-
|
19
|
-
if [ -n "$(git status --porcelain)" ]; then
|
20
|
-
echo "Git checkout is not clean, aborting..." >&2
|
21
|
-
git status --porcelain >&2
|
22
|
-
exit 1
|
23
|
-
fi
|
24
|
-
|
25
|
-
first_remote=$(git remote)
|
26
|
-
|
27
|
-
if [ -z "$first_remote" ]; then
|
28
|
-
echo "No git remote set, aborting..." >&2
|
29
|
-
exit 1
|
30
|
-
fi
|
31
|
-
|
32
|
-
current_branch=$(git branch --show-current)
|
33
|
-
|
34
|
-
if [ -z "$current_branch" ]; then
|
35
|
-
echo "Not on a git branch, aborting..." >&2
|
36
|
-
exit 1
|
37
|
-
fi
|
38
|
-
|
39
|
-
remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1)
|
40
|
-
|
41
|
-
if [ -z "$remote_head" ]; then
|
42
|
-
echo "Branch not pushed to remote, aborting..." >&2
|
43
|
-
exit 1
|
44
|
-
fi
|
45
|
-
|
46
|
-
if [ "$KAMAL_VERSION" != "$remote_head" ]; then
|
47
|
-
echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2
|
48
|
-
exit 1
|
49
|
-
fi
|
50
|
-
|
51
|
-
exit 0
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# A sample pre-connect check
|
4
|
-
#
|
5
|
-
# Warms DNS before connecting to hosts in parallel
|
6
|
-
#
|
7
|
-
# These environment variables are available:
|
8
|
-
# KAMAL_RECORDED_AT
|
9
|
-
# KAMAL_PERFORMER
|
10
|
-
# KAMAL_VERSION
|
11
|
-
# KAMAL_HOSTS
|
12
|
-
# KAMAL_ROLE (if set)
|
13
|
-
# KAMAL_DESTINATION (if set)
|
14
|
-
# KAMAL_RUNTIME
|
15
|
-
|
16
|
-
hosts = ENV["KAMAL_HOSTS"].split(",")
|
17
|
-
results = nil
|
18
|
-
max = 3
|
19
|
-
|
20
|
-
elapsed = Benchmark.realtime do
|
21
|
-
results = hosts.map do |host|
|
22
|
-
Thread.new do
|
23
|
-
tries = 1
|
24
|
-
|
25
|
-
begin
|
26
|
-
Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
|
27
|
-
rescue SocketError
|
28
|
-
if tries < max
|
29
|
-
puts "Retrying DNS warmup: #{host}"
|
30
|
-
tries += 1
|
31
|
-
sleep rand
|
32
|
-
retry
|
33
|
-
else
|
34
|
-
puts "DNS warmup failed: #{host}"
|
35
|
-
host
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
tries
|
40
|
-
end
|
41
|
-
end.map(&:value)
|
42
|
-
end
|
43
|
-
|
44
|
-
retries = results.sum - hosts.size
|
45
|
-
nopes = results.count { |r| r == max }
|
46
|
-
|
47
|
-
puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ]
|
@@ -1,109 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# A sample pre-deploy hook
|
4
|
-
#
|
5
|
-
# Checks the Github status of the build, waiting for a pending build to complete for up to 720 seconds.
|
6
|
-
#
|
7
|
-
# Fails unless the combined status is "success"
|
8
|
-
#
|
9
|
-
# These environment variables are available:
|
10
|
-
# KAMAL_RECORDED_AT
|
11
|
-
# KAMAL_PERFORMER
|
12
|
-
# KAMAL_VERSION
|
13
|
-
# KAMAL_HOSTS
|
14
|
-
# KAMAL_COMMAND
|
15
|
-
# KAMAL_SUBCOMMAND
|
16
|
-
# KAMAL_ROLE (if set)
|
17
|
-
# KAMAL_DESTINATION (if set)
|
18
|
-
|
19
|
-
# Only check the build status for production deployments
|
20
|
-
if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production"
|
21
|
-
exit 0
|
22
|
-
end
|
23
|
-
|
24
|
-
require "bundler/inline"
|
25
|
-
|
26
|
-
# true = install gems so this is fast on repeat invocations
|
27
|
-
gemfile(true, quiet: true) do
|
28
|
-
source "https://rubygems.org"
|
29
|
-
|
30
|
-
gem "octokit"
|
31
|
-
gem "faraday-retry"
|
32
|
-
end
|
33
|
-
|
34
|
-
MAX_ATTEMPTS = 72
|
35
|
-
ATTEMPTS_GAP = 10
|
36
|
-
|
37
|
-
def exit_with_error(message)
|
38
|
-
$stderr.puts message
|
39
|
-
exit 1
|
40
|
-
end
|
41
|
-
|
42
|
-
class GithubStatusChecks
|
43
|
-
attr_reader :remote_url, :git_sha, :github_client, :combined_status
|
44
|
-
|
45
|
-
def initialize
|
46
|
-
@remote_url = `git config --get remote.origin.url`.strip.delete_prefix("https://github.com/")
|
47
|
-
@git_sha = `git rev-parse HEAD`.strip
|
48
|
-
@github_client = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"])
|
49
|
-
refresh!
|
50
|
-
end
|
51
|
-
|
52
|
-
def refresh!
|
53
|
-
@combined_status = github_client.combined_status(remote_url, git_sha)
|
54
|
-
end
|
55
|
-
|
56
|
-
def state
|
57
|
-
combined_status[:state]
|
58
|
-
end
|
59
|
-
|
60
|
-
def first_status_url
|
61
|
-
first_status = combined_status[:statuses].find { |status| status[:state] == state }
|
62
|
-
first_status && first_status[:target_url]
|
63
|
-
end
|
64
|
-
|
65
|
-
def complete_count
|
66
|
-
combined_status[:statuses].count { |status| status[:state] != "pending"}
|
67
|
-
end
|
68
|
-
|
69
|
-
def total_count
|
70
|
-
combined_status[:statuses].count
|
71
|
-
end
|
72
|
-
|
73
|
-
def current_status
|
74
|
-
if total_count > 0
|
75
|
-
"Completed #{complete_count}/#{total_count} checks, see #{first_status_url} ..."
|
76
|
-
else
|
77
|
-
"Build not started..."
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
|
83
|
-
$stdout.sync = true
|
84
|
-
|
85
|
-
puts "Checking build status..."
|
86
|
-
attempts = 0
|
87
|
-
checks = GithubStatusChecks.new
|
88
|
-
|
89
|
-
begin
|
90
|
-
loop do
|
91
|
-
case checks.state
|
92
|
-
when "success"
|
93
|
-
puts "Checks passed, see #{checks.first_status_url}"
|
94
|
-
exit 0
|
95
|
-
when "failure"
|
96
|
-
exit_with_error "Checks failed, see #{checks.first_status_url}"
|
97
|
-
when "pending"
|
98
|
-
attempts += 1
|
99
|
-
end
|
100
|
-
|
101
|
-
exit_with_error "Checks are still pending, gave up after #{MAX_ATTEMPTS * ATTEMPTS_GAP} seconds" if attempts == MAX_ATTEMPTS
|
102
|
-
|
103
|
-
puts checks.current_status
|
104
|
-
sleep(ATTEMPTS_GAP)
|
105
|
-
checks.refresh!
|
106
|
-
end
|
107
|
-
rescue Octokit::NotFound
|
108
|
-
exit_with_error "Build status could not be found"
|
109
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets,
|
2
|
-
# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either
|
3
|
-
# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git.
|
4
|
-
|
5
|
-
# Example of extracting secrets from 1password (or another compatible pw manager)
|
6
|
-
# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY)
|
7
|
-
# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS})
|
8
|
-
# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS})
|
9
|
-
|
10
|
-
# Use a GITHUB_TOKEN if private repositories are needed for the image
|
11
|
-
# GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
|
12
|
-
|
13
|
-
# Grab the registry password from ENV
|
14
|
-
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
|
15
|
-
|
16
|
-
# Improve security by using a password manager. Never check config/master.key into git!
|
17
|
-
RAILS_MASTER_KEY=$(cat config/master.key)
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'kamal' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
-
|
13
|
-
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
-
|
15
|
-
if File.file?(bundle_binstub)
|
16
|
-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
|
17
|
-
load(bundle_binstub)
|
18
|
-
else
|
19
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
require "rubygems"
|
25
|
-
require "bundler/setup"
|
26
|
-
|
27
|
-
load Gem.bin_path("kamal", "kamal")
|
@@ -1,16 +0,0 @@
|
|
1
|
-
default: &default
|
2
|
-
store_options:
|
3
|
-
# Cap age of oldest cache entry to fulfill retention policies
|
4
|
-
# max_age: <%= 60.days.to_i %>
|
5
|
-
max_size: <%= 256.megabytes %>
|
6
|
-
namespace: <%= Rails.env %>
|
7
|
-
|
8
|
-
development:
|
9
|
-
<<: *default
|
10
|
-
|
11
|
-
test:
|
12
|
-
<<: *default
|
13
|
-
|
14
|
-
production:
|
15
|
-
database: cache
|
16
|
-
<<: *default
|
@@ -1,116 +0,0 @@
|
|
1
|
-
# Name of your application. Used to uniquely configure containers.
|
2
|
-
service: itsi_sandbox_rails
|
3
|
-
|
4
|
-
# Name of the container image.
|
5
|
-
image: your-user/itsi_sandbox_rails
|
6
|
-
|
7
|
-
# Deploy to these servers.
|
8
|
-
servers:
|
9
|
-
web:
|
10
|
-
- 192.168.0.1
|
11
|
-
# job:
|
12
|
-
# hosts:
|
13
|
-
# - 192.168.0.1
|
14
|
-
# cmd: bin/jobs
|
15
|
-
|
16
|
-
# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
|
17
|
-
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
|
18
|
-
#
|
19
|
-
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
|
20
|
-
proxy:
|
21
|
-
ssl: true
|
22
|
-
host: app.example.com
|
23
|
-
|
24
|
-
# Credentials for your image host.
|
25
|
-
registry:
|
26
|
-
# Specify the registry server, if you're not using Docker Hub
|
27
|
-
# server: registry.digitalocean.com / ghcr.io / ...
|
28
|
-
username: your-user
|
29
|
-
|
30
|
-
# Always use an access token rather than real password when possible.
|
31
|
-
password:
|
32
|
-
- KAMAL_REGISTRY_PASSWORD
|
33
|
-
|
34
|
-
# Inject ENV variables into containers (secrets come from .kamal/secrets).
|
35
|
-
env:
|
36
|
-
secret:
|
37
|
-
- RAILS_MASTER_KEY
|
38
|
-
clear:
|
39
|
-
# Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
|
40
|
-
# When you start using multiple servers, you should split out job processing to a dedicated machine.
|
41
|
-
SOLID_QUEUE_IN_PUMA: true
|
42
|
-
|
43
|
-
# Set number of processes dedicated to Solid Queue (default: 1)
|
44
|
-
# JOB_CONCURRENCY: 3
|
45
|
-
|
46
|
-
# Set number of cores available to the application on each server (default: 1).
|
47
|
-
# WEB_CONCURRENCY: 2
|
48
|
-
|
49
|
-
# Match this to any external database server to configure Active Record correctly
|
50
|
-
# Use itsi_sandbox_rails-db for a db accessory server on same machine via local kamal docker network.
|
51
|
-
# DB_HOST: 192.168.0.2
|
52
|
-
|
53
|
-
# Log everything from Rails
|
54
|
-
# RAILS_LOG_LEVEL: debug
|
55
|
-
|
56
|
-
# Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
|
57
|
-
# "bin/kamal logs -r job" will tail logs from the first server in the job section.
|
58
|
-
aliases:
|
59
|
-
console: app exec --interactive --reuse "bin/rails console"
|
60
|
-
shell: app exec --interactive --reuse "bash"
|
61
|
-
logs: app logs -f
|
62
|
-
dbc: app exec --interactive --reuse "bin/rails dbconsole"
|
63
|
-
|
64
|
-
|
65
|
-
# Use a persistent storage volume for sqlite database files and local Active Storage files.
|
66
|
-
# Recommended to change this to a mounted volume path that is backed up off server.
|
67
|
-
volumes:
|
68
|
-
- "itsi_sandbox_rails_storage:/rails/storage"
|
69
|
-
|
70
|
-
|
71
|
-
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
|
72
|
-
# hitting 404 on in-flight requests. Combines all files from new and old
|
73
|
-
# version inside the asset_path.
|
74
|
-
asset_path: /rails/public/assets
|
75
|
-
|
76
|
-
# Configure the image builder.
|
77
|
-
builder:
|
78
|
-
arch: amd64
|
79
|
-
|
80
|
-
# # Build image via remote server (useful for faster amd64 builds on arm64 computers)
|
81
|
-
# remote: ssh://docker@docker-builder-server
|
82
|
-
#
|
83
|
-
# # Pass arguments and secrets to the Docker build process
|
84
|
-
# args:
|
85
|
-
# RUBY_VERSION: ruby-3.4.2
|
86
|
-
# secrets:
|
87
|
-
# - GITHUB_TOKEN
|
88
|
-
# - RAILS_MASTER_KEY
|
89
|
-
|
90
|
-
# Use a different ssh user than root
|
91
|
-
# ssh:
|
92
|
-
# user: app
|
93
|
-
|
94
|
-
# Use accessory services (secrets come from .kamal/secrets).
|
95
|
-
# accessories:
|
96
|
-
# db:
|
97
|
-
# image: mysql:8.0
|
98
|
-
# host: 192.168.0.2
|
99
|
-
# # Change to 3306 to expose port to the world instead of just local network.
|
100
|
-
# port: "127.0.0.1:3306:3306"
|
101
|
-
# env:
|
102
|
-
# clear:
|
103
|
-
# MYSQL_ROOT_HOST: '%'
|
104
|
-
# secret:
|
105
|
-
# - MYSQL_ROOT_PASSWORD
|
106
|
-
# files:
|
107
|
-
# - config/mysql/production.cnf:/etc/mysql/my.cnf
|
108
|
-
# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
|
109
|
-
# directories:
|
110
|
-
# - data:/var/lib/mysql
|
111
|
-
# redis:
|
112
|
-
# image: redis:7.0
|
113
|
-
# host: 192.168.0.2
|
114
|
-
# port: 6379
|
115
|
-
# directories:
|
116
|
-
# - data:/data
|
@@ -1,18 +0,0 @@
|
|
1
|
-
default: &default
|
2
|
-
dispatchers:
|
3
|
-
- polling_interval: 1
|
4
|
-
batch_size: 500
|
5
|
-
workers:
|
6
|
-
- queues: "*"
|
7
|
-
threads: 3
|
8
|
-
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
|
9
|
-
polling_interval: 0.1
|
10
|
-
|
11
|
-
development:
|
12
|
-
<<: *default
|
13
|
-
|
14
|
-
test:
|
15
|
-
<<: *default
|
16
|
-
|
17
|
-
production:
|
18
|
-
<<: *default
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# production:
|
2
|
-
# periodic_cleanup:
|
3
|
-
# class: CleanSoftDeletedRecordsJob
|
4
|
-
# queue: background
|
5
|
-
# args: [ 1000, { batch_size: 500 } ]
|
6
|
-
# schedule: every hour
|
7
|
-
# periodic_command:
|
8
|
-
# command: "SoftDeletedRecord.due.delete_all"
|
9
|
-
# priority: 2
|
10
|
-
# schedule: at 5am every day
|
@@ -1,11 +0,0 @@
|
|
1
|
-
ActiveRecord::Schema[7.1].define(version: 1) do
|
2
|
-
create_table "solid_cable_messages", force: :cascade do |t|
|
3
|
-
t.binary "channel", limit: 1024, null: false
|
4
|
-
t.binary "payload", limit: 536870912, null: false
|
5
|
-
t.datetime "created_at", null: false
|
6
|
-
t.integer "channel_hash", limit: 8, null: false
|
7
|
-
t.index ["channel"], name: "index_solid_cable_messages_on_channel"
|
8
|
-
t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash"
|
9
|
-
t.index ["created_at"], name: "index_solid_cable_messages_on_created_at"
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
ActiveRecord::Schema[7.2].define(version: 1) do
|
4
|
-
create_table "solid_cache_entries", force: :cascade do |t|
|
5
|
-
t.binary "key", limit: 1024, null: false
|
6
|
-
t.binary "value", limit: 536870912, null: false
|
7
|
-
t.datetime "created_at", null: false
|
8
|
-
t.integer "key_hash", limit: 8, null: false
|
9
|
-
t.integer "byte_size", limit: 4, null: false
|
10
|
-
t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size"
|
11
|
-
t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size"
|
12
|
-
t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true
|
13
|
-
end
|
14
|
-
end
|