This is an automated email from the ASF dual-hosted git repository.

robinv8 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 2eedf5ab2 docs: document auto-install environment requirements (#364)
2eedf5ab2 is described below

commit 2eedf5ab2dc8738a899162ae37ec83f658c70bef
Author: Robin <[email protected]>
AuthorDate: Mon Nov 16 14:45:04 2026 +0800

    docs: document auto-install environment requirements (#364)
    
    ## Summary
    
    When auto-install validation fails, the environment variable reference
    does not identify which settings are required or what values they
    accept. This update documents the required settings, their validation
    limits, and the connection variables for each database. It also adds a
    complete SQLite command that initializes a fresh data directory.
    
    ## Validation
    
    - Ran the exact SQLite example with an Answer binary built from
    `apache/answer` `dev` at `0584ca0`. Confirmed the generated
    configuration, initialized SQLite database, admin account, and saved
    site settings.
    - Ran the Docusaurus production build for English and Simplified Chinese
    with Node 20 and pnpm 9.
    
    Fixes #359.
---
 docs/getting-started/env.md | 60 +++++++++++++++++++++++++++++++++------------
 1 file changed, 44 insertions(+), 16 deletions(-)

diff --git a/docs/getting-started/env.md b/docs/getting-started/env.md
index 77170225a..40d79c7f7 100644
--- a/docs/getting-started/env.md
+++ b/docs/getting-started/env.md
@@ -6,25 +6,53 @@ slug: /env
 
 ## Installation
 
-- `INSTALL_PORT`: specifies the port to boot when installation, default is 
`80`.
-- `AUTO_INSTALL`: if set to `true`, the installation will be completed 
automatically by environment variable.
+- `INSTALL_PORT`: port for the installation service. The default is `80`.
+- `AUTO_INSTALL`: set to `true` to install from environment variables. Unset 
it to disable auto-install.
 
 ### For auto install
 
-- `DB_TYPE`: database type, support [`sqlite3`  `mysql`  `postgres`]
-- `DB_USERNAME`: database username
-- `DB_PASSWORD`: database password
-- `DB_HOST`: database host, like `127.0.0.1:3306`
-- `DB_NAME`: database name
-- `DB_FILE`: database file path, only for sqlite3
-- `LANGUAGE`: language, like `en-US`
-- `SITE_NAME`: site name `Apache Answer`
-- `SITE_URL`: site url, `https://answer.apache.org`
-- `CONTACT_EMAIL`:  contact email
-- `ADMIN_NAME`:  admin name
-- `ADMIN_PASSWORD`: admin password
-- `ADMIN_EMAIL`: admin email
-- `EXTERNAL_CONTENT_DISPLAY`: content includes images, videos, and media 
embedded from external websites. support [`always_display` `ask_before_display`]
+When using auto-install, provide all of the following variables:
+
+| Variable | Accepted value |
+| --- | --- |
+| `DB_TYPE` | `sqlite3`, `mysql`, or `postgres`. |
+| `LANGUAGE` | Site language code, such as `en_US`. Up to 30 characters. |
+| `SITE_NAME` | Site name, up to 30 characters. |
+| `SITE_URL` | Valid URL, up to 512 characters. |
+| `CONTACT_EMAIL` | Valid email address, up to 500 characters. |
+| `ADMIN_NAME` | Admin name, 2–30 characters. Use letters (`A–Z`, `a–z`), 
digits, underscores, periods, hyphens, or spaces. |
+| `ADMIN_PASSWORD` | Admin password, 8–32 characters. |
+| `ADMIN_EMAIL` | Valid email address, up to 500 characters. |
+| `EXTERNAL_CONTENT_DISPLAY` | `always_display` or `ask_before_display`. 
Controls whether embedded external content loads automatically. |
+
+Set the connection variables for the selected database:
+
+| Database | Connection variables |
+| --- | --- |
+| SQLite (`sqlite3`) | Set `DB_FILE` to the database file path. |
+| MySQL (`mysql`) or PostgreSQL (`postgres`) | Set `DB_HOST` (for example, 
`127.0.0.1:3306` for MySQL or `127.0.0.1:5432` for PostgreSQL), `DB_NAME`, and 
the credentials `DB_USERNAME` and `DB_PASSWORD` as required by your database. |
+
+#### SQLite example
+
+From the directory containing the `answer` binary, run the following command 
to initialize a fresh data directory. Replace the example password and email 
addresses for your own installation.
+
+```bash
+INSTALL_PORT=9080 AUTO_INSTALL=true \
+  DB_TYPE=sqlite3 DB_FILE=./answer-data/answer.db \
+  LANGUAGE=en_US SITE_NAME="My Answer" SITE_URL=http://localhost:9080 \
+  [email protected] \
+  ADMIN_NAME=admin ADMIN_PASSWORD='example-password-123' 
[email protected] \
+  EXTERNAL_CONTENT_DISPLAY=always_display \
+  ./answer init -C ./answer-data
+```
+
+After initialization finishes, start Answer with the same port you used in 
`SITE_URL`. `INSTALL_PORT` only applies during installation.
+
+```bash
+SITE_ADDR=127.0.0.1:9080 ./answer run -C ./answer-data
+```
+
+Open [http://localhost:9080](http://localhost:9080) to view your site.
 
 ### For overriding the config file
 

Reply via email to