This commit is contained in:
Danny Morabito 2025-08-10 21:36:06 +02:00
parent 7ecc3a55e0
commit 042d0bbec0
Signed by: dannym
GPG key ID: 7CC8056A5A04557E

View file

@ -5,8 +5,6 @@
<h1>NIP-42 Proxy</h1>
<p>A simple, no-fuss NIP-42 authentication proxy for your Nostr relay.</p>
<p>
<a href="https://hub.docker.com/r/your-docker-repo/nip42-proxy"><img src="https://img.shields.io/docker/pulls/your-docker-repo/nip42-proxy.svg" alt="Docker Pulls"></a>
<a href="https://www.bunity.com/"><img src="https://img.shields.io/badge/bun-%23FBF0DF.svg?style=for-the-badge&logo=bun&logoColor=black" alt="Bun"></a>
<a href="https://www.gnu.org/licenses/agpl-3.0"><img src="https://img.shields.io/badge/License-AGPL_v3-blue.svg" alt="License: AGPL v3"></a>
</p>
</td>
@ -35,33 +33,38 @@ Ever wanted to run a private Nostr relay without all the hassle? This NIP-42 pro
### Let's Do This
1. **Clone the code:**
1. **Clone the code:**
```bash
git clone https://git.arx-ccn.com/Arx/nip42-proxy.git
cd nip42-proxy
```
2. **Install the things:**
2. **Install the things:**
```bash
bun install
```
3. **Fire it up:**
3. **Fire it up:**
- **With Bun:**
* **With Bun:**
```bash
RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts
```
```bash
RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts
```
* **With Docker:**
1. Build it:
```bash
docker build -t nip42-proxy .
```
2. Run it:
```bash
docker run -p 3000:3000 -e RELAY_URL="wss://your-relay-url.com" -e ADMIN_PUBKEY="my-admin-pubkey" --name nip42-proxy nip42-proxy
```
- **With Docker:**
1. Build it:
```bash
docker build -t nip42-proxy .
```
2. Run it:
```bash
docker run -p 3000:3000 -e RELAY_URL="wss://your-relay-url.com" -e ADMIN_PUBKEY="my-admin-pubkey" --name nip42-proxy nip42-proxy
```
Now you can connect to your proxy with any Nostr client that gets NIP-42.
@ -72,18 +75,18 @@ This proxy is configured with environment variables. Here's the rundown:
<details>
<summary>Click to see all the options</summary>
| Variable | What it does | Default |
| ----------------------- | ---------------------------------------------------------------------------------------------- | --------- |
| `ALLOW_UNAUTHED_PUBLISH`| Let unauthenticated users publish events. | `false` |
| `RELAY_URL` | The URL of the relay you're proxying. | |
| `RELAY_OUTSIDE_URL` | The URL your users will connect to. | `RELAY_URL` |
| `RELAY_NAME` | The name of your relay. | |
| `RELAY_DESCRIPTION` | A little something about your relay. | |
| `RELAY_BANNER` | A URL for a banner image. | |
| `RELAY_ICON` | A URL for an icon. | |
| `RELAY_CONTACT` | How people can get in touch. | |
| `RELAY_POLICY` | A URL to your relay's policy. | |
| `ADMIN_PUBKEY` | The public key of the relay's admin. | |
| Variable | What it does | Default |
| ------------------------ | ----------------------------------------- | ----------- |
| `ALLOW_UNAUTHED_PUBLISH` | Let unauthenticated users publish events. | `false` |
| `RELAY_URL` | The URL of the relay you're proxying. | |
| `RELAY_OUTSIDE_URL` | The URL your users will connect to. | `RELAY_URL` |
| `RELAY_NAME` | The name of your relay. | |
| `RELAY_DESCRIPTION` | A little something about your relay. | |
| `RELAY_BANNER` | A URL for a banner image. | |
| `RELAY_ICON` | A URL for an icon. | |
| `RELAY_CONTACT` | How people can get in touch. | |
| `RELAY_POLICY` | A URL to your relay's policy. | |
| `ADMIN_PUBKEY` | The public key of the relay's admin. | |
</details>
@ -104,11 +107,11 @@ The proxy has a special RPC interface for admins, protected by NIP-98. Just send
## 🤔 How's It Work?
1. **Knock Knock:** A client connects, but they're just a guest for now.
2. **Who's There?:** The proxy asks for their credentials with an `AUTH` challenge.
3. **The Password:** The client sends back a valid `AUTH` event, signed with a key that's on the list.
4. **You're In:** The client is now authenticated and can chat with the relay.
5. **The Conversation:** Messages flow freely between the client and the relay.
1. **Knock Knock:** A client connects, but they're just a guest for now.
2. **Who's There?:** The proxy asks for their credentials with an `AUTH` challenge.
3. **The Password:** The client sends back a valid `AUTH` event, signed with a key that's on the list.
4. **You're In:** The client is now authenticated and can chat with the relay.
5. **The Conversation:** Messages flow freely between the client and the relay.
## 🤝 Wanna Help?
@ -116,4 +119,5 @@ Got ideas? Found a bug? Pull requests and issues are always welcome.
## 📄 The Fine Print
This project is licensed under the AGPLv3. Check out the [LICENSE](LICENSE) file for the full text.
This project is licensed under the AGPLv3. Check out the [LICENSE](LICENSE) file for the full text.