1.15.3 1.97GB
1.15.2 1.86GB
22:  devise :two_factor_authenticatable, :registerable,
26:  devise :two_factor_backupable, otp_backup_code_length: 12, otp_number_of_backup_codes: 10
191:  config.lock_strategy = :failed_attempts
201:  config.unlock_strategy = :both
208:  config.unlock_in = 1.hour
# frozen_string_literal: true

if User.none?
  Rails.logger.debug 'Creating user...'

  email = 'demo@dawarich.app'

  User.create!(
    email:,
    password: 'safepassword',
    password_confirmation: 'safepassword',
    admin: true,
    status: :active,
    active_until: 100.years.from_now
  )

  Rails.logger.debug "User created: '#{email}' / password: 'safepassword'"
end

if Country.none?
  Rails.logger.debug 'Creating countries...'

  countries_path = Rails.root.join('lib/assets/countries.geojson.gz')
  countries_json = Zlib::GzipReader.open(countries_path) { |gzip| Oj.load(gzip.read) }

  factory = RGeo::Geos.factory(srid: 4326)
  countries_multi_polygon = RGeo::GeoJSON.decode(countries_json.to_json, geo_factory: factory)

  ActiveRecord::Base.transaction do
    countries_multi_polygon.each do |country|
6:  before_action :authenticate_api_key
37:    authenticated = api_key.present? && current_api_user.present?
44:  def authenticate_api_key
65:    return unless current_api_user # auth already handled by authenticate_api_key
76:    return unless current_api_user # auth already handled by authenticate_api_key
areas_controller.rb
auth
countries
demo_data_controller.rb
digests_controller.rb
families
flights_controller.rb
health_controller.rb
immich
imports
imports_controller.rb
insights_controller.rb
locations_controller.rb
maps
mcp_controller.rb
notes_controller.rb
overland
owntracks
photos_controller.rb
places_controller.rb
plan_controller.rb
points
points_controller.rb
recalculations_controller.rb
residency_controller.rb
settings
settings_controller.rb
shared
stats_controller.rb
subscriptions_controller.rb
tags_controller.rb
tiles
timeline_controller.rb
traccar
tracks
tracks_controller.rb
users
users_controller.rb
visits
visits_controller.rb
wget: /usr/bin/wget
curl: /usr/bin/curl
pgrep: /usr/bin/pgrep
  attr_accessor :oauth_newly_created

  devise :two_factor_authenticatable, :registerable,
         :recoverable, :rememberable, :validatable, :trackable,
         :lockable,
         :omniauthable, omniauth_providers: ::OMNIAUTH_PROVIDERS
  devise :two_factor_backupable, otp_backup_code_length: 12, otp_number_of_backup_codes: 10

  has_many :points, dependent: :destroy
191:  config.lock_strategy = :failed_attempts
198:  # :time  = Re-enables login after a certain amount of time (see :unlock_in below)
201:  config.unlock_strategy = :both
203:  # Number of authentication tries before locking an account if lock_strategy
205:  config.maximum_attempts = 10
207:  # Time interval to unlock the account if :time is enabled as unlock_strategy.
208:  config.unlock_in = 1.hour
211:  config.last_attempt_warning = true
84:ALLOW_EMAIL_PASSWORD_REGISTRATION = ENV.fetch('ALLOW_EMAIL_PASSWORD_REGISTRATION', 'false') == 'true'
