thelounge-plugin-pushover
v1.0.1
Published
A real-time notification plugin for The Lounge that sends mobile alerts via Pushover when your username is mentioned in IRC channels or via a direct message
Maintainers
Readme
The Lounge Pushover Plugin
A notification plugin for The Lounge that sends mobile alerts via Pushover when your username is mentioned in IRC channels or via a direct message
Acknowledgements
This project is based on thelounge-plugin-ntfy, which is licensed under the MIT License.
Modifications include removing ntfy related logic and replacing it with Pushover specific logic.
If you would prefer to use ntfy for notifications, I would recommend their plugin.
Setup
- Go to the lounge's config folder in your installation. Inside you should have a packages folder.
- Clone this repo into that folder
git clone https://github.com/andrewgraemebrooks/thelounge-plugin-pushover- Install the plugin with the lounge
# Docker Install
docker exec -it thelounge sh -c "thelounge install file:/var/opt/thelounge/packages/thelounge-plugin-pushover"
# Non-Docker Install
thelounge install file:full/path/to/the/plugin- Then in any channel setup the configuration of the plugin
- You can see all available commands by running
/pushover- Set your pushover user key with
/pushover config set user <user key>- Set your pushover user key with
/pushover config set token <app token>- (Optional) Enable direct message notifications
/pushover config set notify_on_pms true- You can double check your config with
/pushover config print- Test your connection with
/pushover test- If your test notification works, run
/pushover start- You can see whether or not the plugin is running with
/pushover status- Finally you can stop the plugin by running
/pushover stopDevelopment
Running the tests
Tests use Node's built-in test runner and nock for HTTP mocking. No extra setup required.
node --test tests/index.test.jsInstall the plugin
Clone the repo
Create a docker container of the lounge by running:
docker compose up --detach- Create a folder named
thelounge-plugin-pushoverin thepackagessubdirectory:
mkdir thelounge/packages/thelounge-plugin-pushover- Symlink the files from the project into the packages folder:
ln package.json thelounge/packages/thelounge-plugin-pushover/package.json
ln index.js thelounge/packages/thelounge-plugin-pushover/index.js- Install the plugin
docker exec -it thelounge sh -c "su node -c 'thelounge install file:/var/opt/thelounge/packages/thelounge-plugin-pushover'"This command should print the following:
[INFO] Retrieving information about the package...
[INFO] Installing file:/var/opt/thelounge/packages/thelounge-plugin-pushover...
[INFO] file:/var/opt/thelounge/packages/thelounge-plugin-pushover has been successfully installed.After it is installed you should see the following message in the container's logs:
Package thelounge-plugin-pushover vX.Y.Z loadedTest it works
- Create a user
docker exec -it thelounge sh -c "thelounge add admin"- Log in as this user to http://localhost:9000
- Log in to an irc network, see Testing with a local IRC server if you don't have one.
- Set your pushover credentials
/pushover config set token <app token>
/pushover config set user <user key>- Run the test command to see if you get a notification
/pushover testStep Debugging
- If you want to enable step debugging you need to uncomment the environmental variable lines in the
compose.yamlfile:
# Uncomment for debugging
environment:
- 'NODE_OPTIONS=--inspect=0.0.0.0:9229'Stick a
debugger;statement in theonServerStart(tl)functionStop the container, run the 'Attach The Lounge' vscode debug profile, and then restart the docker container.
You should see a log
Debugger listening on ws://0.0.0.0:9229/...and the debugger should stop on the breakpoint
Testing with a local IRC server
- Create an Ergo docker container
docker run --init --name ergo -d -p 6667:6667 -p 6697:6697 ghcr.io/ergochat/ergo:stable- Connect to it via the lounge
| Setting | Value | | ------------------------------- | -------------------- | | Name | Ergo | | Server | host.docker.internal | | Port | 6667 | | Password | blank | | Use Secure Connection | false | | Only allow trusted certificates | false | | Enable Proxy | false | | Authentication | No authentication |
Testing two users talking with each other locally
- Create a new lounge docker container and connect to the irc server via the same credentials
docker run --detach --name thelounge2 --publish 9001:9000 ghcr.io/thelounge/thelounge:latest- In one of the lounge instances, set the pushover config with your user key and app token
/pushover config set token <app token>
/pushover config set user <user key>- Run the test command to see if you get a notification
/pushover test- Switch over to the other lounge instance and try mentioning your user's name in a channel. If everything is working, you should get a notification.
