I use Orca to run a few scheduled jobs. Three of them send updates: my daily work brief, weekly report, and pull request (PR) review. If Orca is new to you, it is the app that starts these jobs and runs the instructions and scripts for them. A PR is just a code change someone asks another developer to review.
The problem
Each job already knew when to send a message and what to say. The tricky part was where to send it. They all used a Google Chat webhook URL. A webhook is a private URL a job can use to post a message to a service. When I wanted to send a message somewhere else, I had to update the config or code for each job. That started to feel like too much repeated work.
I had already put the sending code in one shared helper, but it still expected a Google Chat URL. So if I tried another service, it would fail. I wanted each job to keep its own schedule and message, while making the sending part work with more than one service.
I found Apprise for this part. It supports lots of notification services and reads the destination details from a service URL. Orca still starts each job, and Apprise sends the message. It does not create the webhook or decide when a job runs. It only helps with sending the notification.
Orca job -> compose message -> shared Python sender -> Apprise -> destination(s) Install Apprise
I pinned Apprise in requirements.txt and installed it in a separate virtual environment. The version I'm using is:
apprise==2.2.0 For a small project, the setup can be pretty simple:
uv venv .venv --python python3 uv pip install --python .venv/bin/python -r requirements.txt When I run the sender, I use the Python executable from that environment. My workspace has its own paths, so yours may look a bit different, but the idea is the same.
Keep destination URLs in a protected file
I put the destination URLs in a TEXT config file. You can put more than one service in the file. In this example, both entries have the ops tag, so a message sent with that tag goes to both:
ops=gchat://CHAT_SPACE/CHAT_WEBHOOK_KEY/CHAT_WEBHOOK_TOKEN ops=discord://DISCORD_WEBHOOK_ID/DISCORD_WEBHOOK_TOKEN These values are fake. Real webhook URLs have credentials in them, so I keep the config file private. I set mine up so only my account can read it:
install -d -m 700 "$HOME/.config/my-automations" install -m 600 /dev/null "$HOME/.config/my-automations/notifications.conf" ${EDITOR:-vi} "$HOME/.config/my-automations/notifications.conf" I paste the Apprise service URLs into the editor. I try to keep them out of code, Orca prompts, shell commands, and logs. The shared sender checks that the file is a regular file and has private permissions. You can also put just one URL in a file. That works for a job with its own destination.
Apprise's configuration guide has more about TEXT files and tags. I use the service catalog to check which services are supported and what URL format they need. A random HTTP endpoint will not work unless Apprise has a service for it.
Send to every destination or select a tag
If I don't pass a tag, the sender uses every destination in the file. When I only want to notify one group, I pass its tag:
printf '%s\n' 'A short notification' | \ /home/james/orca/automations/apprise_notify.py \ --config-file "$HOME/.config/my-automations/notifications.conf" \ --tag ops The message goes through standard input. The command has the config path and tag, but not the secret URL. Some older callers still use --webhook-file. I kept that as another name for --config-file, so those callers still work too.
This is the main part of the shared sender. It loads the file with AppriseConfig and then passes the services to Apprise:
asset = apprise.AppriseAsset(http_redirects=False) config = apprise.AppriseConfig(asset=asset, recursion=0) if not config.add(str(config_path), asset=asset): raise ValueError("Apprise rejected the config") sender = apprise.Apprise(asset=asset) if not sender.add(config): raise ValueError("Apprise rejected a destination") result = sender.notify( body=message, title="", body_format=apprise.NotifyFormat.MARKDOWN, timeout=20, ) if not result: raise RuntimeError("Notification delivery failed") The real helper also checks the file permissions. Apprise can include service URLs in error messages, so I turn off its logging and only print a general result. I also turn off HTTP redirects. This helps stop credentials in a destination URL from being sent along after a redirect. A service that needs redirects may not work with this setting. Message size and formatting can also be different for every service.
Where it fits in these three jobs
The three jobs call the sender at different points. The daily brief sends after it checks the current work and prepares the morning summary. It only updates its carryover state after the message is delivered successfully.
The weekly report sends after I read the report document back and check it. The notification includes a link to the report and a short summary. I don't send the full report in the message.
For the PR review, the coordinator sends one update after checking the review requests. Each worker sends another update when it finishes. These are status messages. They don't include source code or detailed findings.
Set up another destination
When I want to add another service, this is what I do:
- Create a webhook or destination in the service.
- Find it in Apprise's catalog and use the URL format shown there.
- Add the URL to the protected config file. I use a tag if the job needs to select a group.
- Point the job at that file.
- Send a small test message and make sure it arrives before I rely on the schedule.
The three jobs in this post now use the shared sender. Apprise accepted their config files, but I haven't sent a test notification yet. I still need to check that the messages arrive and look right in each service.
If you're doing something similar, maybe start with one job and check the message first. Then you can move the other jobs over too.