Add NextAuth & fix some fluency errors & more! (#22)

* Update hosting-guide.mdx

* Update config to include new info about NextAuth

* Fix some grammatical things & add callout for Windows testers

* Update configuration.mdx

* remove stupid curly bracket

* Update hosting-guide.mdx

* Update pages/self-hosting/configuration.mdx

Co-authored-by: Badr B. <bdswve@gmail.com>

* Update configuration.mdx

* Update pages/self-hosting/hosting-guide.mdx

* Update hosting-guide.mdx

* Remove Linode

---------

Co-authored-by: Badr B. <bdswve@gmail.com>
This commit is contained in:
Leo Wilkin
2024-06-30 15:05:40 +01:00
committed by GitHub
parent 2b0cb00c4e
commit 0866b105bd
2 changed files with 41 additions and 2 deletions

View File

@@ -142,13 +142,30 @@ Your System Email Address
You can also configure your frontend by creating a `.env` file in the `apps/web` folder.
### Authentication (Oauth) configuration
Following the integration of OAuth using NextAuth to manage sign-ups/ins. For this to work, you now need to add two lines to your `.env` config file.
<Callout type="info">
To safely encrypt tokens and email hashes, you need a NextAuth secret.
To create one, either run `npx auth secret`, or on UNIX based systems (MacOS/Linux) you can use `openssl rand -base64 33`.
Copy this string into your .env file as NEXTAUTH_SECRET.
</Callout>
Here is an example of the `.env` file :
```env filename="apps/web/.env" {1-2}
# Learnhouse configuration
NEXT_PUBLIC_LEARNHOUSE_MULTI_ORG=false
NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORG=defaultorg
# NextAuth Configuration
NEXTAUTH_SECRET={generated_secret}
NEXTAUTH_URL=http://localhost:3000/
```
To learn more about Custom Authentication, visit the NextAuth docs [here](https://authjs.dev/getting-started/authentication).
### Multi Organizations
Please check the [Multi Organization](./organization-hosting-modes) section for more information.

View File

@@ -3,13 +3,17 @@ import { Steps } from 'nextra-theme-docs'
# Self hosting guide
We use Docker & Docker compose to run LearnHouse, this makes it easy to run the application on any machine that has Docker installed.
We use Docker & Docker Compose to run LearnHouse, this makes it easy to run the application on any machine that has Docker installed.
Tested on :
Tested on:
- macOS Sonoma
- Ubuntu 23.04 Lunar lobster
- (Need testers on Windows)
<Callout type="info" emoji="🛠">
Interested in helping test on Windows? Join our [Discord](https://discord.com/invite/CMyZjjYZ6x) community.
</Callout>
## Prerequisites
- [Docker](https://docs.docker.com/get-docker/)
@@ -34,6 +38,24 @@ git clone https://github.com/learnhouse/learnhouse
cd learnhouse
```
### Configure NextAuth
Add these lines to your `.env` file. A template is available under `/extra/example-learnhouse-conf.env`.
<Callout type="info">
To safely encrypt tokens and email hashes, you need a NextAuth secret.
To create one, either run `npx auth secret`, or on UNIX based systems (MacOS/Linux) you can use `openssl rand -base64 33`.
Copy this string into your .env file as NEXTAUTH_SECRET=
</Callout>
```env filename=".env"
# NextAuth Configuration
NEXTAUTH_SECRET={generated_secret}
NEXTAUTH_URL=http://localhost:3000/
```
### Build and run LearnHouse
```shell copy