.gitea
.dockerignore
.gitignore
Dockerfile
LICENSE
README.md
config.ini.dist
docker-compose.yml
index.js
maintainers.yaml
package-lock.json
package.json
82 lines
2.6 KiB
Markdown
82 lines
2.6 KiB
Markdown
# NostrSMS
|
|
|
|
As of 02/22/25 all PR/Issues will be over nostr.
|
|
[PR](https://gitworkshop.dev/stephen@vanderwarker.family/nostrsms/prs)
|
|
[Issues](https://gitworkshop.dev/stephen@vanderwarker.family/nostrsms/issues)
|
|
|
|
NostrSMS is a bridge between XMPP and Nostr, allowing users to send and receive messages through Nostr via an XMPP bot. This bot connects to an XMPP server and listens for messages from authorized users, posting them to Nostr and fetching recent global posts.
|
|
|
|
## Features
|
|
- Connects to an XMPP server with configured credentials.
|
|
- Posts messages received from XMPP/SMS to Nostr.
|
|
- Fetches recent global posts from Nostr and returns them to users.
|
|
- Allows only authorized users to interact with the bot.
|
|
- Supports simple commands such as `!help` and `!g`.
|
|
|
|
## Requirements
|
|
- Node.js
|
|
- A configured XMPP account
|
|
- A Nostr private key for signing events
|
|
- A valid `config.ini` file (see [Configuration](#configuration))
|
|
|
|
## Installation
|
|
1. Clone the repository or download the script.
|
|
2. Install dependencies:
|
|
```sh
|
|
npm install
|
|
```
|
|
3. Ensure you have a valid `config.ini` file in the appropriate location for your operating system (see below).
|
|
4. Run the bot:
|
|
```sh
|
|
node index.js
|
|
```
|
|
|
|
## Configuration
|
|
Create a `config.ini` file in the appropriate location:
|
|
- **Windows**: `%APPDATA%/nostrsms/config.ini`
|
|
- **macOS**: `~/Library/Application Support/nostrsms/config.ini`
|
|
- **Linux**: `~/.config/nostrsms/config.ini`
|
|
|
|
### Example `config.ini`:
|
|
```ini
|
|
[nostr]
|
|
pkhex=your_private_key
|
|
|
|
[xmpp]
|
|
host=your_xmpp_host
|
|
user=your_xmpp_username
|
|
domain=your_xmpp_domain
|
|
password=your_xmpp_password
|
|
; optional (will default to nostrsms-bot)
|
|
resource=nostrsms-bot
|
|
|
|
[relays]
|
|
read=wss://relay.example.com
|
|
write=wss://relay.example.com
|
|
|
|
[authorized_users]
|
|
users=user1@xmpp.server,user2@xmpp.server
|
|
```
|
|
|
|
## Usage
|
|
- **`!help`**: Returns a help link.
|
|
- **`!g`**: Fetches the latest 10 global posts from Nostr.
|
|
- **Any other message**: Posts the message to Nostr.
|
|
|
|
## Error Handling
|
|
- If `config.ini` is missing or invalid, an error message is displayed, and the program exits.
|
|
- XMPP errors are logged to the console.
|
|
- If the bot receives a message from an unauthorized user, it responds with "Not authorized".
|
|
|
|
## Stopping the Bot
|
|
To stop the bot, press `CTRL+C`. The bot will cleanly disconnect from XMPP before exiting.
|
|
|
|
## License
|
|
This project is licensed under the MIT License.
|
|
|
|
## Support
|
|
For setup and troubleshooting, visit the [wiki](https://wiki.vanderwarker.family/doku.php?id=code:nostrsms:install).
|
|
|
|
|
|
**//README generated by ChatGPT.//**
|