コンソールから API キーを設定する

Is there a way to set the main api key via the console?

YML=app
SSH_USER=root@host
API_KEY=`ssh $SSH_USER sudo docker exec -w /var/www/discourse -i $YML rake api_key:get`

Does this get or set the api?

It does both. It sets it if it’s not set already.

Is the api key being passed in and used or is rake api_key:get creating one if one does not exist?

Context is rebuilding an instance and keeping the old api key.

If the database persists then the API key persists.

Cool. So it’s in the database somewhere.

Context is building from scratch and testing the importing routines.

Thanks Jay, cheers!

Have a look at the rake task in lib/tasks/api_key.

@pfaffman さん、こんにちは。この手順をアプリ内でどのように実行すればよいのでしょうか?つまり、./launcher enter app の後、ご提示いただいたコマンドをどのように使用すればよいのか知りたいです。

rake api_key:get でできるはずです。試してみてください。コマンドを確認していないので、パラメータが必要かどうかは確信が持てません。

返信ありがとうございます。この解決策で私の問題は解決しました:Locked out of admin account after disabling SSO Memberful - #5 by Thamer

コマンド、アプリコマンドなどについて、さらに詳しく学ぶにはどこを見ればよいでしょうか?基本的な情報を見つけるのが難しく、問題が発生した際に解決するのが大変です。

次のコマンドを実行してください。

./launcher enter app
 rake api_key:get

管理一括操作も参照してください。