Skip to content

Commit

Permalink
update README.md and hardcode port into run-dev.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
amiicao committed Nov 1, 2024
1 parent 324cdcd commit 68f2ffb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
APP_ID=your_app_id_here
WEBHOOK_SECRET=your_webhook_secret_here
OLLAMA_MODEL=your_chosen_llm_model_here
OLLAMA_MODEL=your_chosen_llm_model_here
NGROK_DOMAIN=your_ngrok_domain_here
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Open the newly created `.env` file and update the following variables with your
\* `APP_ID`: Replace `your_app_id_here` with your actual app ID.
\* `WEBHOOK_SECRET`: Replace `your_webhook_secret_here` with your actual webhook secret.
\* `OLLAMA_MODEL`: Replace `your_chosen_llm_model_here` with your chosen LLM model (e.g. "llama3.2"). Note: it must be an Ollama supported model (see: https://ollama.com/library for supported models)

\* `NGROK_DOMAIN`: Replace `your_ngrok_domain_here` with your ngrok domain if you have one
4. Place the downloaded private key in the project root and name it `rsa.pem`.

5. Run the application locally
Expand All @@ -77,10 +77,11 @@ Start the Flask application:

The application will start running on http://localhost:4000

### 3. Deploy the Application (ngrok instructions)
### 3. Prepare Dependencies and Deploy (ngrok and Ollama instructions)

1. We will use ngrok for its simplicity
We will use ngrok for its simplicity

**Option 1: generated public URL**
In a new terminal window, start ngrok to create a secure tunnel to your local server:

```bash
Expand All @@ -91,6 +92,18 @@ ngrok will generate a public URL (e.g., https://abc123.ngrok.io)

Append `/webhook` to the url, e.g. https://abc123.ngrok.io -> https://abc123.ngrok.io/webhook

In another terminal window, start Ollama

```bash
ollama run <an OLLAMA model here>
```
**Option 2: Using Shell Script with your own ngrok domain**

Ensure environment variables are all set.
```bash
./run-dev.sh
```

### 4. Update GitHub App Settings

1. Go back to your GitHub App settings.
Expand Down
6 changes: 3 additions & 3 deletions run-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ main() {
log_message "Failed to start Ollama"
fi

# Start Ngrok if configured
if [[ -n "${NGROK_DOMAIN:-}" ]] && [[ -n "${PORT:-}" ]]; then
start_process "Ngrok" "ngrok http '${PORT}' --url '${NGROK_DOMAIN}'" || \
# Start Ngrok if configured. Using Port 4000 to match app.py
if [[ -n "${NGROK_DOMAIN:-}" ]]; then
start_process "Ngrok" "ngrok http 4000 --url '${NGROK_DOMAIN}'" || \
log_message "Failed to start Ngrok"
fi

Expand Down

0 comments on commit 68f2ffb

Please sign in to comment.