mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 17:06:01 +08:00
rake task to generate api_key
This commit is contained in:
8
lib/tasks/api.rake
Normal file
8
lib/tasks/api.rake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
desc "generate api key if missing, return existing if already there"
|
||||||
|
task "api_key:get" => :environment do
|
||||||
|
if SiteSetting.api_key.blank?
|
||||||
|
SiteSetting.generate_api_key!
|
||||||
|
end
|
||||||
|
|
||||||
|
puts SiteSetting.api_key
|
||||||
|
end
|
Reference in New Issue
Block a user