Definindo a chave da API via console

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.

Olá @pfaffman, como posso seguir esses passos dentro do app?? Quero dizer, depois de ./launcher enter app, como posso usar esses comandos que você mencionou?

Deveria ser possível apenas executar rake api_key:get — tente isso. Ainda não analisei o comando, então não tenho certeza se há algum parâmetro necessário.

Obrigado pela sua resposta. Eu resolvi meu problema com essa solução aqui: Locked out of admin account after disabling SSO Memberful - #5 by Thamer

Em relação a comandos, comandos de aplicativo e assim por diante, onde posso aprender mais sobre isso? Está sendo difícil encontrar informações básicas e resolver problemas quando preciso.

VocĂŞ pode

./launcher enter app
rake api_key:get

Talvez dê uma olhada em Operações em Lote Administrativas