Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cameri/smtp-nostr-gateway
SMTP to Nostr NIP-04 Gateway
https://github.com/cameri/smtp-nostr-gateway
nostr nostr-protocol nostr-tools
Last synced: 22 days ago
JSON representation
SMTP to Nostr NIP-04 Gateway
- Host: GitHub
- URL: https://github.com/cameri/smtp-nostr-gateway
- Owner: cameri
- License: mit
- Created: 2022-09-04T18:24:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-11T00:47:34.000Z (over 2 years ago)
- Last Synced: 2024-05-01T19:15:08.256Z (8 months ago)
- Topics: nostr, nostr-protocol, nostr-tools
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 35
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMTP Nostr Gateway
# Dependencies
- Node v18
- `iptables` or `ufw` (not explained here)## Getting Started
1. Add firewall rules to allow SMTP traffic (see this [guide](https://www.cyberciti.biz/faq/how-to-save-iptables-firewall-rules-permanently-on-linux/) to make this change permanent)```sh
sudo iptables -A INPUT -p tcp --dport 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 25 -m conntrack --ctstate ESTABLISHED -j ACCEPT
```2. Create key & certificate for TLS
```sh
# Warning: Follow the steps below at your own riskexport DOMAIN=your.domain # e.g. wlvs.space
cd certs/# Generate private key
openssl genrsa -des3 $DOMAIN.key 1024# Generate certificate sign request
openssl req -new -key $DOMAIN.key -out $DOMAIN.csr# Remove passphrase from key
openssl rsa -in $DOMAIN.original -out $DOMAIN.key# Generate certificate from request & private key
openssl x509 -req -days 365 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt# Update the cert and key file on index.js
```3. Create file with secret (once)
```sh
mkdir -p /etc/smtp-nostr-gateway
echo -n "definitely-do-not-use-this-secret" | sudo tee /etc/smtp-nostr-gateway/secret
```4. Install packages
```sh
npm install
```5. Run
```sh
sudo SECRET=$(cat /etc/smtp-nostr-gateway/secret) node index.js
```