fix
This commit is contained in:
parent
023d3db694
commit
acba2ae01e
1 changed files with 53 additions and 53 deletions
106
README.md
106
README.md
|
@ -1,11 +1,17 @@
|
||||||
<div align="center">
|
<table>
|
||||||
<img src="images/logo.webp" alt="NIP-42 Proxy Logo" width="200"/>
|
<tr>
|
||||||
<h1>NIP-42 Proxy</h1>
|
<td><img src="images/logo.webp" alt="NIP-42 Proxy Logo" width="200"/></td>
|
||||||
<p>A NIP-42 authentication proxy for Nostr relays.</p>
|
<td>
|
||||||
<p>
|
<h1>NIP-42 Proxy</h1>
|
||||||
<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>A NIP-42 authentication proxy for Nostr relays.</p>
|
||||||
</p>
|
<p>
|
||||||
</div>
|
<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>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -29,38 +35,33 @@ 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
|
||||||
|
git clone https://git.arx-ccn.com/Arx/nip42-proxy.git
|
||||||
|
cd nip42-proxy
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
2. **Install dependencies:**
|
||||||
git clone https://git.arx-ccn.com/Arx/nip42-proxy.git
|
```bash
|
||||||
cd nip42-proxy
|
bun install
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Install dependencies:**
|
3. **Run the proxy:**
|
||||||
|
|
||||||
```bash
|
|
||||||
bun install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Run the proxy:**
|
|
||||||
- **With Bun:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
- **With Docker:**
|
|
||||||
1. Build the image:
|
|
||||||
|
|
||||||
|
* **With Bun:**
|
||||||
```bash
|
```bash
|
||||||
docker build -t nip42-proxy .
|
RELAY_URL="wss://my-relay.com" ADMIN_PUBKEY="my-admin-pubkey" bun run index.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Run the container:
|
* **With Docker:**
|
||||||
|
1. Build the image:
|
||||||
```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 build -t nip42-proxy .
|
||||||
```
|
```
|
||||||
|
2. Run the container:
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
The server will start, and you can connect to it using a Nostr client that supports NIP-42 authentication.
|
The server will start, and you can connect to it using a Nostr client that supports NIP-42 authentication.
|
||||||
|
|
||||||
|
@ -71,18 +72,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>
|
||||||
|
|
||||||
|
@ -103,11 +104,11 @@ The proxy exposes a NIP-98-protected RPC interface for administration. Send a `P
|
||||||
|
|
||||||
## 🤔 How It Works
|
## 🤔 How It Works
|
||||||
|
|
||||||
1. **Client Connection**: A client connects to the proxy and is initially unauthenticated.
|
1. **Client Connection**: A client connects to the proxy and is initially unauthenticated.
|
||||||
2. **Authentication Request**: The proxy sends an `AUTH` challenge.
|
2. **Authentication Request**: The proxy sends an `AUTH` challenge.
|
||||||
3. **Client Authentication**: The client responds with a valid `AUTH` event, signed with an allowed public key.
|
3. **Client Authentication**: The client responds with a valid `AUTH` event, signed with an allowed public key.
|
||||||
4. **Authenticated State**: The client is now authenticated and can interact with the relay.
|
4. **Authenticated State**: The client is now authenticated and can interact with the relay.
|
||||||
5. **Message Forwarding**: Messages are forwarded between the client and the main relay.
|
5. **Message Forwarding**: Messages are forwarded between the client and the main relay.
|
||||||
|
|
||||||
## 🤝 Contributing
|
## 🤝 Contributing
|
||||||
|
|
||||||
|
@ -115,5 +116,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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue