mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Implement support for custom Photon API host
This commit is contained in:
parent
04a2150959
commit
39bc6aa58a
6 changed files with 23 additions and 14 deletions
|
|
@ -1 +1 @@
|
|||
0.9.8
|
||||
0.9.10
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ DATABASE_PASSWORD=password
|
|||
DATABASE_NAME=dawarich_development
|
||||
DATABASE_PORT=5432
|
||||
REDIS_URL=redis://localhost:6379/1
|
||||
PHOTON_API_HOST='photon.komoot.io'
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ 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.9.10] — 2024-08-14
|
||||
|
||||
### Added
|
||||
|
||||
- PHOTON_API_HOST env variable to set the host of the Photon API. It will will allow you to use your own Photon API instance instead of the default one.
|
||||
|
||||
## [0.9.9] — 2024-07-30
|
||||
|
||||
|
|
|
|||
|
|
@ -11,22 +11,22 @@ class OwnTracks::Params
|
|||
{
|
||||
latitude: params[:lat],
|
||||
longitude: params[:lon],
|
||||
battery_status: battery_status,
|
||||
battery: params[:batt],
|
||||
ping: params[:p],
|
||||
altitude: params[:alt],
|
||||
accuracy: params[:acc],
|
||||
vertical_accuracy: params[:vac],
|
||||
velocity: params[:vel],
|
||||
connection: connection,
|
||||
ssid: params[:SSID],
|
||||
bssid: params[:BSSID],
|
||||
trigger: trigger,
|
||||
tracker_id: params[:tid],
|
||||
timestamp: params[:tst].to_i,
|
||||
inrids: params[:inrids],
|
||||
in_regions: params[:inregions],
|
||||
topic: params[:topic],
|
||||
battery_status:,
|
||||
connection:,
|
||||
trigger:,
|
||||
raw_data: params.deep_stringify_keys
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
MIN_MINUTES_SPENT_IN_CITY = ENV.fetch('MIN_MINUTES_SPENT_IN_CITY', 60).to_i
|
||||
REVERSE_GEOCODING_ENABLED = ENV.fetch('REVERSE_GEOCODING_ENABLED', 'true') == 'true'
|
||||
PHOTON_API_HOST = ENV.fetch('PHOTON_API_HOST', nil)
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Geocoder.configure(
|
||||
# geocoding service request timeout, in seconds (default 3):
|
||||
# timeout: 5,
|
||||
|
||||
# set default units to kilometers:
|
||||
settings = {
|
||||
timeout: 5,
|
||||
units: :km,
|
||||
|
||||
# caching (see Caching section below for details):
|
||||
cache: Redis.new,
|
||||
always_raise: :all,
|
||||
cache_options: {
|
||||
expiration: 1.day # Defaults to `nil`
|
||||
# prefix: "another_key:" # Defaults to `geocoder:`
|
||||
expiration: 1.day
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if defined?(PHOTON_API_HOST)
|
||||
settings[:lookup] = :photon
|
||||
settings[:photon] = { host: PHOTON_API_HOST }
|
||||
end
|
||||
|
||||
Geocoder.configure(settings)
|
||||
|
|
|
|||
Loading…
Reference in a new issue