|
1 | 1 | ---
|
2 | 2 | title: Configuration
|
| 3 | +description: Step by step guide for you to configure LogChimp site using `logchimp.config.json` file. |
3 | 4 | slug: /docs/config
|
4 | 5 | ---
|
5 | 6 |
|
6 |
| -<!-- components --> |
7 |
| -import Blockquote from "@/components/Blockquote" |
8 |
| - |
9 |
| -Step by step guide for you to configure LogChimp site using `logchimp.config.json` file. |
10 |
| - |
11 |
| -<Blockquote type="warning"> |
12 |
| -NOTE: The documentation is very new and may contain some gaps, please help us fill them in by opening issues or better yet, pull-requests when you think something could be explained better. |
13 |
| -</Blockquote> |
| 7 | +import { Alert } from "../../src/components/Documentation/Alert.tsx" |
14 | 8 |
|
15 | 9 | ## Overview
|
16 | 10 |
|
17 |
| -A custom configuration file must be a valid JSON file located in the root folder. When you install LogChimp using [LogChimp CLI](/docs/cli), a configuration file is created with the options provided. There are some configuration options which are required by default, and few options configuration. |
18 |
| - |
19 |
| -The two required options are `database` and `server` which are configurated during installation process. |
| 11 | +There are some configuration options which is pre-filled by default at installation process via [one-click deploy](/docs/install) button, and other options needs to be configured manually, _for example secret credentials_. |
20 | 12 |
|
21 |
| -In article explains about each configuration and its uses. |
| 13 | +There are two ways to configure your LogChimp site: |
22 | 14 |
|
23 |
| -## Node environment |
| 15 | +1. `logchimp.config.json` file |
| 16 | +2. Environment variables |
24 | 17 |
|
25 |
| -LogChimp supports three environments: **development**, **testing**, **production**. A public LogChimp site should always run in production mode, development is used for building LogChimp locally and testing is only used in CI/CD to run tests. |
| 18 | +<Alert type="tip"> |
| 19 | +Configuring your LogChimp site is one time task and is not required for you to update often, unless you're rotating your secret credentials. |
| 20 | +</Alert> |
26 | 21 |
|
27 |
| -## Options |
| 22 | +## `logchimp.config.json` file |
28 | 23 |
|
29 |
| -There are number of options which are explained in detail below. |
| 24 | +A custom configuration file must be a valid JSON file located in the root folder. |
30 | 25 |
|
31 |
| -<Blockquote type="alert"> |
| 26 | +<Alert type="warning"> |
32 | 27 | The configuration below is just an example and not recommended for production use.
|
33 |
| -</Blockquote> |
| 28 | +</Alert> |
| 29 | + |
| 30 | +The two required options are `database` and `server` which are configurated during installation process. |
34 | 31 |
|
35 | 32 | ```json lines
|
36 | 33 | {
|
@@ -67,6 +64,34 @@ LogChimp uses SMPT connection for sending emails programmatically.
|
67 | 64 | }
|
68 | 65 | ```
|
69 | 66 |
|
| 67 | +## Environment variables |
| 68 | + |
| 69 | +**SERVER** |
| 70 | + |
| 71 | +- `LOGCHIMP_SECRET_KEY`: Railway provides an easy way to generate 32-char secret key, by pressing `Command + K` (on MacOS) or `Ctrl + K` (on windows). Of course, you can provide your own secret key as well. |
| 72 | +- `PORT`: Please do not change the pre-filled value. |
| 73 | +- `LOGCHIMP`: This tells LogChimp to use environment variables instead of [configuration file](/docs/config). Please do not change the pre-filled value. |
| 74 | +- `LOGCHIMP_THEME_STANDALONE`: LogChimp allows you to run on single port or split API and theme. If you're using Railway deploy button, you can leave the value to `false`. |
| 75 | + |
| 76 | +**DATABASE** |
| 77 | + |
| 78 | +You can use your own PostgreSQL database or use PostgreSQL plugin provided by Railway. If you're using Railway plugin, you don't have to change the pre-filled values. |
| 79 | + |
| 80 | +- `LOGCHIMP_DB_HOST`: Database host; default to `${{ PGHOST }}` |
| 81 | +- `LOGCHIMP_DB_DATABASE`: Database name; default to `${{ PGDATABASE }}` |
| 82 | +- `LOGCHIMP_DB_PORT`: Database port; default to `${{ PGPORT }}` |
| 83 | +- `LOGCHIMP_DB_USER`: Database user; default to `${{ PGUSER }}` |
| 84 | +- `LOGCHIMP_DB_PASSWORD`: Database password; default to `${{ PGPASSWORD }}` |
| 85 | +- `LOGCHIMP_DB_SSL`: Database SSL; default to `true` |
| 86 | + |
| 87 | +**MAIL** |
| 88 | + |
| 89 | +You've have to provide SMPT mail authentication details. |
| 90 | + |
| 91 | +- `LOGCHIMP_MAIL_SERVICE`: Name of the email service provider |
| 92 | +- `LOGCHIMP_MAIL_HOST`, `LOGCHIMP_MAIL_USER`, and `LOGCHIMP_MAIL_PASSWORD` |
| 93 | +- `LOGCHIMP_MAIL_PORT`: SMPT port provided by the service provider; default to `587` |
| 94 | + |
70 | 95 | **Does LogChimp support SMPT connection URL?**
|
71 | 96 |
|
72 | 97 | No, currently it's not supported. But you're most welcome to [submit a feature request](https://github.com/logchimp/logchimp) anytime.
|
0 commit comments