From ae51e6153f5d611ee0534ad795a5f35125b0353a Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+Berry-13@users.noreply.github.com> Date: Fri, 28 Jul 2023 19:40:47 +0200 Subject: [PATCH] docs: Improved ngrok installation and enhanced user_auth_system.md (#721) * Update ngrok.md * Update user_auth_system.md * Update user_auth_system.md * Update user_auth_system.md --- docs/deployment/ngrok.md | 36 +++++++++++++++++++++++++------- docs/install/user_auth_system.md | 34 +++++++++++++++--------------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/docs/deployment/ngrok.md b/docs/deployment/ngrok.md index ddadef77f..4b85accee 100644 --- a/docs/deployment/ngrok.md +++ b/docs/deployment/ngrok.md @@ -6,24 +6,46 @@ To use Ngrok for tunneling your local server to the internet, follow these steps 1. Go to https://ngrok.com/ and sign up for an account. -## Docker Installation +## Docker Installation 🐳 1. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. 2. Open a terminal and run the following command: `docker run -d -it -e NGROK_AUTHTOKEN= ngrok/ngrok http 80` -## Windows Installation +## Windows Installation 💙 1. Download the ZIP file from https://ngrok.com/download. 2. Extract the contents of the ZIP file using 7zip or WinRar. -3. Run `ngrok.exe`. -4. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. -5. In the `ngrok.exe` terminal, run the following command: `ngrok config add-authtoken ` -6. If you haven't done so already, start LibreChat normally. -7. In the `ngrok.exe` terminal, run the following command: ngrok http 3080 +3. +4. Run `ngrok.exe`. +5. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. +6. In the `ngrok.exe` terminal, run the following command: `ngrok config add-authtoken ` +7. If you haven't done so already, start LibreChat normally. +8. In the `ngrok.exe` terminal, run the following command: `ngrok http 3080` You will see a link that can be used to access LibreChat. ![ngrok-1](https://github.com/danny-avila/LibreChat/assets/32828263/3cb4b063-541f-4f0a-bea8-a04dd36e6bf4) +## Linux Installation 🐧 + +1. Copy the command from https://ngrok.com/download choosing the **correct** architecture. +2. Run the command in the terminal +3. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. +4. run the following command: `ngrok config add-authtoken ` +5. If you haven't done so already, start LibreChat normally. +6. run the following command: `ngrok http 3080` + +## Mac Installation 🍎 + +1. Download the ZIP file from https://ngrok.com/download. +2. Extract the contents of the ZIP file using a suitable Mac application like Unarchiver. +3. Open Terminal. +4. Navigate to the directory where you extracted ngrok using the `cd` command. +5. Run ngrok by typing `./ngrok`. +6. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. +7. In the terminal where you ran ngrok, enter the following command: `ngrok authtoken ` +8. If you haven't done so already, start LibreChat normally. +9. In the terminal where you ran ngrok, enter the following command: `./ngrok http 3080` + --- ### Note: diff --git a/docs/install/user_auth_system.md b/docs/install/user_auth_system.md index dc491d231..77ce0b0dc 100644 --- a/docs/install/user_auth_system.md +++ b/docs/install/user_auth_system.md @@ -27,7 +27,7 @@ Important: When you run the app for the first time, you need to create a new acc ## Before enabling Social Authentication, set ALLOW_SOCIAL_LOGIN=true in the .env file -## How to Set Up Google Authentication +## Google Authentication To enable Google login, you must create an application in the [Google Cloud Console](https://cloud.google.com) and provide the client ID and client secret in the `/.env` file. @@ -37,21 +37,21 @@ To enable Google login, you must create an application in the [Google Cloud Cons 4. Click on "Save and continue" and then "Back to dashboard". 5. Click on "Create Credentials" and then "OAuth client ID". 6. Select "Web application" as the application type and give it a name. -7. Add "http://localhost" "http://localhost:3080" and "http://localhost:3090" to the authorized JavaScript origins. -8. Add "http://localhost:3080/oauth/google/callback" to the authorized redirect URIs. +7. Add `http://yourdomain`, `http://localhost:3080` and `http://localhost:3090` to the authorized JavaScript origins. +8. Add `http://your-domain/oauth/google/callback` to the authorized redirect URIs. (if you use localhost then use this `http://localhost:3080/oauth/google/callback`) 9. Click on "Create" and copy your client ID and client secret. -10. Paste them into your /.env file. -11. Enable the feature in the /.env file +10. Paste them into your `/.env` file. +11. Enable the feature in the `/.env` file --- -## How to Set Up OpenID Authentication with Azure AD +## OpenID Authentication with Azure AD -1. Go to the Azure Portal and sign in with your account. -2. In the search box, type Azure Active Directory and click on it. +1. Go to the [Azure Portal](https://portal.azure.com/) and sign in with your account. +2. In the search box, type "Azure Active Directory" and click on it. 3. On the left menu, click on App registrations and then on New registration. 4. Give your app a name and select Web as the platform type. -5. In the Redirect URI field, enter http://localhost:3080/oauth/openid/callback and click on Register. +5. In the Redirect URI field, enter `http://localhost:3080/oauth/openid/callback` and click on Register. 6. You will see an Overview page with some information about your app. Copy the Application (client) ID and the Directory (tenant) ID and save them somewhere. 7. On the left menu, click on Authentication and check the boxes for Access tokens and ID tokens under Implicit grant and hybrid flows. 8. On the left menu, click on Certificates & Secrets and then on New client secret. Give your secret a name and an expiration date and click on Add. @@ -63,12 +63,12 @@ OPENID_CLIENT_ID=Your Application (client) ID OPENID_CLIENT_SECRET=Your client secret OPENID_ISSUER=https://login.microsoftonline.com/Your Directory (tenant ID)/v2.0/ OPENID_SESSION_SECRET=Any random string -OPENID_SCOPE=openid profile email -OPENID_CALLBACK_URL=/oauth/openid/callback +OPENID_SCOPE=openid profile email #DO NOT CHANGE THIS +OPENID_CALLBACK_URL=/oauth/openid/callback # this should be the same for everyone ``` 11. Save the .env file and you're done! You have successfully set up OpenID authentication with Azure AD for your app. -## How to Set Up OpenID Authentication with AWS Cognito +## OpenID Authentication with AWS Cognito 1. Create a new User Pool in Cognito: 1. Ensure your Cognito user pool sign-in options include `User Name` and `Email`. @@ -100,12 +100,12 @@ OPENID_CALLBACK_URL=/oauth/openid/callback --- -## How to Set Up Github Authentication +## GitHub Authentication 1. Go to your [Github Developer settings](https://github.com/settings/apps) 2. Create a new Github app -3. Give it a GitHub App name and set in the Homepage URL your [DOMAIN_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219) (example: http://localhost:3080) -4. Add a callback URL and set it as "[Your DOMAIN_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219)/oauth/github/callback" (example: http://localhost:3080/oauth/github/callback) +3. Give it a GitHub App name and set in the Homepage URL "your-domain") (example: http://localhost:3080) +4. Add a callback URL and set it as "your-domain/oauth/github/callback" (example: http://localhost:3080/oauth/github/callback) 5. Remove the Active checkbox in the Webhook section 6. Save changes and generate a Client Secret 7. In the Permissions & events tab select, open the Account Permissions and set Email addresses to Read-only @@ -118,11 +118,11 @@ GITHUB_CALLBACK_URL=/oauth/github/callback # this should be the same for everyon 9. Save the .env file --- -## How to Set Up Discord Authentication +## Discord Authentication 1. Go to [Discord Developer Portal](https://discord.com/developers) 2. Create a new Application and give it a name -4. In the OAuth2 general settings add a redirect URL and set it as "[Your DOMAIN_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219)/oauth/discord/callback" (example: http://localhost:3080/oauth/discord/callback) +4. In the OAuth2 general settings add a redirect URL and set it as "your-domain/oauth/discord/callback" (example: http://localhost:3080/oauth/discord/callback) 5. in the Default Authorization Link set applications.commands 6. Save changes and reset the Client Secret 7. Put the Client ID and Client Secret in the .env file: