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
This commit is contained in:
Marco Beretta 2023-07-28 19:40:47 +02:00 committed by GitHub
parent 745eef2eb0
commit ae51e6153f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 24 deletions

View file

@ -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. 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. 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=<your token> ngrok/ngrok http 80` 2. Open a terminal and run the following command: `docker run -d -it -e NGROK_AUTHTOKEN=<your token> ngrok/ngrok http 80`
## Windows Installation ## Windows Installation 💙
1. Download the ZIP file from https://ngrok.com/download. 1. Download the ZIP file from https://ngrok.com/download.
2. Extract the contents of the ZIP file using 7zip or WinRar. 2. Extract the contents of the ZIP file using 7zip or WinRar.
3. Run `ngrok.exe`. 3.
4. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken. 4. Run `ngrok.exe`.
5. In the `ngrok.exe` terminal, run the following command: `ngrok config add-authtoken <your token>` 5. Copy your auth token from https://dashboard.ngrok.com/get-started/your-authtoken.
6. If you haven't done so already, start LibreChat normally. 6. In the `ngrok.exe` terminal, run the following command: `ngrok config add-authtoken <your token>`
7. In the `ngrok.exe` terminal, run the following command: ngrok http 3080 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. 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) ![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 <your token>`
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 <your token>`
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: ### Note:

View file

@ -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 ## 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. 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". 4. Click on "Save and continue" and then "Back to dashboard".
5. Click on "Create Credentials" and then "OAuth client ID". 5. Click on "Create Credentials" and then "OAuth client ID".
6. Select "Web application" as the application type and give it a name. 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. 7. Add `http://yourdomain`, `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. 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. 9. Click on "Create" and copy your client ID and client secret.
10. Paste them into your /.env file. 10. Paste them into your `/.env` file.
11. Enable the feature in the /.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. 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. 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. 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. 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. 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. 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. 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_CLIENT_SECRET=Your client secret
OPENID_ISSUER=https://login.microsoftonline.com/Your Directory (tenant ID)/v2.0/ OPENID_ISSUER=https://login.microsoftonline.com/Your Directory (tenant ID)/v2.0/
OPENID_SESSION_SECRET=Any random string OPENID_SESSION_SECRET=Any random string
OPENID_SCOPE=openid profile email OPENID_SCOPE=openid profile email #DO NOT CHANGE THIS
OPENID_CALLBACK_URL=/oauth/openid/callback 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. 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. Create a new User Pool in Cognito:
1. Ensure your Cognito user pool sign-in options include `User Name` and `Email`. 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) 1. Go to your [Github Developer settings](https://github.com/settings/apps)
2. Create a new Github app 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) 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_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219)/oauth/github/callback" (example: http://localhost:3080/oauth/github/callback) 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 5. Remove the Active checkbox in the Webhook section
6. Save changes and generate a Client Secret 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 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 9. Save the .env file
--- ---
## How to Set Up Discord Authentication ## Discord Authentication
1. Go to [Discord Developer Portal](https://discord.com/developers) 1. Go to [Discord Developer Portal](https://discord.com/developers)
2. Create a new Application and give it a name 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 5. in the Default Authorization Link set applications.commands
6. Save changes and reset the Client Secret 6. Save changes and reset the Client Secret
7. Put the Client ID and Client Secret in the .env file: 7. Put the Client ID and Client Secret in the .env file: