mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Compare commits
10 commits
598ebc1861
...
5160734a15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5160734a15 | ||
|
|
2206622726 | ||
|
|
9bcd522e25 | ||
|
|
6a6c3c938f | ||
|
|
59a4d760bf | ||
|
|
fbdf630502 | ||
|
|
c74ba7d1fe | ||
|
|
6ec24ffc3d | ||
|
|
b7aa05f4ea | ||
|
|
35f4c0f1f6 |
15 changed files with 49 additions and 16 deletions
|
|
@ -1 +1 @@
|
||||||
0.29.2
|
0.30.0
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
|
||||||
# [0.29.2] - 2025-07-12
|
# [0.30.0] - 2025-07-21
|
||||||
|
|
||||||
⚠️ If you were using RC, please run the following commands in the console, otherwise read on. ⚠️
|
⚠️ If you were using RC, please run the following commands in the console, otherwise read on. ⚠️
|
||||||
|
|
||||||
|
|
@ -67,11 +67,14 @@ end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
- Links in emails will be based on the `DOMAIN` environment variable instead of `SMTP_DOMAIN`.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- Swagger documentation is now valid again.
|
- Swagger documentation is now valid again.
|
||||||
- Invalid owntracks points are now ignored.
|
- Invalid owntracks points are now ignored.
|
||||||
|
- An older Owntrack's .rec format is now also supported.
|
||||||
|
- Course and course accuracy are now rounded to 8 decimal places to fix the issue with points creation.
|
||||||
|
|
||||||
# [0.29.1] - 2025-07-02
|
# [0.29.1] - 2025-07-02
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,17 +36,17 @@ class MapController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_distance
|
def calculate_distance
|
||||||
total_distance_meters = 0
|
total_distance = 0
|
||||||
|
|
||||||
@coordinates.each_cons(2) do
|
@coordinates.each_cons(2) do
|
||||||
distance_km = Geocoder::Calculations.distance_between(
|
distance_km = Geocoder::Calculations.distance_between(
|
||||||
[_1[0], _1[1]], [_2[0], _2[1]], units: :km
|
[_1[0], _1[1]], [_2[0], _2[1]], units: :km
|
||||||
)
|
)
|
||||||
|
|
||||||
total_distance_meters += distance_km
|
total_distance += distance_km
|
||||||
end
|
end
|
||||||
|
|
||||||
total_distance_meters.round
|
total_distance.round
|
||||||
end
|
end
|
||||||
|
|
||||||
def parsed_start_at
|
def parsed_start_at
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,12 @@ class OwnTracks::RecParser
|
||||||
|
|
||||||
def call
|
def call
|
||||||
file.split("\n").map do |line|
|
file.split("\n").map do |line|
|
||||||
|
# Try tab-separated first, then fall back to whitespace-separated
|
||||||
parts = line.split("\t")
|
parts = line.split("\t")
|
||||||
|
|
||||||
|
# If tab splitting didn't work (only 1 part), try whitespace splitting
|
||||||
|
parts = line.split(/\s+/) if parts.size == 1
|
||||||
|
|
||||||
Oj.load(parts[2]) if parts.size > 2 && parts[1].strip == '*'
|
Oj.load(parts[2]) if parts.size > 2 && parts[1].strip == '*'
|
||||||
end.compact
|
end.compact
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
development:
|
development:
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: <%= "#{ENV.fetch("REDIS_URL")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %>
|
url: <%= "#{ENV.fetch("REDIS_URL")}" %>
|
||||||
|
db: <%= "#{ENV.fetch('RAILS_WS_DB', 2)}" %>
|
||||||
|
|
||||||
test:
|
test:
|
||||||
adapter: test
|
adapter: test
|
||||||
|
|
||||||
production:
|
production:
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: <%= "#{ENV.fetch("REDIS_URL")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %>
|
url: <%= "#{ENV.fetch("REDIS_URL")}" %>
|
||||||
|
db: <%= "#{ENV.fetch('RAILS_WS_DB', 2)}" %>
|
||||||
channel_prefix: dawarich_production
|
channel_prefix: dawarich_production
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Rails.application.configure do
|
||||||
|
|
||||||
# Enable/disable caching. By default caching is disabled.
|
# Enable/disable caching. By default caching is disabled.
|
||||||
# Run rails dev:cache to toggle caching.
|
# Run rails dev:cache to toggle caching.
|
||||||
config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}" }
|
config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'], db: ENV.fetch('RAILS_CACHE_DB', 0) }
|
||||||
|
|
||||||
if Rails.root.join('tmp/caching-dev.txt').exist?
|
if Rails.root.join('tmp/caching-dev.txt').exist?
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ Rails.application.configure do
|
||||||
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
|
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
|
||||||
|
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
config.cache_store = :redis_cache_store, { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}" }
|
config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'], db: ENV.fetch('RAILS_CACHE_DB', 0) }
|
||||||
|
|
||||||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
# Use a real queuing backend for Active Job (and separate queues per environment).
|
||||||
config.active_job.queue_adapter = :sidekiq
|
config.active_job.queue_adapter = :sidekiq
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ settings = {
|
||||||
debug_mode: true,
|
debug_mode: true,
|
||||||
timeout: 5,
|
timeout: 5,
|
||||||
units: :km,
|
units: :km,
|
||||||
cache: Redis.new(url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_CACHE_DB', 0)}"),
|
cache: Redis.new(url: ENV['REDIS_URL'], db: ENV.fetch('RAILS_CACHE_DB', 0)),
|
||||||
always_raise: :all,
|
always_raise: :all,
|
||||||
http_headers: {
|
http_headers: {
|
||||||
'User-Agent' => "Dawarich #{APP_VERSION} (https://dawarich.app)"
|
'User-Agent' => "Dawarich #{APP_VERSION} (https://dawarich.app)"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Sidekiq.configure_server do |config|
|
Sidekiq.configure_server do |config|
|
||||||
config.redis = { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_JOB_QUEUE_DB', 1)}" }
|
config.redis = { url: ENV['REDIS_URL'], db: ENV.fetch('RAILS_JOB_QUEUE_DB', 1) }
|
||||||
config.logger = Sidekiq::Logger.new($stdout)
|
config.logger = Sidekiq::Logger.new($stdout)
|
||||||
|
|
||||||
if ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true'
|
if ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true'
|
||||||
|
|
@ -24,7 +24,7 @@ Sidekiq.configure_server do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq.configure_client do |config|
|
Sidekiq.configure_client do |config|
|
||||||
config.redis = { url: "#{ENV['REDIS_URL']}/#{ENV.fetch('RAILS_JOB_QUEUE_DB', 1)}" }
|
config.redis = { url: ENV['REDIS_URL'], db: ENV.fetch('RAILS_JOB_QUEUE_DB', 1) }
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq::Queue['reverse_geocoding'].limit = 1 if Sidekiq.server? && DawarichSettings.photon_uses_komoot_io?
|
Sidekiq::Queue['reverse_geocoding'].limit = 1 if Sidekiq.server? && DawarichSettings.photon_uses_komoot_io?
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ FactoryBot.define do
|
||||||
|
|
||||||
settings do
|
settings do
|
||||||
{
|
{
|
||||||
'route_opacity' => '0.5',
|
'route_opacity' => 60,
|
||||||
'meters_between_routes' => '500',
|
'meters_between_routes' => '500',
|
||||||
'minutes_between_routes' => '30',
|
'minutes_between_routes' => '30',
|
||||||
'fog_of_war_meters' => '100',
|
'fog_of_war_meters' => '100',
|
||||||
|
|
|
||||||
10
spec/fixtures/files/owntracks/2023-02_old.rec
vendored
Normal file
10
spec/fixtures/files/owntracks/2023-02_old.rec
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
2023-02-20T18:46:22Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918783,"lat":22.0687934,"lon":24.7941786,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918782,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:25Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":13,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918785,"lat":22.0687967,"lon":24.7941813,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918785,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:25Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":13,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918790,"lat":22.0687967,"lon":24.7941813,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918785,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:35Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918795,"lat":22.0687906,"lon":24.794195,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918795,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:40Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918800,"lat":22.0687967,"lon":24.7941859,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918800,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:45Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918805,"lat":22.0687946,"lon":24.7941883,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918805,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:50Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918810,"lat":22.0687912,"lon":24.7941837,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918810,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:55Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918815,"lat":22.0687927,"lon":24.794186,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918815,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:46:55Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918815,"lat":22.0687937,"lon":24.794186,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918815,"vac":0,"vel":0,"_http":true}
|
||||||
|
2023-02-20T18:47:00Z * {"_type":"location","BSSID":"6c:c4:9f:e0:bb:b1","SSID":"WiFi","acc":14,"alt":136,"batt":38,"bs":1,"conn":"w","created_at":1676918820,"lat":22.0687937,"lon":24.794186,"m":2,"tid":"l6","topic":"owntracks/pixel6/pixel99","tst":1676918820,"vac":0,"vel":0,"_http":true}
|
||||||
|
|
@ -132,7 +132,7 @@ RSpec.describe Tracks::CreateJob, type: :job do
|
||||||
user,
|
user,
|
||||||
start_at: nil,
|
start_at: nil,
|
||||||
end_at: nil,
|
end_at: nil,
|
||||||
mode: :bulk
|
mode: :incremental
|
||||||
)
|
)
|
||||||
expect(generator_instance).to have_received(:call)
|
expect(generator_instance).to have_received(:call)
|
||||||
expect(Notifications::Create).to have_received(:new).with(
|
expect(Notifications::Create).to have_received(:new).with(
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ RSpec.describe TrackSerializer do
|
||||||
let(:track) { create(:track, user: user, original_path: 'LINESTRING(0 0, 1 1, 2 2)') }
|
let(:track) { create(:track, user: user, original_path: 'LINESTRING(0 0, 1 1, 2 2)') }
|
||||||
|
|
||||||
it 'converts geometry to WKT string format' do
|
it 'converts geometry to WKT string format' do
|
||||||
expect(serialized_track[:original_path]).to eq('LINESTRING (0 0, 1 1, 2 2)')
|
expect(serialized_track[:original_path]).to match(/LINESTRING \(0(\.0)? 0(\.0)?, 1(\.0)? 1(\.0)?, 2(\.0)? 2(\.0)?\)/)
|
||||||
expect(serialized_track[:original_path]).to be_a(String)
|
expect(serialized_track[:original_path]).to be_a(String)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -78,5 +78,19 @@ RSpec.describe OwnTracks::Importer do
|
||||||
expect(Point.first.velocity).to eq('1.4')
|
expect(Point.first.velocity).to eq('1.4')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when file is old' do
|
||||||
|
let(:file_path) { Rails.root.join('spec/fixtures/files/owntracks/2023-02_old.rec') }
|
||||||
|
|
||||||
|
it 'creates points' do
|
||||||
|
expect { parser }.to change { Point.count }.by(9)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'correctly writes attributes' do
|
||||||
|
parser
|
||||||
|
|
||||||
|
point = Point.first
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ RSpec.describe 'Map Interaction', type: :system do
|
||||||
# Find and update route opacity
|
# Find and update route opacity
|
||||||
within('.leaflet-settings-panel') do
|
within('.leaflet-settings-panel') do
|
||||||
opacity_input = find('#route-opacity')
|
opacity_input = find('#route-opacity')
|
||||||
expect(opacity_input.value).to eq('50') # Default value
|
expect(opacity_input.value).to eq('60') # Default value
|
||||||
|
|
||||||
# Change opacity to 80%
|
# Change opacity to 80%
|
||||||
opacity_input.fill_in(with: '80')
|
opacity_input.fill_in(with: '80')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue