github2telegram icon indicating copy to clipboard operation
github2telegram copied to clipboard

I wanted to clarify how to add repositories to config.yaml

Open timurgum opened this issue 2 years ago • 7 comments

---
listen: ":6060"
logger:
- logger: ''
  file: stdout
  level: debug
  encoding: json
  encoding_time: iso8601
  encoding_duration: seconds
database_type: sqlite3
database_url: "./github2telegram.sqlite3"
database_login: ''
database_password: ''
admin_username: "your_telegram_nick"
polling_interval: "30m"
endpoints:
  telegram:
    token: "YOUR_TOKEN_GOES_HERE"
    type: telegram

timurgum avatar Oct 27 '23 05:10 timurgum

You can't. Currently you need to add repositories only through commands to bot (that is why admin username is important - that is the user that will always be able to do that, otherwise it is limited to admins of a channel) or directly inserting them into sqlite.

Civil avatar Oct 27 '23 06:10 Civil

Please tell me how to add them directly to sqlite then

timurgum avatar Oct 27 '23 06:10 timurgum

If you add directly through a bot, I understand there through /new and /subscribe. Well, if you restart the container, all the added repositories will disappear?

timurgum avatar Oct 27 '23 06:10 timurgum

If you add directly through a bot, I understand there through /new and /subscribe. Well, if you restart the container, all the added repositories will disappear?

Well, you should keep sqlite database on a persistent store, as usual with any kind of state for any other application.

Please tell me how to add them directly to sqlite then

I'd suggest to look into the code, as SQL queries to do that are there: https://github.com/Civil/github2telegram/blob/master/db/sqlite.go#L214

But that shouldn't be used as a replacement for persistent storage on every restart.

Civil avatar Oct 27 '23 06:10 Civil