Skip to content
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

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

Open
timurgum opened this issue Oct 27, 2023 · 4 comments
Open

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

timurgum opened this issue Oct 27, 2023 · 4 comments

Comments

@timurgum
Copy link

---
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
@Civil
Copy link
Owner

Civil commented Oct 27, 2023

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.

@timurgum
Copy link
Author

Please tell me how to add them directly to sqlite then

@timurgum
Copy link
Author

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?

@Civil
Copy link
Owner

Civil commented Oct 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants