From a60145137c677a021df611e236fb8f3f478976ae Mon Sep 17 00:00:00 2001 From: ItzCrazyKns Date: Sat, 11 May 2024 10:23:05 +0530 Subject: [PATCH] feat(docs): add networking --- README.md | 5 ++ docs/installation/NETWORKING.md | 96 +++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 docs/installation/NETWORKING.md diff --git a/README.md b/README.md index e45e80a..4735c7f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - [Features](#features) - [Installation](#installation) - [Getting Started with Docker (Recommended)](#getting-started-with-docker-recommended) + - [Exposing to network](#exposing-to-network) - [Non-Docker Installation](#non-docker-installation) - [Ollama connection errors](#ollama-connection-errors) - [One-Click Deployment](#one-click-deployment) @@ -82,6 +83,10 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker. **Note**: After the containers are built, you can start Perplexica directly from Docker without having to open a terminal. +#### Exposing to network + +If you wish to expose Perplexica to your network and use it accross all devices on that network you can read [NETWORKING.md](https://github.com/ItzCrazyKns/Perplexica/blob/master/docs/installation/NETWORKING.md). + ### Non-Docker Installation 1. Clone the repository and rename the `sample.config.toml` file to `config.toml` in the root directory. Ensure you complete all required fields in this file. diff --git a/docs/installation/NETWORKING.md b/docs/installation/NETWORKING.md new file mode 100644 index 0000000..25f994a --- /dev/null +++ b/docs/installation/NETWORKING.md @@ -0,0 +1,96 @@ +# Expose Perplexica to a network + +This guide will show you how to make Perplexica available over a network. Follow these steps to allow computers on the same network to interact with Perplexica. Choose the instructions that match the operating system you are using. + +## Windows + +1. Open PowerShell as Administrator + +2. Navigate to the directory containing the `docker-compose.yaml` file + +3. Stop and remove the existing Perplexica containers and images: +``` +docker compose down --rmi all +``` + +4. Open the `docker-compose.yaml` file in a text editor like Notepad++ + +5. Replace `127.0.0.1` with the IP address of the server Perplexica is running on in these two lines: +``` +args: + - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api + - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001 +``` + +6. Save and close the `docker-compose.yaml` file + +7. Rebuild and restart the Perplexica container: +``` +docker compose up -d --build +``` + +## macOS + +1. Open the Terminal application + +2. Navigate to the directory with the `docker-compose.yaml` file: +``` +cd /path/to/docker-compose.yaml +``` + +3. Stop and remove existing containers and images: +``` +docker compose down --rmi all +``` + +4. Open `docker-compose.yaml` in a text editor like Sublime Text: +``` +nano docker-compose.yaml +``` + +5. Replace `127.0.0.1` with the server IP in these lines: +``` +args: + - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api + - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001 +``` + +6. Save and exit the editor + +7. Rebuild and restart Perplexica: +``` +docker compose up -d --build +``` + +## Linux + +1. Open the terminal + +2. Navigate to the `docker-compose.yaml` directory: +``` +cd /path/to/docker-compose.yaml +``` + +3. Stop and remove containers and images: +``` +docker compose down --rmi all +``` + +4. Edit `docker-compose.yaml`: +``` +nano docker-compose.yaml +``` + +5. Replace `127.0.0.1` with the server IP: +``` +args: + - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api + - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001 +``` + +6. Save and exit the editor + +7. Rebuild and restart Perplexica: +``` +docker compose up -d --build +``` \ No newline at end of file