From 8eb3e2bf9a4d22673ced4da2ac1da642f4092dad Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Fri, 26 Jul 2024 22:57:57 +0300 Subject: [PATCH] feat: Ruby on Rails samples --- .github/workflows/docker.yml | 53 +- .github/workflows/macos.yml | 56 +- .github/workflows/rhel.yml | 77 ++- .gitignore | 46 +- README.adoc | 42 ++ ror-data/log/.keep | 0 ror-data/log/development.log | 541 ++++++++++++++++++ ror-data/storage/.keep | 0 ror-data/tmp/.keep | 0 ror-data/tmp/pids/.keep | 0 ror-data/tmp/restart.txt | 0 ror-data/tmp/storage/.keep | 0 ror.adoc | 25 + ror/.gitattributes | 9 + ror/.gitignore | 35 ++ ror/.ruby-version | 1 + ror/Gemfile | 46 ++ ror/Rakefile | 6 + ror/app/assets/config/manifest.js | 2 + ror/app/assets/images/.keep | 0 ror/app/assets/stylesheets/application.css | 15 + ror/app/controllers/application_controller.rb | 2 + ror/app/controllers/concerns/.keep | 0 ror/app/helpers/application_helper.rb | 2 + ror/app/jobs/application_job.rb | 7 + ror/app/models/application_record.rb | 3 + ror/app/models/concerns/.keep | 0 ror/app/views/layouts/application.html.erb | 15 + ror/bin/rails | 4 + ror/bin/rake | 4 + ror/bin/setup | 33 ++ ror/config.ru | 6 + ror/config/application.rb | 42 ++ ror/config/boot.rb | 3 + ror/config/credentials.yml.enc | 1 + ror/config/database.yml | 25 + ror/config/environment.rb | 5 + ror/config/environments/development.rb | 65 +++ ror/config/environments/production.rb | 83 +++ ror/config/environments/test.rb | 54 ++ ror/config/initializers/assets.rb | 12 + .../initializers/content_security_policy.rb | 25 + .../initializers/filter_parameter_logging.rb | 8 + ror/config/initializers/inflections.rb | 16 + ror/config/initializers/permissions_policy.rb | 13 + ror/config/locales/en.yml | 31 + ror/config/puma.rb | 35 ++ ror/config/routes.rb | 10 + ror/db/seeds.rb | 9 + ror/lib/assets/.keep | 0 ror/lib/tasks/.keep | 0 ror/log/.keep | 0 ror/public/404.html | 67 +++ ror/public/422.html | 67 +++ ror/public/500.html | 66 +++ ror/public/apple-touch-icon-precomposed.png | 0 ror/public/apple-touch-icon.png | 0 ror/public/favicon.ico | 0 ror/public/robots.txt | 1 + ror/storage/.keep | 0 ror/tmp/.keep | 0 ror/tmp/pids/.keep | 0 ror/tmp/storage/.keep | 0 ror/vendor/.keep | 0 sinatra/app.rb | 2 +- 65 files changed, 1653 insertions(+), 17 deletions(-) create mode 100644 ror-data/log/.keep create mode 100644 ror-data/log/development.log create mode 100644 ror-data/storage/.keep create mode 100644 ror-data/tmp/.keep create mode 100644 ror-data/tmp/pids/.keep create mode 100644 ror-data/tmp/restart.txt create mode 100644 ror-data/tmp/storage/.keep create mode 100644 ror.adoc create mode 100644 ror/.gitattributes create mode 100644 ror/.gitignore create mode 100644 ror/.ruby-version create mode 100644 ror/Gemfile create mode 100644 ror/Rakefile create mode 100644 ror/app/assets/config/manifest.js create mode 100644 ror/app/assets/images/.keep create mode 100644 ror/app/assets/stylesheets/application.css create mode 100644 ror/app/controllers/application_controller.rb create mode 100644 ror/app/controllers/concerns/.keep create mode 100644 ror/app/helpers/application_helper.rb create mode 100644 ror/app/jobs/application_job.rb create mode 100644 ror/app/models/application_record.rb create mode 100644 ror/app/models/concerns/.keep create mode 100644 ror/app/views/layouts/application.html.erb create mode 100755 ror/bin/rails create mode 100755 ror/bin/rake create mode 100755 ror/bin/setup create mode 100644 ror/config.ru create mode 100644 ror/config/application.rb create mode 100644 ror/config/boot.rb create mode 100644 ror/config/credentials.yml.enc create mode 100644 ror/config/database.yml create mode 100644 ror/config/environment.rb create mode 100644 ror/config/environments/development.rb create mode 100644 ror/config/environments/production.rb create mode 100644 ror/config/environments/test.rb create mode 100644 ror/config/initializers/assets.rb create mode 100644 ror/config/initializers/content_security_policy.rb create mode 100644 ror/config/initializers/filter_parameter_logging.rb create mode 100644 ror/config/initializers/inflections.rb create mode 100644 ror/config/initializers/permissions_policy.rb create mode 100644 ror/config/locales/en.yml create mode 100644 ror/config/puma.rb create mode 100644 ror/config/routes.rb create mode 100644 ror/db/seeds.rb create mode 100644 ror/lib/assets/.keep create mode 100644 ror/lib/tasks/.keep create mode 100644 ror/log/.keep create mode 100644 ror/public/404.html create mode 100644 ror/public/422.html create mode 100644 ror/public/500.html create mode 100644 ror/public/apple-touch-icon-precomposed.png create mode 100644 ror/public/apple-touch-icon.png create mode 100644 ror/public/favicon.ico create mode 100644 ror/public/robots.txt create mode 100644 ror/storage/.keep create mode 100644 ror/tmp/.keep create mode 100644 ror/tmp/pids/.keep create mode 100644 ror/tmp/storage/.keep create mode 100644 ror/vendor/.keep diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5cdc60d..9281f88 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - test: + test-sinatra: runs-on: ubuntu-latest strategy: fail-fast: false @@ -25,6 +25,15 @@ jobs: container: image: ghcr.io/tamatebako/tebako-${{ matrix.container }}:latest steps: + - name: Install curl/procps + run: | + if [ -e "/etc/lsb-release" ]; then + apt-get -y update + apt-get -y install curl procps + elif [ -e "/etc/alpine-release" ]; then + apk --no-cache --upgrade add curl procps + fi + - name: Checkout sample uses: actions/checkout@v4 @@ -42,6 +51,26 @@ jobs: - name: Wait for Sinatra to start run: sleep 10 + - name: Place GET request + run: | + curl http://localhost:4567 + + - name: End Sinatra application + run: pkill -f sinatra.teb + + test-rails: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + container: + - 'ubuntu-20.04' + - 'alpine-3.17' + package_ruby_ver: + - '3.2.5' + container: + image: ghcr.io/tamatebako/tebako-${{ matrix.container }}:latest + steps: - name: Install curl/procps run: | if [ -e "/etc/lsb-release" ]; then @@ -51,9 +80,27 @@ jobs: apk --no-cache --upgrade add curl procps fi + - name: Checkout sample + uses: actions/checkout@v4 + + - name: Package + run: tebako press -e bin/rails -o rails.teb -r ror -R ${{ matrix.package_ruby_ver }} + + - name: Create data folder + run: mkdir -p ror-data + + - name: Test + run: ./rails.teb server --help + + - name: Start packaged Rails application + run: ./rails.teb server --port=4567 --tebako-mount local/tmp:$PWD/ror-data/tmp --tebako-mount local/log:$PWD/ror-data/log & + + - name: Wait for Rails to start + run: sleep 10 + - name: Place GET request run: | curl http://localhost:4567 - - name: End Sinatra application - run: pkill -f sinatra.teb + - name: End Rails application + run: pkill -f rails.teb diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6d36c03..a369525 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - test: + test-sinatra: runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -35,13 +35,10 @@ jobs: uses: actions/checkout@v4 - name: Package - run: tebako press -e app.rb -o sample.tebako -r sinatra - - - name: Look around - run: ls -la + run: tebako press -e app.rb -o sinatra.teb -r sinatra - name: Start packaged Sinatra application - run: ./sample.tebako & + run: ./sinatra.teb & env: PORT: 4567 @@ -52,4 +49,49 @@ jobs: run: curl http://localhost:4567 - name: End Sinatra application - run: pkill -f sample.tebako + run: pkill -f sinatra.teb + + test-rails: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ macos-13, macos-14 ] + steps: + - name: Select XCode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 14.3.1 + + - name: Brew install + run: | + brew install bison flex binutils libffi double-conversion boost jemalloc fmt glog gnu-sed bash zlib ncurses + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + + - name: Install gem + run: gem install tebako + + - name: Checkout sample + uses: actions/checkout@v4 + + - name: Package + run: tebako press -e bin/rails -o rails.teb -r ror + + - name: Create data folder + run: mkdir -p ror-data + + - name: Test + run: ./rails.teb server --help + + - name: Start packaged Rails application + run: ./rails.teb server --port=4567 --tebako-mount local/tmp:$PWD/ror-data/tmp --tebako-mount local/log:$PWD/ror-data/log & + + - name: Wait for Rails to start + run: sleep 10 + + - name: Place GET request + run: | + curl http://localhost:4567 + + - name: End Rails application + run: pkill -f rails.teb diff --git a/.github/workflows/rhel.yml b/.github/workflows/rhel.yml index 7d8121c..7e5be65 100644 --- a/.github/workflows/rhel.yml +++ b/.github/workflows/rhel.yml @@ -36,8 +36,8 @@ concurrency: cancel-in-progress: true jobs: - create-package: - name: Create tebako package + create-sinatra-package: + name: Create Sinatra package runs-on: ubuntu-latest steps: - name: Checkout sample @@ -57,10 +57,10 @@ jobs: path: | sinatra-package - run-package: - name: Run on ${{ matrix.container }} + test-sinatra: + name: Run Sinatra package on ${{ matrix.container }} runs-on: ubuntu-latest - needs: [ create-package ] + needs: [ create-sinatra-package ] strategy: fail-fast: false matrix: @@ -104,3 +104,70 @@ jobs: - name: End Sinatra application run: pkill -f sinatra-package + + create-rails-package: + name: Create Rails package + runs-on: ubuntu-latest + steps: + - name: Checkout sample + uses: actions/checkout@v4 + + - name: Create tebako package + run: | + docker run -v $PWD:/mnt/w -t ghcr.io/tamatebako/tebako-ubuntu-20.04:latest \ + tebako press --root=/mnt/w/ror --entry-point=bin/rails \ + --output=/mnt/w/rails-package --Ruby=3.2.5 --patchelf + + - name: Upload tebako test packages + uses: actions/upload-artifact@v4 + with: + name: rails-package + retention-days: 1 + path: | + rails-package + + test-rails: + name: Run rails package on ${{ matrix.container }} + runs-on: ubuntu-latest + needs: [ create-rails-package ] + strategy: + fail-fast: false + matrix: + container: + - 'rockylinux:9' + - 'fedora:39' + - 'quay.io/centos/centos:stream9' + container: + image: ${{ matrix.container }} + steps: + - name: Download test packages + uses: actions/download-artifact@v4 + with: + name: rails-package + + - name: Install OpenSSL 1.1 + run: | + dnf -y install procps-ng + if [ "${{matrix.container}}" = "rockylinux:9" -o "${{matrix.container}}" = "quay.io/centos/centos:stream9" ] ; then + dnf -y install compat-openssl11 + elif [ "${{matrix.container}}" = "fedora:39" ] ; then + dnf -y install openssl1.1 + fi + + - name: Adjust package permissions + run: chmod +x rails-package + + - name: Smoke check + run: ./rails-package server --help + + - name: Start packaged Rails application + run: ./rails-package server --port=4567 --tebako-mount local/tmp:$PWD/ror-data/tmp --tebako-mount local/log:$PWD/ror-data/log & + + - name: Wait for Rails to start + run: sleep 10 + + - name: Place GET request + run: curl http://localhost:4567 + + - name: End Sinatra application + run: pkill -f sinatra-package diff --git a/.gitignore b/.gitignore index bdf9070..1fde849 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,46 @@ -sample.tebako +sinatra.teb +ror.teb +rails.teb .vscode/ + +# Ignore all logfiles and tempfiles. +ror/log/* +ror/tmp/* +!ror/log/.keep +!ror/tmp/.keep + +# Ignore pidfiles, but keep the directory. +ror/tmp/pids/* +!ror/tmp/pids/ +!ror/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +ror/storage/* +!ror/storage/.keep +ror/tmp/storage/* +!ror/tmp/storage/ +!ror/tmp/storage/.keep + +#ror/public/assets + +# Ignore master key for decrypting credentials and more. +# ror/config/master.key + + +# Ignore all logfiles and tempfiles. +ror/log/* +ror/tmp/* +!ror/log/.keep +!ror/tmp/.keep + +# Ignore pidfiles, but keep the directory. +ror/tmp/pids/* +!ror/tmp/pids/ +!ror/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +ror-data/* +!ror-data/storage/.keep + +Gemfile.lock +log \ No newline at end of file diff --git a/README.adoc b/README.adoc index e72cacb..b6f1f0b 100644 --- a/README.adoc +++ b/README.adoc @@ -116,6 +116,48 @@ clang/llvm. 1.1.1), which needs to be present at the target system. If the target system has a different version of OpenSSL, the package will not work. +== Ruby on Rails + +Command that was used to generate sample application: +[source,sh] +---- +rails new ror --skip-bundle --skip-docker --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage \ + --skip-action-cable --skip-bootsnap --skip-dev-gems --skip-coffee --skip-sprockets --skip-spring --skip-test +---- + +Database configuration at `database.yml` changed to be more flexible: +[source,yaml] +---- +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/development.sqlite3" } %> +test: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/test.sqlite3" } %> + +production: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/production.sqlite3" } %> +---- + +Running in standalone mode: + +[source,sh] +---- +$ cd ror +$ bundle install +$ rails server +---- + +This launches a rails server that responds at: + +* http://127.0.0.1:3000 + == License Copyright Ribose. diff --git a/ror-data/log/.keep b/ror-data/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror-data/log/development.log b/ror-data/log/development.log new file mode 100644 index 0000000..58f7c3e --- /dev/null +++ b/ror-data/log/development.log @@ -0,0 +1,541 @@ +Started GET "/" for 127.0.0.1 at 2024-09-30 19:02:38 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:02:38 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:03:45 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:03:45 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:06:21 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:06:21 +0300 + +ActiveRecord::StatementInvalid (SQLite3::CantOpenException: unable to open database file): + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:07:17 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:07:17 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started POST "/rails/actions" for 127.0.0.1 at 2024-09-30 19:07:36 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_handler.rb:246:in `retrieve_connection' +activerecord (7.1.4) lib/active_record/connection_handling.rb:287:in `retrieve_connection' +activerecord (7.1.4) lib/active_record/connection_handling.rb:254:in `connection' +activerecord (7.1.4) lib/active_record/tasks/sqlite_database_tasks.rb:69:in `connection' +activerecord (7.1.4) lib/active_record/tasks/sqlite_database_tasks.rb:19:in `create' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:117:in `create' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:171:in `block in create_current' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:567:in `block (2 levels) in each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:564:in `each' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:564:in `block in each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:575:in `each' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:575:in `each_current_environment' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:563:in `each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:171:in `create_current' +activerecord (7.1.4) lib/active_record/errors.rb:311:in `block in ' +activesupport (7.1.4) lib/active_support/actionable_error.rb:30:in `dispatch' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:07:36 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/" for 127.0.0.1 at 2024-09-30 19:09:52 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:09:52 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started POST "/rails/actions" for 127.0.0.1 at 2024-09-30 19:09:56 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_handler.rb:246:in `retrieve_connection' +activerecord (7.1.4) lib/active_record/connection_handling.rb:287:in `retrieve_connection' +activerecord (7.1.4) lib/active_record/connection_handling.rb:254:in `connection' +activerecord (7.1.4) lib/active_record/tasks/sqlite_database_tasks.rb:69:in `connection' +activerecord (7.1.4) lib/active_record/tasks/sqlite_database_tasks.rb:19:in `create' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:117:in `create' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:171:in `block in create_current' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:567:in `block (2 levels) in each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:564:in `each' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:564:in `block in each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:575:in `each' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:575:in `each_current_environment' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:563:in `each_current_configuration' +activerecord (7.1.4) lib/active_record/tasks/database_tasks.rb:171:in `create_current' +activerecord (7.1.4) lib/active_record/errors.rb:311:in `block in ' +activesupport (7.1.4) lib/active_support/actionable_error.rb:30:in `dispatch' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/favicon.ico" for 127.0.0.1 at 2024-09-30 19:09:57 +0300 + +ActiveRecord::NoDatabaseError (Database not found): + +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:119:in `rescue in initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:115:in `initialize' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new' +activerecord (7.1.4) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `public_send' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:730:in `checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:709:in `try_to_checkout_new_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout' +activerecord (7.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection' +activerecord (7.1.4) lib/active_record/migration/pending_migration_connection.rb:8:in `establish_temporary_connection' +activerecord (7.1.4) lib/active_record/migration.rb:774:in `block in pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `each' +activerecord (7.1.4) lib/active_record/migration.rb:773:in `pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:752:in `check_pending_migrations' +activerecord (7.1.4) lib/active_record/migration.rb:644:in `block (2 levels) in call' +activesupport (7.1.4) lib/active_support/file_update_checker.rb:85:in `execute' +activerecord (7.1.4) lib/active_record/migration.rb:649:in `block in call' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `synchronize' +activerecord (7.1.4) lib/active_record/migration.rb:641:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' +activesupport (7.1.4) lib/active_support/callbacks.rb:101:in `run_callbacks' +actionpack (7.1.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (7.1.4) lib/rails/rack/logger.rb:37:in `call_app' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `block in tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:39:in `tagged' +activesupport (7.1.4) lib/active_support/tagged_logging.rb:139:in `tagged' +activesupport (7.1.4) lib/active_support/broadcast_logger.rb:241:in `method_missing' +railties (7.1.4) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/request_id.rb:28:in `call' +rack (3.1.7) lib/rack/method_override.rb:28:in `call' +rack (3.1.7) lib/rack/runtime.rb:24:in `call' +activesupport (7.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events' +actionpack (7.1.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/static.rb:25:in `call' +rack (3.1.7) lib/rack/sendfile.rb:114:in `call' +actionpack (7.1.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call' +railties (7.1.4) lib/rails/engine.rb:536:in `call' +puma (6.4.3) lib/puma/configuration.rb:272:in `call' +puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request' +puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown' +puma (6.4.3) lib/puma/request.rb:99:in `handle_request' +puma (6.4.3) lib/puma/server.rb:464:in `process_client' +puma (6.4.3) lib/puma/server.rb:245:in `block in run' +puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' +Started GET "/" for 127.0.0.1 at 2024-09-30 19:10:58 +0300 +  (2.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +Processing by Rails::WelcomeController#index as HTML + Rendering /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb + Rendered /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb (Duration: 0.5ms | Allocations: 377) +Completed 200 OK in 9ms (Views: 4.2ms | ActiveRecord: 0.0ms | Allocations: 6392) + + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:11:18 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +Processing by Rails::WelcomeController#index as HTML + Rendering /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb + Rendered /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb (Duration: 0.5ms | Allocations: 377) +Completed 200 OK in 8ms (Views: 3.6ms | ActiveRecord: 0.0ms | Allocations: 6394) + + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:11:21 +0300 +Processing by Rails::WelcomeController#index as HTML + Rendering /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb + Rendered /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb (Duration: 0.5ms | Allocations: 261) +Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms | Allocations: 876) + + +Started GET "/" for 127.0.0.1 at 2024-09-30 19:15:33 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +Processing by Rails::WelcomeController#index as HTML + Rendering /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb + Rendered /__tebako_memfs__/lib/ruby/gems/3.2.0/gems/railties-7.1.4/lib/rails/templates/rails/welcome/index.html.erb (Duration: 0.5ms | Allocations: 377) +Completed 200 OK in 9ms (Views: 4.2ms | ActiveRecord: 0.0ms | Allocations: 6394) + + diff --git a/ror-data/storage/.keep b/ror-data/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror-data/tmp/.keep b/ror-data/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror-data/tmp/pids/.keep b/ror-data/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror-data/tmp/restart.txt b/ror-data/tmp/restart.txt new file mode 100644 index 0000000..e69de29 diff --git a/ror-data/tmp/storage/.keep b/ror-data/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror.adoc b/ror.adoc new file mode 100644 index 0000000..09caf99 --- /dev/null +++ b/ror.adoc @@ -0,0 +1,25 @@ +[source,sh] +---- +rails new ror --skip-bundle --skip-docker --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage \ + --skip-action-cable --skip-bootsnap --skip-dev-gems --skip-coffee --skip-sprockets --skip-spring --skip-test +---- + +- create tebako environment +- make tebako environment default for the project (config/application.rb) +ensure taht database is created outside of the tebako memfs + +[source,yaml] +---- +tebako: + <<: *default + database: ~/rails/storage/tebako.sqlite3 +---- + +- set config.paths["log"] in config/application.rb to appropriate host file +[source,ruby] +---- +config.paths["log"] = "#{ENV.fetch("HOME")}/rails/log/#{Rails.env}.log" +---- + + +https://github.com/rails/rails/issues/39583 \ No newline at end of file diff --git a/ror/.gitattributes b/ror/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/ror/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/ror/.gitignore b/ror/.gitignore new file mode 100644 index 0000000..5fb66c9 --- /dev/null +++ b/ror/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore all environment files (except templates). +/.env* +!/.env*.erb + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/ror/.ruby-version b/ror/.ruby-version new file mode 100644 index 0000000..5ae69bd --- /dev/null +++ b/ror/.ruby-version @@ -0,0 +1 @@ +3.2.5 diff --git a/ror/Gemfile b/ror/Gemfile new file mode 100644 index 0000000..d67e64d --- /dev/null +++ b/ror/Gemfile @@ -0,0 +1,46 @@ +source "https://rubygems.org" + +ruby "3.2.5" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 7.1.3", ">= 7.1.3.4" + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" + +# Use sqlite3 as the database for Active Record +gem "sqlite3", "~> 1.4" + +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" + +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" + +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" + +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Bundle the tzinfo-data gem +gem "tzinfo-data" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ] +end + +group :development do + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end diff --git a/ror/Rakefile b/ror/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/ror/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/ror/app/assets/config/manifest.js b/ror/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/ror/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/ror/app/assets/images/.keep b/ror/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/app/assets/stylesheets/application.css b/ror/app/assets/stylesheets/application.css new file mode 100644 index 0000000..288b9ab --- /dev/null +++ b/ror/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/ror/app/controllers/application_controller.rb b/ror/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/ror/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/ror/app/controllers/concerns/.keep b/ror/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/app/helpers/application_helper.rb b/ror/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/ror/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/ror/app/jobs/application_job.rb b/ror/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/ror/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/ror/app/models/application_record.rb b/ror/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/ror/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/ror/app/models/concerns/.keep b/ror/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/app/views/layouts/application.html.erb b/ror/app/views/layouts/application.html.erb new file mode 100644 index 0000000..36c671b --- /dev/null +++ b/ror/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Ror + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + + + + <%= yield %> + + diff --git a/ror/bin/rails b/ror/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/ror/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/ror/bin/rake b/ror/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/ror/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/ror/bin/setup b/ror/bin/setup new file mode 100755 index 0000000..3cd5a9d --- /dev/null +++ b/ror/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/ror/config.ru b/ror/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/ror/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/ror/config/application.rb b/ror/config/application.rb new file mode 100644 index 0000000..aef9520 --- /dev/null +++ b/ror/config/application.rb @@ -0,0 +1,42 @@ +require_relative "boot" + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +# require "active_storage/engine" +require "action_controller/railtie" +# require "action_mailer/railtie" +# require "action_mailbox/engine" +# require "action_text/engine" +require "action_view/railtie" +# require "action_cable/engine" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Ror + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + # Don't generate system test files. + config.generators.system_tests = nil + end +end diff --git a/ror/config/boot.rb b/ror/config/boot.rb new file mode 100644 index 0000000..2820116 --- /dev/null +++ b/ror/config/boot.rb @@ -0,0 +1,3 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/ror/config/credentials.yml.enc b/ror/config/credentials.yml.enc new file mode 100644 index 0000000..f35a200 --- /dev/null +++ b/ror/config/credentials.yml.enc @@ -0,0 +1 @@ +uBvAA7eu2zIuJ8J5PhF3zdCqkUi6v7qh7+m0TLJD7kwN6IXxIzJFRetvT7DPrftC9onQj/Szxuagidzk74fyxqKgsrmBet7wFJLBwSQo8A0aSMFl8ZvsBUzhxUOyWdYz1Fdqv1vv7HDC/Gaf4DP4iRMDa2U6Y55SvHjbdrubB7vfUfY58/Xfd9S2wMtn/uv1vANrZx42mH+VrNoR7ZbmHJ2Dtw36ZZI/1E7N/UbzbJL7gIxpBUnNIj7sJNbAhfc8i0VpHkPnLGTYNSBPiXHruAQfIhpfNKUxLwHTqdUuweHe5z3bu+yuVDXUbzieid4dnBmMRYunhvk6iBrc7AXbyTNVk0Ud0QGN8R5uDCgSwkfrXrHF5Xx7pCTHpWPuVG7bk0DxJuPzzW8h33soX4JycYb7KeBN--k+VkfbH04Q5Vzsji--pW7L9wR/uZ/R0/F6RSJrgw== \ No newline at end of file diff --git a/ror/config/database.yml b/ror/config/database.yml new file mode 100644 index 0000000..6dbebf0 --- /dev/null +++ b/ror/config/database.yml @@ -0,0 +1,25 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/development.sqlite3" } %> + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/test.sqlite3" } %> + +production: + <<: *default + database: <%= ENV.fetch("RAILS_STORAGE") { "storage/production.sqlite3" } %> diff --git a/ror/config/environment.rb b/ror/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/ror/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ror/config/environments/development.rb b/ror/config/environments/development.rb new file mode 100644 index 0000000..ff757b7 --- /dev/null +++ b/ror/config/environments/development.rb @@ -0,0 +1,65 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/ror/config/environments/production.rb b/ror/config/environments/production.rb new file mode 100644 index 0000000..e9e8f3f --- /dev/null +++ b/ror/config/environments/production.rb @@ -0,0 +1,83 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fall back to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new(STDOUT) + .tap { |logger| logger.formatter = ::Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "ror_production" + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/ror/config/environments/test.rb b/ror/config/environments/test.rb new file mode 100644 index 0000000..d349c35 --- /dev/null +++ b/ror/config/environments/test.rb @@ -0,0 +1,54 @@ +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/ror/config/initializers/assets.rb b/ror/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/ror/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/ror/config/initializers/content_security_policy.rb b/ror/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/ror/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/ror/config/initializers/filter_parameter_logging.rb b/ror/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c2d89e2 --- /dev/null +++ b/ror/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/ror/config/initializers/inflections.rb b/ror/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/ror/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/ror/config/initializers/permissions_policy.rb b/ror/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..7db3b95 --- /dev/null +++ b/ror/config/initializers/permissions_policy.rb @@ -0,0 +1,13 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide HTTP permissions policy. For further +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end diff --git a/ror/config/locales/en.yml b/ror/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/ror/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/ror/config/puma.rb b/ror/config/puma.rb new file mode 100644 index 0000000..afa809b --- /dev/null +++ b/ror/config/puma.rb @@ -0,0 +1,35 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. + +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies that the worker count should equal the number of processors in production. +if ENV["RAILS_ENV"] == "production" + require "concurrent-ruby" + worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count }) + workers worker_count if worker_count > 1 +end + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/ror/config/routes.rb b/ror/config/routes.rb new file mode 100644 index 0000000..a125ef0 --- /dev/null +++ b/ror/config/routes.rb @@ -0,0 +1,10 @@ +Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Defines the root path route ("/") + # root "posts#index" +end diff --git a/ror/db/seeds.rb b/ror/db/seeds.rb new file mode 100644 index 0000000..4fbd6ed --- /dev/null +++ b/ror/db/seeds.rb @@ -0,0 +1,9 @@ +# This file should ensure the existence of records required to run the application in every environment (production, +# development, test). The code here should be idempotent so that it can be executed at any point in every environment. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Example: +# +# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| +# MovieGenre.find_or_create_by!(name: genre_name) +# end diff --git a/ror/lib/assets/.keep b/ror/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/lib/tasks/.keep b/ror/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/log/.keep b/ror/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/public/404.html b/ror/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/ror/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/ror/public/422.html b/ror/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/ror/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/ror/public/500.html b/ror/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/ror/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/ror/public/apple-touch-icon-precomposed.png b/ror/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/ror/public/apple-touch-icon.png b/ror/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/ror/public/favicon.ico b/ror/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/ror/public/robots.txt b/ror/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/ror/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/ror/storage/.keep b/ror/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/tmp/.keep b/ror/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/tmp/pids/.keep b/ror/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/tmp/storage/.keep b/ror/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ror/vendor/.keep b/ror/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/sinatra/app.rb b/sinatra/app.rb index c5f989b..5cdac0c 100755 --- a/sinatra/app.rb +++ b/sinatra/app.rb @@ -4,7 +4,7 @@ require "httparty" get "/" do - "Welcome to the Tebako App!" + "Welcome to the Tebako Sinatra App!" end get "/api" do