Skip to content

Ntfy.tg // A telegram bot to receive messages from ntfy.sh topics

License

Notifications You must be signed in to change notification settings

Sid-Sun/ntfy.tg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntfy.tg

a telegram bot for subscribing to ntfy.sh topics

What is supported

  • receiving notifications from ntfy.sh topics using the topic name

What is not supported

  • self-hosted ntfy.sh instances
    • assuming your instance supports websockets, you can edit the code and replace the base URL of ntfy.sh to point it to your instance
  • publishing messages to topics

How to self-host

  • this bot uses "Storage Engine" to persist user data across restarts, you need to host an instance of this - it needs a mongoDB instance, I recommend using MongoDB Atlas if you don't have an instance running
  • the environment variables needed are:
    • APP_ENV=prod - used by logger
    • API_TOKEN - telegram bot API token
    • ADMIN_CHAT_ID -used to notify when subscriber restarts
    • SE_OBJ_ID - object ID / note name to use on Storage Engine
    • SE_OBJ_PASS - object / note password
    • SE_URL - base URL of above hosted API (ex: http://127.0.0.1:3003)
Why do I need to host "Storage Engine"?
  • The bot uses it to store data mapping topic name to user ID, thanks to this library I built on top of the storeage engine API, it is very easy to add a backing store for small things like this. If you want to, you can add a proper store into the code base
  • To get an idea of how easy this was to add, see diff for subscription_manager.go in this commit
Why are self-hosted instances not supported?
  • They are - but the bot is built with one instance in mind, adding multiple instances would mean changing the validation, subscription and subscriber manager logic and since I don't have a usecase that requires this, its not supported.

About

Ntfy.tg // A telegram bot to receive messages from ntfy.sh topics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published