From 44b2ee3485ba0845e5910cefcb4b1e2f84f34470 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 5 Jul 2022 02:41:40 +0200 Subject: Add customizable user roles (#18641) * Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management --- db/seeds.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'db/seeds.rb') diff --git a/db/seeds.rb b/db/seeds.rb index 0bfb5d0db..1ca300de7 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,11 +1,5 @@ -Doorkeeper::Application.create!(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow push') +# frozen_string_literal: true -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! - -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! +Dir[Rails.root.join('db', 'seeds', '*.rb')].sort.each do |seed| + load seed end -- cgit