mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Merge branch 'dev' into feature/custom-map-tiles
This commit is contained in:
commit
7e5440205e
4 changed files with 30 additions and 16 deletions
30
Gemfile.lock
30
Gemfile.lock
|
|
@ -118,7 +118,7 @@ GEM
|
||||||
data_migrate (11.2.0)
|
data_migrate (11.2.0)
|
||||||
activerecord (>= 6.1)
|
activerecord (>= 6.1)
|
||||||
railties (>= 6.1)
|
railties (>= 6.1)
|
||||||
database_consistency (2.0.3)
|
database_consistency (2.0.4)
|
||||||
activerecord (>= 3.2)
|
activerecord (>= 3.2)
|
||||||
date (3.4.1)
|
date (3.4.1)
|
||||||
debug (1.10.0)
|
debug (1.10.0)
|
||||||
|
|
@ -160,7 +160,7 @@ GEM
|
||||||
rake
|
rake
|
||||||
groupdate (6.5.1)
|
groupdate (6.5.1)
|
||||||
activesupport (>= 7)
|
activesupport (>= 7)
|
||||||
hashdiff (1.1.1)
|
hashdiff (1.1.2)
|
||||||
httparty (0.22.0)
|
httparty (0.22.0)
|
||||||
csv
|
csv
|
||||||
mini_mime (>= 1.0.0)
|
mini_mime (>= 1.0.0)
|
||||||
|
|
@ -224,18 +224,18 @@ GEM
|
||||||
net-smtp (0.5.0)
|
net-smtp (0.5.0)
|
||||||
net-protocol
|
net-protocol
|
||||||
nio4r (2.7.4)
|
nio4r (2.7.4)
|
||||||
nokogiri (1.18.1)
|
nokogiri (1.18.2)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.1-aarch64-linux-gnu)
|
nokogiri (1.18.2-aarch64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.1-arm-linux-gnu)
|
nokogiri (1.18.2-arm-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.1-arm64-darwin)
|
nokogiri (1.18.2-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.1-x86_64-darwin)
|
nokogiri (1.18.2-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.1-x86_64-linux-gnu)
|
nokogiri (1.18.2-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oj (3.16.9)
|
oj (3.16.9)
|
||||||
bigdecimal (>= 3.0)
|
bigdecimal (>= 3.0)
|
||||||
|
|
@ -273,7 +273,7 @@ GEM
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.4.0)
|
raabro (1.4.0)
|
||||||
racc (1.8.1)
|
racc (1.8.1)
|
||||||
rack (3.1.8)
|
rack (3.1.9)
|
||||||
rack-session (2.1.0)
|
rack-session (2.1.0)
|
||||||
base64 (>= 0.1.0)
|
base64 (>= 0.1.0)
|
||||||
rack (>= 3.0.0)
|
rack (>= 3.0.0)
|
||||||
|
|
@ -312,7 +312,7 @@ GEM
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.2.1)
|
rake (13.2.1)
|
||||||
rdoc (6.11.0)
|
rdoc (6.12.0)
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
redis (5.3.0)
|
redis (5.3.0)
|
||||||
redis-client (>= 0.22.0)
|
redis-client (>= 0.22.0)
|
||||||
|
|
@ -326,12 +326,12 @@ GEM
|
||||||
responders (3.1.1)
|
responders (3.1.1)
|
||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
rexml (3.3.8)
|
rexml (3.4.0)
|
||||||
rgeo (3.0.1)
|
rgeo (3.0.1)
|
||||||
rgeo-activerecord (8.0.0)
|
rgeo-activerecord (8.0.0)
|
||||||
activerecord (>= 7.0)
|
activerecord (>= 7.0)
|
||||||
rgeo (>= 3.0)
|
rgeo (>= 3.0)
|
||||||
rspec-core (3.13.2)
|
rspec-core (3.13.3)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-expectations (3.13.3)
|
rspec-expectations (3.13.3)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
|
@ -339,7 +339,7 @@ GEM
|
||||||
rspec-mocks (3.13.2)
|
rspec-mocks (3.13.2)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (7.1.0)
|
rspec-rails (7.1.1)
|
||||||
actionpack (>= 7.0)
|
actionpack (>= 7.0)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.0)
|
||||||
railties (>= 7.0)
|
railties (>= 7.0)
|
||||||
|
|
@ -347,7 +347,7 @@ GEM
|
||||||
rspec-expectations (~> 3.13)
|
rspec-expectations (~> 3.13)
|
||||||
rspec-mocks (~> 3.13)
|
rspec-mocks (~> 3.13)
|
||||||
rspec-support (~> 3.13)
|
rspec-support (~> 3.13)
|
||||||
rspec-support (3.13.1)
|
rspec-support (3.13.2)
|
||||||
rswag-api (2.16.0)
|
rswag-api (2.16.0)
|
||||||
activesupport (>= 5.2, < 8.1)
|
activesupport (>= 5.2, < 8.1)
|
||||||
railties (>= 5.2, < 8.1)
|
railties (>= 5.2, < 8.1)
|
||||||
|
|
@ -442,7 +442,7 @@ GEM
|
||||||
useragent (0.16.11)
|
useragent (0.16.11)
|
||||||
warden (1.2.9)
|
warden (1.2.9)
|
||||||
rack (>= 2.0.9)
|
rack (>= 2.0.9)
|
||||||
webmock (3.24.0)
|
webmock (3.25.0)
|
||||||
addressable (>= 2.8.0)
|
addressable (>= 2.8.0)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,9 @@ PHOTON_API_HOST = ENV.fetch('PHOTON_API_HOST', nil)
|
||||||
PHOTON_API_KEY = ENV.fetch('PHOTON_API_KEY', nil)
|
PHOTON_API_KEY = ENV.fetch('PHOTON_API_KEY', nil)
|
||||||
PHOTON_API_USE_HTTPS = ENV.fetch('PHOTON_API_USE_HTTPS', 'true') == 'true'
|
PHOTON_API_USE_HTTPS = ENV.fetch('PHOTON_API_USE_HTTPS', 'true') == 'true'
|
||||||
|
|
||||||
|
NOMINATIM_API_HOST = ENV.fetch('NOMINATIM_API_HOST', nil)
|
||||||
|
NOMINATIM_API_KEY = ENV.fetch('NOMINATIM_API_KEY', nil)
|
||||||
|
NOMINATIM_API_USE_HTTPS = ENV.fetch('NOMINATIM_API_USE_HTTPS', 'true') == 'true'
|
||||||
|
|
||||||
GEOAPIFY_API_KEY = ENV.fetch('GEOAPIFY_API_KEY', nil)
|
GEOAPIFY_API_KEY = ENV.fetch('GEOAPIFY_API_KEY', nil)
|
||||||
# /Reverse geocoding settings
|
# /Reverse geocoding settings
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
class DawarichSettings
|
class DawarichSettings
|
||||||
class << self
|
class << self
|
||||||
def reverse_geocoding_enabled?
|
def reverse_geocoding_enabled?
|
||||||
@reverse_geocoding_enabled ||= photon_enabled? || geoapify_enabled?
|
@reverse_geocoding_enabled ||= photon_enabled? || geoapify_enabled? || nominatim_enabled?
|
||||||
end
|
end
|
||||||
|
|
||||||
def photon_enabled?
|
def photon_enabled?
|
||||||
|
|
@ -24,5 +24,9 @@ class DawarichSettings
|
||||||
ENV['PROMETHEUS_EXPORTER_HOST'].present? &&
|
ENV['PROMETHEUS_EXPORTER_HOST'].present? &&
|
||||||
ENV['PROMETHEUS_EXPORTER_PORT'].present?
|
ENV['PROMETHEUS_EXPORTER_PORT'].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nominatim_enabled?
|
||||||
|
@nominatim_enabled ||= NOMINATIM_API_HOST.present?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,12 @@ if PHOTON_API_HOST.present?
|
||||||
elsif GEOAPIFY_API_KEY.present?
|
elsif GEOAPIFY_API_KEY.present?
|
||||||
settings[:lookup] = :geoapify
|
settings[:lookup] = :geoapify
|
||||||
settings[:api_key] = GEOAPIFY_API_KEY
|
settings[:api_key] = GEOAPIFY_API_KEY
|
||||||
|
elsif NOMINATIM_API_HOST.present?
|
||||||
|
settings[:lookup] = :nominatim
|
||||||
|
settings[:nominatim] = { use_https: NOMINATIM_API_USE_HTTPS, host: NOMINATIM_API_HOST }
|
||||||
|
if NOMINATIM_API_KEY.present?
|
||||||
|
settings[:api_key] = NOMINATIM_API_KEY
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Geocoder.configure(settings)
|
Geocoder.configure(settings)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue