Skip to content

maxname/notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notifier - rest-api for shoutrrr

Run server in compose

name: notifier

services:
  notifier:
    container_name: notifier
    image: maxname/notifier:latest
    command:
      # - "--server.host=0.0.0.0:8080" # default is "0.0.0.0:8080"
      # - "--server.header=X-Api-Key" # default is "X-Api-Key"
      - "--tokens.token1=cWWisJ2DeCK7zftHIEKHCryZOSJlWcov0gV9fuUp5rzyz1qLqbOh5DEHB0083kVE"
      # - "--tokens.token2=yuggFBsZ2CIc3S2XzG5XbOXxjmJVtDl6Apd7J4quOOWOEpUCSW5IErDbuSss5kfX"
      - "--services.service1.url=telegram://<<token>>@telegram?chats=<<chart>>" # see docs for shoutrrr here - https://containrrr.dev/shoutrrr/v0.8/services/overview/
      - "--services.service1.tags=tag1,tag2"
      - "--services.service1.tokens=token1,token2" # list of allowed tokens
      # - "--services.service2.url=generic://example.com?@acceptLanguage=tlh-Piqd" # see docs for shoutrrr here - https://containrrr.dev/shoutrrr/v0.8/services/overview/
      # - "--services.service2.tags=default" # will be one of default services
      # - "--services.service2.tokens=token1" # list of allowed tokens

Properties

  • server
    • host - listening address and port. Default is 0.0.0.0:8080.
    • header - header name for pass token. Default is X-Api-Key.
  • tokens
    • {token_id} - token for accept requests. Required at least one.
  • services
    • {service_id}
      • url - url for run shoutrrr. Required. See docs.
      • tags - collection of tag names separated by comma. If you set default tag -- this service will be one of default services. If not set - service will never runs.
      • tokens - collection of {token_id}. If not set - service will never runs.

All props need to pass as command lines arguments. See example above.

Call APIs examples

Send message to default services

curl --request POST \
  --url http://localhost:8080/send \
  --header 'X-Api-Key: cWWisJ2DeCK7zftHIEKHCryZOSJlWcov0gV9fuUp5rzyz1qLqbOh5DEHB0083kVE' \
  --header 'content-type: application/json' \
  --data '{
      "message": "Hello, World!"
    }'

Send message with title to default services

curl --request POST \
  --url http://localhost:8080/send \
  --header 'X-Api-Key: cWWisJ2DeCK7zftHIEKHCryZOSJlWcov0gV9fuUp5rzyz1qLqbOh5DEHB0083kVE' \
  --header 'content-type: application/json' \
  --data '{
      "title": "Meow",
      "message": "Pet me"
    }'

Send message to tagged services

curl --request POST \
  --url http://localhost:8080/send \
  --header 'X-Api-Key: cWWisJ2DeCK7zftHIEKHCryZOSJlWcov0gV9fuUp5rzyz1qLqbOh5DEHB0083kVE' \
  --header 'content-type: application/json' \
  --data '{
      "message": "Yo",
      "tags": ["tag1"]
    }'

Results

Code Body
200 { "message": "OK" }
400 { "error": "Message" }
403 { "error": "Unauthorized" }

About

rest-api for shoutrrr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published