From 0a9b45bcac755a364408b7034258b2f449573aa3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:30:33 +0000 Subject: [PATCH 01/10] Bump factory_bot_rails from 6.4.4 to 6.5.0 Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 6.4.4 to 6.5.0. - [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases) - [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/main/NEWS.md) - [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v6.4.4...v6.5.0) --- updated-dependencies: - dependency-name: factory_bot_rails dependency-version: 6.5.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 85538f76..2bca80dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,11 +164,11 @@ GEM erubi (1.13.1) et-orbi (1.2.11) tzinfo - factory_bot (6.5.0) - activesupport (>= 5.0.0) - factory_bot_rails (6.4.4) + factory_bot (6.5.4) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.0) factory_bot (~> 6.5) - railties (>= 5.0.0) + railties (>= 6.1.0) fakeredis (0.1.4) ffaker (2.24.0) foreman (0.88.1) From 2a1bd2a1834f1b4d7be9e1a28e7f494d9653eca0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:55:48 +0000 Subject: [PATCH 02/10] Bump sentry-rails from 5.24.0 to 5.26.0 Bumps [sentry-rails](https://github.com/getsentry/sentry-ruby) from 5.24.0 to 5.26.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-ruby/compare/5.24.0...5.26.0) --- updated-dependencies: - dependency-name: sentry-rails dependency-version: 5.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e11abddd..5d593a6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -342,7 +342,7 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.3.0) - rdoc (6.14.0) + rdoc (6.14.1) erb psych (>= 4.0.0) redis (5.4.0) @@ -422,10 +422,10 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.24.0) + sentry-rails (5.26.0) railties (>= 5.0) - sentry-ruby (~> 5.24.0) - sentry-ruby (5.24.0) + sentry-ruby (~> 5.26.0) + sentry-ruby (5.26.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (6.5.0) From f71c5eb6202652df33e39979d4e7f57318e8a55b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:55:49 +0000 Subject: [PATCH 03/10] Bump sentry-ruby from 5.24.0 to 5.26.0 Bumps [sentry-ruby](https://github.com/getsentry/sentry-ruby) from 5.24.0 to 5.26.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-ruby/compare/5.24.0...5.26.0) --- updated-dependencies: - dependency-name: sentry-ruby dependency-version: 5.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e11abddd..13d2feea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -422,10 +422,10 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.24.0) + sentry-rails (5.26.0) railties (>= 5.0) - sentry-ruby (~> 5.24.0) - sentry-ruby (5.24.0) + sentry-ruby (~> 5.26.0) + sentry-ruby (5.26.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (6.5.0) From de8c79395f3542f9cd7c20862d0cf8652b529da8 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:06:47 +0200 Subject: [PATCH 04/10] Fixed imports page buttons in both light and dark mode. #1481 --- CHANGELOG.md | 8 +++++++- app/views/imports/index.html.erb | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20458ada..946eb713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -# [0.29.0] - 2025-06-30 +# [0.29.1] - UNRELEASED + +## Fixed + +- Buttons on the imports page now looks better in both light and dark mode. #1481 + +# [0.29.0] - 2025-07-02 You can now move your user data between Dawarich instances. Simply go to your Account settings and click on the "Export my data" button under the password section. An export will be created and you will be able to download it on Exports page once it's ready. diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb index 431ab51b..f86c2c5d 100644 --- a/app/views/imports/index.html.erb +++ b/app/views/imports/index.html.erb @@ -8,12 +8,12 @@ <% if current_user.safe_settings.immich_url && current_user.safe_settings.immich_api_key %> <%= link_to 'Import Immich data', settings_background_jobs_path(job_name: 'start_immich_import'), method: :post, data: { confirm: 'Are you sure?', turbo_confirm: 'Are you sure?', turbo_method: :post }, class: 'rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium' %> <% else %> - Import Immich data + Import Immich data <% end %> <% if current_user.safe_settings.photoprism_url && current_user.safe_settings.photoprism_api_key %> <%= link_to 'Import Photoprism data', settings_background_jobs_path(job_name: 'start_photoprism_import'), method: :post, data: { confirm: 'Are you sure?', turbo_confirm: 'Are you sure?', turbo_method: :post }, class: 'rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium' %> <% else %> - Import Photoprism data + Import Photoprism data <% end %> From 787dd9cde8781601a6bcb1898ef4cdf604062a7c Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:17:21 +0200 Subject: [PATCH 05/10] Fix docker-compose.yml --- docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7b20a74f..ca0fb27c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -67,7 +67,7 @@ services: APPLICATION_HOSTS: localhost TIME_ZONE: Europe/London APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: false + PROMETHEUS_EXPORTER_ENABLED: "false" PROMETHEUS_EXPORTER_HOST: 0.0.0.0 PROMETHEUS_EXPORTER_PORT: 9394 SELF_HOSTED: "true" @@ -119,7 +119,7 @@ services: APPLICATION_HOSTS: localhost BACKGROUND_PROCESSING_CONCURRENCY: 10 APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: false + PROMETHEUS_EXPORTER_ENABLED: "false" PROMETHEUS_EXPORTER_HOST: dawarich_app PROMETHEUS_EXPORTER_PORT: 9394 SELF_HOSTED: "true" From 0fcf70834e76b528bd8adb86d45b1e0d13faf767 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:22:31 +0200 Subject: [PATCH 06/10] Allow customizing Redis database numbers for caching, background jobs and websocket connections. --- CHANGELOG.md | 2 ++ README.md | 1 - config/cable.yml | 4 ++-- config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- config/initializers/geocoder.rb | 2 +- config/initializers/sidekiq.rb | 4 ++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 946eb713..cc04cfd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixed - Buttons on the imports page now looks better in both light and dark mode. #1481 +- The PROMETHEUS_EXPORTER_ENABLED environment variable default value is now "false", in quotes. +- The RAILS_CACHE_DB, RAILS_JOB_QUEUE_DB and RAILS_WS_DB environment variables can be used to set the Redis database number for caching, background jobs and websocket connections respectively. Default values are now 0, 1 and 2 respectively. #1420 # [0.29.0] - 2025-07-02 diff --git a/README.md b/README.md index f946478d..789bd889 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # 🌍 Dawarich: Your Self-Hosted Location History Tracker [![Discord](https://dcbadge.limes.pink/api/server/pHsBjpt5J8)](https://discord.gg/pHsBjpt5J8) | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/H2H3IDYDD) | [![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dfreika%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/freika) -Donate using crypto: [0x6bAd13667692632f1bF926cA9B421bEe7EaEB8D4](https://etherscan.io/address/0x6bAd13667692632f1bF926cA9B421bEe7EaEB8D4) [![CircleCI](https://circleci.com/gh/Freika/dawarich.svg?style=svg)](https://app.circleci.com/pipelines/github/Freika/dawarich) diff --git a/config/cable.yml b/config/cable.yml index 917fe123..ae88845e 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,11 +1,11 @@ development: adapter: redis - url: <%= "#{ENV.fetch("REDIS_URL")}/2" %> + url: <%= "#{ENV.fetch("REDIS_URL")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %> test: adapter: test production: adapter: redis - url: <%= "#{ENV.fetch("REDIS_URL")}/2" %> + url: <%= "#{ENV.fetch("REDIS_URL")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %> channel_prefix: dawarich_production diff --git a/config/environments/development.rb b/config/environments/development.rb index fadc861a..68c0aeaa 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -26,7 +26,7 @@ Rails.application.configure do # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/0" } + config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}" } if Rails.root.join('tmp/caching-dev.txt').exist? config.action_controller.perform_caching = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 22b3a3d2..cd8cd778 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -73,7 +73,7 @@ Rails.application.configure do config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info') # Use a different cache store in production. - config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/0" } + config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}" } # Use a real queuing backend for Active Job (and separate queues per environment). config.active_job.queue_adapter = :sidekiq diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index 4ddfe9d4..13a8bbdd 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -4,7 +4,7 @@ settings = { debug_mode: true, timeout: 5, units: :km, - cache: Redis.new(url: "#{ENV['REDIS_URL']}/0"), + cache: Redis.new(url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}"), always_raise: :all, http_headers: { 'User-Agent' => "Dawarich #{APP_VERSION} (https://dawarich.app)" diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 49b0c98b..323655e3 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Sidekiq.configure_server do |config| - config.redis = { url: "#{ENV['REDIS_URL']}/1" } + config.redis = { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_JOB_QUEUE_DB', 1)}" } config.logger = Sidekiq::Logger.new($stdout) if ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true' @@ -24,7 +24,7 @@ Sidekiq.configure_server do |config| end Sidekiq.configure_client do |config| - config.redis = { url: "#{ENV['REDIS_URL']}/1" } + config.redis = { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_JOB_QUEUE_DB', 1)}" } end Sidekiq::Queue['reverse_geocoding'].limit = 1 if Sidekiq.server? && DawarichSettings.photon_uses_komoot_io? From ce720d089a3405a94a895a84617996b6c135e329 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:23:30 +0200 Subject: [PATCH 07/10] Update app version --- .app_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.app_version b/.app_version index ae6dd4e2..25939d35 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.29.0 +0.29.1 From 48d464d5bbc290402ec5ec04ca79f3b15cdd2ac9 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:38:00 +0200 Subject: [PATCH 08/10] Add parallel gem to Gemfile --- Gemfile | 1 + Gemfile.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 8515a41c..614a2e95 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem 'importmap-rails' gem 'kaminari' gem 'lograge' gem 'oj' +gem 'parallel' gem 'pg' gem 'prometheus_exporter' gem 'activerecord-postgis-adapter' diff --git a/Gemfile.lock b/Gemfile.lock index 62c7dfaa..640e815e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -540,6 +540,7 @@ DEPENDENCIES kaminari lograge oj + parallel pg prometheus_exporter pry-byebug From 2e825d08e0b163dcbfea46ac0b2f396bd0e6d4de Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:42:28 +0200 Subject: [PATCH 09/10] Update app version --- CHANGELOG.md | 2 +- app.json | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc04cfd9..633662d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -# [0.29.1] - UNRELEASED +# [0.29.1] - 2025-07-02 ## Fixed diff --git a/app.json b/app.json index 2f2f9e51..9c425d4e 100644 --- a/app.json +++ b/app.json @@ -9,5 +9,17 @@ "dokku": { "predeploy": "bundle exec rails db:migrate" } + }, + "healthchecks": { + "web": [ + { + "type": "startup", + "name": "web check", + "description": "Checking if the app responds to the /api/v1/health endpoint", + "path": "/api/v1/health", + "attempts": 10, + "interval": 10 + } + ] } } From 3138a25ab1d65e26669e54c08cca1df321e4c336 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Wed, 2 Jul 2025 21:50:52 +0200 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ config/environments/production.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633662d9..8cca7794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - The PROMETHEUS_EXPORTER_ENABLED environment variable default value is now "false", in quotes. - The RAILS_CACHE_DB, RAILS_JOB_QUEUE_DB and RAILS_WS_DB environment variables can be used to set the Redis database number for caching, background jobs and websocket connections respectively. Default values are now 0, 1 and 2 respectively. #1420 +## Changed + +- Skip DNS rebinding protection for the health check endpoint. +- Added health check to app.json. + # [0.29.0] - 2025-07-02 You can now move your user data between Dawarich instances. Simply go to your Account settings and click on the "Export my data" button under the password section. An export will be created and you will be able to download it on Exports page once it's ready. diff --git a/config/environments/production.rb b/config/environments/production.rb index cd8cd778..7207e549 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -99,8 +99,8 @@ Rails.application.configure do # "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" } } + # Skip DNS rebinding protection for the health check endpoint. + config.host_authorization = { exclude: ->(request) { request.path == "/api/v1/health" } } hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',') config.action_mailer.default_url_options = { host: ENV['SMTP_DOMAIN'] }