-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide bot token from public view and access #3
base: master
Are you sure you want to change the base?
Hide bot token from public view and access #3
Conversation
- Exposing bot token for public would allow easy hijack of the bot. In addition, assuming the best in everyone and we say no one will do malicious act, it would not allow for 2 developers to run the bot at the same time while developing.
I already revoked the API token, i accidentally pushed it. And what do you mean by '2 developers to run the bot at the same time', if you mean 2 developer running the bot in the same API token, the token is already revoked. |
Hey, although you removed the bot token from the file, the token is still visible from the history page. I think easiest thing to do is create a new bot to generate a new bot token and just read the token from another file (e.g |
@masterSal I meant running more than one instance of the bot with same token. |
@Eyob-T
Creating a bot to generate a bot token is too much work. In addition that is the job of botfather. We just have to make sure no token is included in the code. When any developer needs to run the bot he just has to create his own token and run an instance of the bot with the new token he created. In order to add the token to environment variables we can use dotenv package. The only addition required is to add a .env file at the root directory that is not included in source control. This just reminded me to add .env exception to .gitignore. |
addition, assuming the best in everyone and we say no one will do
malicious act, it would not allow for 2 developers to run the bot at the
same time while developing.