Establecer la clave de API mediante consola

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.

Hola @pfaffman, ¿cómo puedo seguir estos pasos dentro de la aplicación? Quiero decir, después de ./launcher enter app, ¿cómo puedo usar estos comandos que mencionaste?

Deberías poder ejecutar simplemente rake api_key:get — pruébalo. No he revisado el comando, así que no estoy seguro de si necesitas algún parámetro.

Gracias por tu respuesta, logré resolver mi problema con esta solución: Locked out of admin account after disabling SSO Memberful - #5 by Thamer

En cuanto a los comandos, los comandos de la aplicación y demás, ¿dónde puedo obtener más información? Es difícil encontrar información básica y resolver problemas cuando los necesito.

Podrías

./launcher enter app
 rake api_key:get

Tal vez eches un vistazo a Operaciones masivas administrativas