0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

docs: init configuration

This commit is contained in:
Gao Sun 2022-05-05 15:16:11 +08:00
parent 7d8821aa25
commit 4400d8d25e
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
4 changed files with 66 additions and 8 deletions

View file

@ -22,7 +22,11 @@
},
"cSpell.words": [
"Alipay",
"CIAM",
"Logto",
"Passwordless"
"oidc",
"Passwordless",
"silverhand",
"slonik"
]
}

View file

@ -32,7 +32,7 @@ const inquireForLogtoDsn = async (key: string): Promise<[Optional<string>, boole
type: 'confirm',
name: 'value',
default: false,
message: 'Do you have an empty databse for Logto?',
message: 'Do you have an empty database for Logto?',
});
const dsnAnswer = await inquirer.prompt({

View file

@ -13,20 +13,24 @@ sidebar_position: 1
- Extendable multi-language support
- Easy deployment
Boringly, we call it "[customer identity access management](https://en.wikipedia.org/wiki/Customer_identity_access_management)" or "customer identity solution".
Boringly, we call it "[customer identity access management](https://en.wikipedia.org/wiki/Customer_identity_access_management)" (CIAM) or "customer identity solution."
# Get Started
## Get Started
## Prerequisites
### Prerequisites
- NodeJS >= 16.0.0
- PostgreSQL >= 14.0.0
We recommend using a new empty database which is dedicated for Logto, while it's not a hard requirement.
:::tip
It's okay that your PostgreSQL instance is not in the same machine as NodeJS (e.g. containers + remote database environment).
:::
## Run Logto
### Run a Logto Instance
### Download Script
#### Download Script
In your terminal:
@ -34,4 +38,18 @@ In your terminal:
node -e "$(printf "%s" "$(curl -fsSL https://raw.githubusercontent.com/logto-io/logto/master/install.js)")"
```
The script will download Logto and create a directory `logto` in the location you ran it.
The script will download Logto and create a directory `logto` in the location you ran it. After answering [several simple questions](./configuration#questions), you will see the text:
```bash
Server is listening to port 3001
```
Heading to http://localhost:3001 to continue the Logto journey. Enjoy!
#### Docker
TBD
### Configuration
Logto uses environment variables for configuration, along with `.env` file support. See [Configuration](./configuration) for detailed usage and full option list.

View file

@ -0,0 +1,36 @@
---
sidebar_position: 2
---
# Configuration
## Usage
Logto handles environment variables with the following order:
- The `.env` file in the project root
- System environment variable
Thus if the system environment variable will override the value in `.env`.
## First-time Setup Questions {#questions}
For the first time you start Logto with no related environment variable, unless `--no-inquiry` is specified, it'll ask several questions for a smooth experience to fulfill the minimum requirements:
- If you'd like to generate a set of password peppers
- If you'd like to generate a private key for OIDC provider
- If you'd like to set up a new Logto database
- Enter the [Postgres DSN](https://www.postgresql.org/docs/14/libpq-connect.html#id-1.7.3.8.3.6)
- Finally the domain for Logto
Most of them are just simple yes / no questions or you can use the default value, except the [Postgres DSN](https://www.postgresql.org/docs/14/libpq-connect.html#id-1.7.3.8.3.6).
The generated private key for OIDC provider will locate on `./oidc-private-key.pem`, while other values will append to `./.env`.
:::note
The `--no-inquiry` parameter is appended by default in the Docker image.
:::
## Variable List
TBF in the next PR