diff --git a/.drone.yml b/.drone.yml index dbe8c0f..daf1849 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,7 @@ steps: environment: RAILS_ENV: test REDIS_URL: redis://redis:6379/0 + RS_REDIS_URL: redis://redis:6379/1 commands: - bundle config unset deployment - bundle config set cache_all 'true' diff --git a/.env.example b/.env.example index fef8c93..081d0ae 100644 --- a/.env.example +++ b/.env.example @@ -26,6 +26,7 @@ GITEA_PUBLIC_URL='https://gitea.kosmos.org' MASTODON_PUBLIC_URL='https://kosmos.social' MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org' RS_STORAGE_URL='https://storage.kosmos.org' +RS_REDIS_URL='redis://localhost:6379/2' EJABBERD_ADMIN_URL='https://xmpp.kosmos.org/admin' EJABBERD_API_URL='https://xmpp.kosmos.org/api' diff --git a/.env.test b/.env.test index 0bd5bc9..33761c3 100644 --- a/.env.test +++ b/.env.test @@ -1,6 +1,6 @@ PRIMARY_DOMAIN=kosmos.org -REDIS_URL='redis://localhost:6379/21' +REDIS_URL='redis://localhost:6379/0' DISCOURSE_PUBLIC_URL='http://discourse.example.com' DISCOURSE_CONNECT_SECRET='discourse_connect_ftw' @@ -14,5 +14,6 @@ LNDHUB_PUBLIC_URL='https://lndhub.kosmos.org' LNDHUB_PUBLIC_KEY='024cd3be18617f39cf645851e3ba63f51fc13f0bb09e3bb25e6fd4de556486d946' RS_STORAGE_URL='https://storage.kosmos.org' +RS_REDIS_URL='redis://localhost:6379/1' WEBHOOKS_ALLOWED_IPS='10.1.1.23' diff --git a/app/models/setting.rb b/app/models/setting.rb index f32c86f..fc3b068 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -12,7 +12,7 @@ class Setting < RailsSettings::Base # Internal services # - field :redis_url, type: :string, readonly: true, + field :redis_url, type: :string, default: ENV["REDIS_URL"] || "redis://localhost:6379/0" # @@ -131,4 +131,7 @@ class Setting < RailsSettings::Base field :rs_storage_url, type: :string, default: ENV["RS_STORAGE_URL"].presence + + field :rs_redis_url, type: :string, + default: ENV["RS_REDIS_URL"] || "redis://localhost:6379/1" end diff --git a/app/views/admin/settings/services/_remotestorage.html.erb b/app/views/admin/settings/services/_remotestorage.html.erb index 42aea32..5b8f47b 100644 --- a/app/views/admin/settings/services/_remotestorage.html.erb +++ b/app/views/admin/settings/services/_remotestorage.html.erb @@ -11,7 +11,11 @@ <% if Setting.remotestorage_enabled? %> <%= render FormElements::FieldsetResettableSettingComponent.new( key: :rs_storage_url, - title: "Storage URL" + title: "Storage Base URL" + ) %> + <%= render FormElements::FieldsetResettableSettingComponent.new( + key: :rs_redis_url, + title: "Redis URL" ) %> <% end %> diff --git a/docker-compose.yml b/docker-compose.yml index 9242fb6..3690616 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ services: RAILS_ENV: development PRIMARY_DOMAIN: kosmos.org REDIS_URL: redis://redis:6379/0 + RS_REDIS_URL: redis://redis:6379/1 LDAP_HOST: ldap LDAP_PORT: 3389 LDAP_ADMIN_PASSWORD: passthebutter @@ -57,6 +58,7 @@ services: RAILS_ENV: development PRIMARY_DOMAIN: kosmos.org REDIS_URL: redis://redis:6379/0 + RS_REDIS_URL: redis://redis:6379/1 LDAP_HOST: ldap LDAP_PORT: 3389 LDAP_ADMIN_PASSWORD: passthebutter