diff --git a/.env.development b/.env.development index 10250eda..90d36244 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,4 @@ SECRET_KEY_BASE=verysecret -REDIS_URL=redis://localhost RACK_MINI_PROFILER=1 ENABLE_QUERY_TRACE=1 APPLICATION_HOST=localhost diff --git a/Gemfile b/Gemfile index ab1b5e4a..3df871e5 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,6 @@ gem "rails", "~> 6.1" gem "rails-i18n", "~> 6.0" gem "recipient_interceptor" gem "redcarpet", "~> 3.5.1" -gem "redis" gem "responders" gem "russian" gem "sass-rails", "~> 6.0" diff --git a/Gemfile.lock b/Gemfile.lock index d3e4b249..428be8cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -371,7 +371,6 @@ GEM recipient_interceptor (0.2.0) mail redcarpet (3.5.1) - redis (3.3.3) regexp_parser (2.9.0) responders (3.1.1) actionpack (>= 5.2) @@ -561,7 +560,6 @@ DEPENDENCIES rails_stdout_logging recipient_interceptor redcarpet (~> 3.5.1) - redis responders rspec-rails rubocop-rails-omakase diff --git a/README.md b/README.md index 529473f5..7c338175 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ -# It61 - -[![View performance data on Skylight](https://badges.skylight.io/status/9ACn286v2ne4.svg)](https://oss.skylight.io/app/applications/9ACn286v2ne4) +# IT61 ## Requirements -- Ruby 2.4.3 (with bundler) -- PostgreSQL >= 9.5 -- Redis +- Ruby 3.1.1 +- PostgreSQL 16.2 ## Development setup @@ -14,15 +11,8 @@ 2. **optional:** Install `overcommit` for GIT commit hooks 3. **optional:** Install GIT hooks with `overcommit`: `overcommit --install -f` 4. **optional:** Run `overcommit --sign` to trust the hooks in this repository. -5. Before creating the database you must setup connection strings for PostgreSQL and Redis. Put these default values to `.env` file: - - ``` - DATABASE_URL=postgres://postgres@localhost:5432/it61 - REDIS_URL=redis://localhost:6379 - ``` - -6. Setup database and run migrations: `rails db:setup` -7. Run server: `./bin/rails server` +5. Setup database and run migrations: `rails db:setup` +6. Run server: `./bin/rails server` ## Docker development setup diff --git a/config/cable.yml b/config/cable.yml index e511601c..d040ac76 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,12 +1,15 @@ development: - adapter: async + adapter: postgresql test: - adapter: async + adapter: test staging: - adapter: async + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: it61_staging production: adapter: redis - url: <%= ENV.fetch("REDIS_URL", "redis://localhost:6379/1") %> + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: it61_production diff --git a/config/initializers/rack_mini_profiler.rb b/config/initializers/rack_mini_profiler.rb index 8f83fa28..4dddaabb 100644 --- a/config/initializers/rack_mini_profiler.rb +++ b/config/initializers/rack_mini_profiler.rb @@ -14,10 +14,6 @@ end if defined?(Rack::MiniProfiler) - uri = URI.parse(ENV["REDIS_URL"]) - Rack::MiniProfiler.config.storage_options = { host: uri.host, port: uri.port, password: uri.password } - Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore - skip = [ /assets/, /\/avatar\//, diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb deleted file mode 100644 index a971c9f3..00000000 --- a/config/initializers/redis.rb +++ /dev/null @@ -1 +0,0 @@ -$redis = Redis.new(url: ENV["REDIS_URL"]) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 2a871507..f265d35b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: "2" services: # Main application container app: @@ -14,12 +14,10 @@ services: - "3000:3000" environment: - DATABASE_URL=postgres://postgres@db:5432/it61 - - REDIS_URL=redis://redis:6379/1 # Uncomment if you REALLY know what this variable stands for and you REALLY need this # - BUNDLE_JOBS=6 depends_on: - db - - redis # Mounted folder for Gemfile gems container gems: @@ -32,6 +30,3 @@ services: image: postgres ports: - "6543:5432" - - redis: - image: redis