This commit is contained in:
Danny Morabito 2025-08-10 21:29:52 +02:00
parent acba2ae01e
commit 9925d089d5
Signed by: dannym
GPG key ID: 7CC8056A5A04557E

View file

@ -5,8 +5,7 @@
<h1>NIP-42 Proxy</h1> <h1>NIP-42 Proxy</h1>
<p>A NIP-42 authentication proxy for Nostr relays.</p> <p>A NIP-42 authentication proxy for Nostr relays.</p>
<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.bun.sh/"><img src="https://img.shields.io/badge/bun-%23FBF0DF.svg" alt="Bun"></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> <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> </p>
</td> </td>
@ -36,29 +35,34 @@ This project provides a robust NIP-42 proxy for Nostr relays, creating an authen
### Installation & Running ### Installation & Running
1. **Clone the repository:** 1. **Clone the repository:**
```bash ```bash
git clone https://git.arx-ccn.com/Arx/nip42-proxy.git git clone https://git.arx-ccn.com/Arx/nip42-proxy.git
cd nip42-proxy cd nip42-proxy
``` ```
2. **Install dependencies:** 2. **Install dependencies:**
```bash ```bash
bun install bun install
``` ```
3. **Run the proxy:** 3. **Run the proxy:**
- **With Bun:**
* **With Bun:**
```bash ```bash
RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts
``` ```
* **With Docker:** - **With Docker:**
1. Build the image: 1. Build the image:
```bash ```bash
docker build -t nip42-proxy . docker build -t nip42-proxy .
``` ```
2. Run the container: 2. Run the container:
```bash ```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 docker run -p 3000:3000 -e RELAY_URL="wss://your-relay-url.com" -e ADMIN_PUBKEY="my-admin-pubkey" --name nip42-proxy nip42-proxy
``` ```
@ -72,18 +76,18 @@ The proxy is configured through environment variables.
<details> <details>
<summary>Click to view all configuration options</summary> <summary>Click to view all configuration options</summary>
| Variable | Description | Default | | Variable | Description | Default |
| ----------------------- | ------------------------------------------------------------------------------------------------------- | --------- | | ------------------------ | ----------------------------------------------------------------- | ----------- |
| `ALLOW_UNAUTHED_PUBLISH`| Set to `true` to allow unauthenticated clients to publish events. | `false` | | `ALLOW_UNAUTHED_PUBLISH` | Set to `true` to allow unauthenticated clients to publish events. | `false` |
| `RELAY_URL` | The URL of the relay that the proxy will connect to. | | | `RELAY_URL` | The URL of the relay that the proxy will connect to. | |
| `RELAY_OUTSIDE_URL` | The URL that clients use to connect to the proxy. | `RELAY_URL` | | `RELAY_OUTSIDE_URL` | The URL that clients use to connect to the proxy. | `RELAY_URL` |
| `RELAY_NAME` | The name of the relay. | | | `RELAY_NAME` | The name of the relay. | |
| `RELAY_DESCRIPTION` | A description of the relay. | | | `RELAY_DESCRIPTION` | A description of the relay. | |
| `RELAY_BANNER` | A URL to a banner image for the relay. | | | `RELAY_BANNER` | A URL to a banner image for the relay. | |
| `RELAY_ICON` | A URL to an icon for the relay. | | | `RELAY_ICON` | A URL to an icon for the relay. | |
| `RELAY_CONTACT` | A contact email or address for the relay. | | | `RELAY_CONTACT` | A contact email or address for the relay. | |
| `RELAY_POLICY` | A URL to the relay's policy document. | | | `RELAY_POLICY` | A URL to the relay's policy document. | |
| `ADMIN_PUBKEY` | The public key of the administrator of the relay. | | | `ADMIN_PUBKEY` | The public key of the administrator of the relay. | |
</details> </details>
@ -117,3 +121,4 @@ Contributions are welcome! Please open an issue or submit a pull request with yo
## 📄 License ## 📄 License
This project is licensed under the AGPLv3. See the [LICENSE](LICENSE) file for details. This project is licensed under the AGPLv3. See the [LICENSE](LICENSE) file for details.