diff --git a/.vscode/settings.json b/.vscode/settings.json index 53445938c..2da82185a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,7 +22,11 @@ }, "cSpell.words": [ "Alipay", + "CIAM", "Logto", - "Passwordless" + "oidc", + "Passwordless", + "silverhand", + "slonik" ] } diff --git a/packages/core/src/env-set/create-pool-by-env.ts b/packages/core/src/env-set/create-pool-by-env.ts index 3676799e1..2a9fa6a8b 100644 --- a/packages/core/src/env-set/create-pool-by-env.ts +++ b/packages/core/src/env-set/create-pool-by-env.ts @@ -32,7 +32,7 @@ const inquireForLogtoDsn = async (key: string): Promise<[Optional, 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({ diff --git a/packages/docs/docs/tutorial/README.md b/packages/docs/docs/tutorial/README.md index d62d1faef..482670d4b 100644 --- a/packages/docs/docs/tutorial/README.md +++ b/packages/docs/docs/tutorial/README.md @@ -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. diff --git a/packages/docs/docs/tutorial/configuration.md b/packages/docs/docs/tutorial/configuration.md new file mode 100644 index 000000000..3f05b5e33 --- /dev/null +++ b/packages/docs/docs/tutorial/configuration.md @@ -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