mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Update sidekiq credentials
This commit is contained in:
parent
e2d0807e9a
commit
e9680fd6e4
3 changed files with 14 additions and 10 deletions
|
|
@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- Vector maps are supported in non-self-hosted mode.
|
- Vector maps are supported in non-self-hosted mode.
|
||||||
- Credentials for Sidekiq UI are now being set via environment variables: `SIDEKIQ_USERNAME` and `SIDEKIQ_PASSWORD`. Default credentials are `sidekiq` and `password`.
|
- Credentials for Sidekiq UI are now being set via environment variables: `SIDEKIQ_USERNAME` and `SIDEKIQ_PASSWORD`. Default credentials are `sidekiq` and `password`. If you don't set them, in self-hosted mode, Sidekiq UI will not be protected by basic auth.
|
||||||
- New import page now shows progress of the upload.
|
- New import page now shows progress of the upload.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,17 @@ Rails.application.routes.draw do
|
||||||
mount Rswag::Api::Engine => '/api-docs'
|
mount Rswag::Api::Engine => '/api-docs'
|
||||||
mount Rswag::Ui::Engine => '/api-docs'
|
mount Rswag::Ui::Engine => '/api-docs'
|
||||||
|
|
||||||
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
|
unless DawarichSettings.self_hosted?
|
||||||
ActiveSupport::SecurityUtils.secure_compare(
|
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
|
||||||
::Digest::SHA256.hexdigest(username),
|
|
||||||
::Digest::SHA256.hexdigest(ENV['SIDEKIQ_USERNAME'])
|
|
||||||
) &
|
|
||||||
ActiveSupport::SecurityUtils.secure_compare(
|
ActiveSupport::SecurityUtils.secure_compare(
|
||||||
::Digest::SHA256.hexdigest(password),
|
::Digest::SHA256.hexdigest(username),
|
||||||
::Digest::SHA256.hexdigest(ENV['SIDEKIQ_PASSWORD'])
|
::Digest::SHA256.hexdigest(ENV['SIDEKIQ_USERNAME'])
|
||||||
)
|
) &
|
||||||
|
ActiveSupport::SecurityUtils.secure_compare(
|
||||||
|
::Digest::SHA256.hexdigest(password),
|
||||||
|
::Digest::SHA256.hexdigest(ENV['SIDEKIQ_PASSWORD'])
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
authenticate :user, lambda { |u|
|
authenticate :user, lambda { |u|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ namespace :points do
|
||||||
task migrate_to_lonlat: :environment do
|
task migrate_to_lonlat: :environment do
|
||||||
puts 'Updating points to use lonlat...'
|
puts 'Updating points to use lonlat...'
|
||||||
|
|
||||||
points = Point.where(longitude: nil, latitude: nil).select(:id, :longitude, :latitude, :raw_data, :user_id)
|
points =
|
||||||
|
Point.where(longitude: nil, latitude: nil)
|
||||||
|
.select(:id, :longitude, :latitude, :raw_data, :user_id, :timestamp)
|
||||||
|
|
||||||
points.find_each do |point|
|
points.find_each do |point|
|
||||||
Points::RawDataLonlatExtractor.new(point).call
|
Points::RawDataLonlatExtractor.new(point).call
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue