2023-03-29 09:58:27 +02:00
|
|
|
Chewy.strategy(:mastodon) do
|
|
|
|
Doorkeeper::Application.create!(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow push')
|
2017-01-26 14:52:07 +01:00
|
|
|
|
2023-03-29 09:58:27 +02:00
|
|
|
domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain
|
|
|
|
account = Account.find_or_initialize_by(id: -99, actor_type: 'Application', locked: true, username: domain)
|
|
|
|
account.save!
|
2019-07-19 01:44:42 +02:00
|
|
|
|
2023-03-29 09:58:27 +02:00
|
|
|
if Rails.env.development?
|
|
|
|
admin = Account.where(username: 'admin').first_or_initialize(username: 'admin')
|
|
|
|
admin.save(validate: false)
|
|
|
|
User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true, approved: true).save!
|
|
|
|
end
|
2017-01-26 09:22:00 +01:00
|
|
|
end
|