Add required environment variables for cron jobs PRODUCTION
Closed this issue · 2 comments
Issue Description
These variables are needed so that cron jobs can make a call to discord bot(discord slash command). This call will bulk update roles for users. To make this call we need the following variables in our GitHub settings environment.
- Following keys need to be added
- DISCORD_BOT_API_URL (saved as
services.discordBot.baseUrl
in RDS backend env file) - DISCORD_BOT_PRIVATE_KEY (saved as
rdsServerlessBot.rdsServerLessPrivateKey
in RDS backend env file)
- DISCORD_BOT_API_URL (saved as
Steps to follow
Add as env variables via GitHub actions environment variables for cron-jobs
repository
Reference:
https://docs.github.com/en/github-ae@latest/actions/learn-github-actions/variables
https://github.com/Real-Dev-Squad/website-backend/blob/develop/config/default.js
Added the url and key. Thank you for the detailed instructions.
@ankushdharkar, could you please verify whether the DISCORD_BOT_PRIVATE_KEY
in the production environment of the cron-jobs
GitHub repository and the RDS_SERVERLESS_PRIVATE_KEY
in the backend configuration are the same?
- Please ensure to check for any leading or trailing spaces when comparing the
DISCORD_BOT_PRIVATE_KEY
.
Currently, the JWT token generated in cron-jobs
is not being verified in the discord slash command. We get the following error when we try to verify the token in discord-slash-command: "Invalid SPKI".