Skip to content

Commit

Permalink
simpler readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tblanarik authored Sep 9, 2024
1 parent 8ce6d4a commit 92da4ef
Showing 1 changed file with 4 additions and 45 deletions.
49 changes: 4 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,14 @@

## Description

Spotbot is a simple webserver that listens for HTTP POST requests and forwards the content of those requests to another URL via another HTTP POST request. It is built using Flask.
Spotbot is a simple Azure Function App to convert [HamAlert](https://hamalert.org/) alerts from [POTA](https://pota.app) or [SOTA](https://www.sota.org.uk/) in to a message format that can be forwarded on to a Discord channel webhook.

## Requirements

- Python 3.x
- Flask
- Azure Functions
- requests

## Installation
## Config

1. Clone the repository:
```sh
git clone https://github.com/tblanarik/spotbot.git
cd spotbot
```

2. Install the required dependencies:
```sh
pip install -r requirements.txt
```

## Running the Webserver

To run the webserver, execute the following command:
```sh
TARGET_URL=<target_url> DESTINATION_URL=<destination_url> python spotbot.py
```

Replace `<target_url>` with the actual target URL and `<destination_url>` with the desired port number for the Flask app. If `DESTINATION_URL` is not set, the default port will be 5000.

## Sending a POST Request to the `/forward` Endpoint

To send a POST request to the `/forward` endpoint, you can use a tool like `curl` or Postman. Here is an example using `curl`:

```sh
curl -X POST http://localhost:5000/forward -H "Content-Type: application/json" -d '{"key": "value"}'
```

Replace `{"key": "value"}` with the actual JSON content you want to send.

## Deploying and Running the App as an Azure Function App

To deploy and run the app as an Azure Function App, follow these steps:

1. Create an Azure Function App in the Azure portal.

2. Set up the required environment variables in the Azure Function App configuration:
- `TARGET_URL`: The target URL to which the content will be forwarded.

3. Deploy the app to the Azure Function App using the provided GitHub Actions workflow.

4. Once deployed, you can send POST requests to the Azure Function App endpoint to forward the content to the target URL.
The Azure Function App expects one environment variable: `TARGET_URL`, which should be the webhook URL from the target Discord channel.

0 comments on commit 92da4ef

Please sign in to comment.