alfiankan/teleterm

Access White List by user id

Closed this issue · 6 comments

according to #14 Literally everybody can access the server through the bot and all bots are public with an @. In terms of functinality the bot is great but you need to add a Whitlist for users

white listing using telegram username on config file.
teleterm running using file config.yaml at /home-path/.teleterm/config.yaml. on this feature request the config file will be :

teleterm:
  telegram_token: "xxxxxxxxx"
  shell_executor: "/bin/bash"
  whitelists:
    - sabrina
    - hilda
    - ambross
    - zelda

so only listed users on config file can execute command.

assign to me, i'll try to solve this issue

It would be better to use the user id for whitelist and not username since the user id of your account will never changed. Also some people don't have an unsername

that's right, thanks for your opinion

It would be better to use the user id for whitelist and not username since the user id of your account will never changed. Also some people don't have an unsername

is it possible to get userid without using @userinfobot bot ? you're right about username, but what do you think if we use both username and user id as whitelist ? since username is easily accessible i think, but we still provide possibility to use user id as whitelist

@alfajrimutawadhi @catty-dev

teleterm:
  telegram_token: "xxxxxxxxx"
  shell_executor: "/bin/bash"
  whitelists:
    - @sabrina
    - @hilda
    - @ambross
    - @zelda
    - 783277716
    - 133475712

Sounds like a good solution. Only the official client don't show id's. Forks like telegramX or plus messenger shows them and it makes working with bots much easier. Using username and id for whitelist seems to be the best solution.

assign to me, i'll try to solve this issue

I've read your pull request #16 @alfajrimutawadhi

please read and refer to https://github.com/alfiankan/teleterm/blob/main/CONTRIBUTING.md and change your commit to feat because this issue is feature request related

  • create a new branch alfajrimutawadhi/feature/telegram-userid-whitelist
  • add issue reference to your commit feat(whitelist): add access whitelist by user ids list in config (https://github.com/alfiankan/teleterm/issues/15)

LGTM!!!
reference PR #18