From 1667ee519bff8e8b7bb57fa05185405b834bb565 Mon Sep 17 00:00:00 2001 From: arshil-khan Date: Tue, 13 Oct 2026 12:58:55 +0530 Subject: [PATCH 1/3] docs(config): document auth.admin_pa_file Add the Server option from apache/hugegraph#3334 to the EN and CN config-option tables, the rest-server.properties example in the authentication guide, and the init-store check described in the hstore backend page. --- content/cn/docs/config/config-authentication.md | 3 +++ content/cn/docs/config/config-backend-hstore.md | 2 +- content/cn/docs/config/config-option.md | 1 + content/en/docs/config/config-authentication.md | 3 +++ content/en/docs/config/config-backend-hstore.md | 6 ++++-- content/en/docs/config/config-option.md | 1 + 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/content/cn/docs/config/config-authentication.md b/content/cn/docs/config/config-authentication.md index 36f8de2280..7ba6c9965a 100644 --- a/content/cn/docs/config/config-authentication.md +++ b/content/cn/docs/config/config-authentication.md @@ -92,6 +92,9 @@ auth.graph_store=hugegraph # Server 启动路径首次创建内置 admin 账号时使用,默认值为公开的 pa,生产部署前务必显式设置强密码 # 本地持久化后端首次启用 StandardAuthenticator 时,init-store.sh 会交互式读取密码 #auth.admin_pa= +# 也可以从文件读取密码:按原始 UTF-8 读取(去掉末尾一个换行符),空格、反斜杠和非 ASCII 字符无需转义 +# 设置后优先于 auth.admin_pa 和 init-store.sh 的交互式输入 +#auth.admin_pa_file=/run/secrets/hugegraph-admin-password # auth client config # 如果是分开部署 GraphServer 和 AuthServer,还需要指定下面的配置,地址填写 AuthServer 的 IP:RPC 端口 diff --git a/content/cn/docs/config/config-backend-hstore.md b/content/cn/docs/config/config-backend-hstore.md index 59a0131b08..0dd87fee58 100644 --- a/content/cn/docs/config/config-backend-hstore.md +++ b/content/cn/docs/config/config-backend-hstore.md @@ -148,7 +148,7 @@ PD 对该值的处理方式: | graphspace | {graph}.properties | DEFAULT | PD 看到的图名的第一段 | `CoreOptions.java:679-685` | `init-store.sh` 从不初始化 `hstore` 图。在开启的路径上,它扫描 `conf/graphs` 并跳过后端为 `hstore` 的每一个图。如果用 `init_store.enabled=false` 整体关闭这一步,它会改为校验 admin 账号仍然能在 PD 启动路径上被创建: -`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值。否则启动会直接失败,而不是使用公开的默认密码创建账号。 +`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值,或者 `auth.admin_pa_file` 指向一个可读、非空的 UTF-8 文件(此时会立即读取该文件,路径错误会在 Server 启动前报错)。否则启动会直接失败,而不是使用公开的默认密码创建账号。 ### 6 Server 如何通过 PD 发现 Store diff --git a/content/cn/docs/config/config-option.md b/content/cn/docs/config/config-option.md index 917a46df24..e365696bd3 100644 --- a/content/cn/docs/config/config-option.md +++ b/content/cn/docs/config/config-option.md @@ -69,6 +69,7 @@ search_boost: 1.5 | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Server 启动路径初始化内置 admin 账户时使用,默认值为公开的 `pa`,生产部署前必须显式设置强密码。本地持久化后端首次初始化由 `init-store.sh` 交互式读取密码。 | +| auth.admin_pa_file | | 存放内置 admin 账户初始密码的文件路径。文件按原始 UTF-8 读取,并去掉末尾的一个换行符,因此空格、反斜杠和非 ASCII 字符无需按 properties 语法转义。设置后优先于 `auth.admin_pa` 和 `init-store.sh` 的交互式密码输入。文件不存在、为空或不是合法 UTF-8 时启动失败。仅在首次启动时生效。 | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. | diff --git a/content/en/docs/config/config-authentication.md b/content/en/docs/config/config-authentication.md index 80b0db9951..167e284f15 100644 --- a/content/en/docs/config/config-authentication.md +++ b/content/en/docs/config/config-authentication.md @@ -96,6 +96,9 @@ auth.graph_store=hugegraph # Used when Server first creates admin; replace public default pa with a strong password in production # For local persistent backends, init-store.sh prompts for a password when StandardAuthenticator is first initialized #auth.admin_pa= +# Or read the password from a file as raw UTF-8 (one trailing line break is dropped), so spaces, +# backslashes and non-ASCII characters need no escaping; overrides auth.admin_pa and the init-store.sh prompt +#auth.admin_pa_file=/run/secrets/hugegraph-admin-password # Auth Client Config # If GraphServer and AuthServer are deployed separately, you also need to specify the following configuration. Fill in the IP:RPC port of AuthServer. diff --git a/content/en/docs/config/config-backend-hstore.md b/content/en/docs/config/config-backend-hstore.md index 189ade32ce..30ddcac8d5 100644 --- a/content/en/docs/config/config-backend-hstore.md +++ b/content/en/docs/config/config-backend-hstore.md @@ -175,8 +175,10 @@ in the checked Server master commit `2f827d6` where the option is declared. `init-store.sh` never initializes an `hstore` graph. On the enabled path it scans `conf/graphs` and skips every graph whose backend is `hstore`. If you turn the whole step off with `init_store.enabled=false`, it validates instead that the admin account can still be created on the PD startup path: `usePD` has to be true, -the auth graph has to exist locally with backend `hstore`, and `auth.admin_pa` has to be set to an explicit -non-empty value. Otherwise startup fails rather than handing out the public default password. +the auth graph has to exist locally with backend `hstore`, and either `auth.admin_pa` has to be set to an explicit +non-empty value or `auth.admin_pa_file` has to point at a readable, non-empty UTF-8 file, which is read at this +point so a bad path fails before the Server starts. Otherwise startup fails rather than handing out the public +default password. ### 6 How the Server finds the stores diff --git a/content/en/docs/config/config-option.md b/content/en/docs/config/config-option.md index 633c627e56..c242e23a4c 100644 --- a/content/en/docs/config/config-option.md +++ b/content/en/docs/config/config-option.md @@ -69,6 +69,7 @@ Corresponding configuration file `rest-server.properties` | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Used when the Server startup path initializes admin. Explicitly set a strong password before production deployment; the public default is `pa`. On local persistent backends, `init-store.sh` prompts for the initial password. | +| auth.admin_pa_file | | Path of a file holding the initial password for the built-in admin account. The file is read as raw UTF-8 with one trailing line break removed, so spaces, backslashes and non-ASCII characters need no properties escaping. When set, it takes precedence over `auth.admin_pa` and the `init-store.sh` password prompt. A missing, empty or non-UTF-8 file stops startup. Takes effect on first startup. | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. | From 5d97063c5d7c464261add27a5ad526e14f696080 Mon Sep 17 00:00:00 2001 From: arshil-khan Date: Wed, 14 Oct 2026 00:22:28 +0530 Subject: [PATCH 2/3] docs(config): match auth.admin_pa_file to the current Server checks apache/hugegraph#3334 now requires a regular file, strips a leading BOM, and caps the file at 4096 bytes and the password at 72 UTF-8 bytes. Add those to the option rows and the rest-server.properties comments. The pages also called the option first-startup only. The password is applied only when the admin is created, but PD (hstore) and non-persistent backends read the file on every start, so removing it after the first boot stops the Server. Say so in the option rows, the properties comments and the hstore init-store paragraph. --- content/cn/docs/config/config-authentication.md | 5 +++-- content/cn/docs/config/config-backend-hstore.md | 2 +- content/cn/docs/config/config-option.md | 2 +- content/en/docs/config/config-authentication.md | 6 ++++-- content/en/docs/config/config-backend-hstore.md | 7 ++++--- content/en/docs/config/config-option.md | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/content/cn/docs/config/config-authentication.md b/content/cn/docs/config/config-authentication.md index 7ba6c9965a..e4bc02321f 100644 --- a/content/cn/docs/config/config-authentication.md +++ b/content/cn/docs/config/config-authentication.md @@ -92,8 +92,9 @@ auth.graph_store=hugegraph # Server 启动路径首次创建内置 admin 账号时使用,默认值为公开的 pa,生产部署前务必显式设置强密码 # 本地持久化后端首次启用 StandardAuthenticator 时,init-store.sh 会交互式读取密码 #auth.admin_pa= -# 也可以从文件读取密码:按原始 UTF-8 读取(去掉末尾一个换行符),空格、反斜杠和非 ASCII 字符无需转义 -# 设置后优先于 auth.admin_pa 和 init-store.sh 的交互式输入 +# 也可以从文件读取密码:按原始 UTF-8 读取(去掉开头的 BOM 和末尾一个换行符),空格、反斜杠和非 ASCII 字符无需转义 +# 设置后优先于 auth.admin_pa 和 init-store.sh 的交互式输入;必须是普通文件(会跟随符号链接),密码最多 72 个 UTF-8 字节 +# 使用 PD(hstore)和非持久化后端时每次启动都会读取该文件,设置该选项期间要保持文件可读 #auth.admin_pa_file=/run/secrets/hugegraph-admin-password # auth client config diff --git a/content/cn/docs/config/config-backend-hstore.md b/content/cn/docs/config/config-backend-hstore.md index 0dd87fee58..55b15ad8ae 100644 --- a/content/cn/docs/config/config-backend-hstore.md +++ b/content/cn/docs/config/config-backend-hstore.md @@ -148,7 +148,7 @@ PD 对该值的处理方式: | graphspace | {graph}.properties | DEFAULT | PD 看到的图名的第一段 | `CoreOptions.java:679-685` | `init-store.sh` 从不初始化 `hstore` 图。在开启的路径上,它扫描 `conf/graphs` 并跳过后端为 `hstore` 的每一个图。如果用 `init_store.enabled=false` 整体关闭这一步,它会改为校验 admin 账号仍然能在 PD 启动路径上被创建: -`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值,或者 `auth.admin_pa_file` 指向一个可读、非空的 UTF-8 文件(此时会立即读取该文件,路径错误会在 Server 启动前报错)。否则启动会直接失败,而不是使用公开的默认密码创建账号。 +`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值,或者 `auth.admin_pa_file` 指向一个能通过 Server 启动时同样校验的文件(此时会立即读取该文件,文件有问题会在 Server 启动前报错)。否则启动会直接失败,而不是使用公开的默认密码创建账号。使用 PD 时 Server 每次启动都会再次读取 `auth.admin_pa_file`,而不只是首次启动,因此只要设置了该选项,就要保持文件可读。 ### 6 Server 如何通过 PD 发现 Store diff --git a/content/cn/docs/config/config-option.md b/content/cn/docs/config/config-option.md index e365696bd3..dab548304a 100644 --- a/content/cn/docs/config/config-option.md +++ b/content/cn/docs/config/config-option.md @@ -69,7 +69,7 @@ search_boost: 1.5 | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Server 启动路径初始化内置 admin 账户时使用,默认值为公开的 `pa`,生产部署前必须显式设置强密码。本地持久化后端首次初始化由 `init-store.sh` 交互式读取密码。 | -| auth.admin_pa_file | | 存放内置 admin 账户初始密码的文件路径。文件按原始 UTF-8 读取,并去掉末尾的一个换行符,因此空格、反斜杠和非 ASCII 字符无需按 properties 语法转义。设置后优先于 `auth.admin_pa` 和 `init-store.sh` 的交互式密码输入。文件不存在、为空或不是合法 UTF-8 时启动失败。仅在首次启动时生效。 | +| auth.admin_pa_file | | 存放内置 admin 账户初始密码的文件路径,必须是普通文件(会跟随符号链接)。文件按原始 UTF-8 读取,并去掉开头的 BOM 和末尾的一个换行符,因此空格、反斜杠和非 ASCII 字符无需按 properties 语法转义。密码按 UTF-8 编码最多 72 字节,超出部分不会参与密码哈希。设置后优先于 `auth.admin_pa` 和 `init-store.sh` 的交互式密码输入。文件不存在、不可读、不是普通文件、超过 4096 字节、不是合法 UTF-8、为空或密码超过 72 字节时,`init-store.sh` 或 Server 启动会失败。密码只在首次创建 admin 账户时使用,但使用 PD(hstore)和非持久化后端时,每次启动都会读取该文件,因此只要设置了该选项,就要保持文件可读。 | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. | diff --git a/content/en/docs/config/config-authentication.md b/content/en/docs/config/config-authentication.md index 167e284f15..b2588a2b78 100644 --- a/content/en/docs/config/config-authentication.md +++ b/content/en/docs/config/config-authentication.md @@ -96,8 +96,10 @@ auth.graph_store=hugegraph # Used when Server first creates admin; replace public default pa with a strong password in production # For local persistent backends, init-store.sh prompts for a password when StandardAuthenticator is first initialized #auth.admin_pa= -# Or read the password from a file as raw UTF-8 (one trailing line break is dropped), so spaces, -# backslashes and non-ASCII characters need no escaping; overrides auth.admin_pa and the init-store.sh prompt +# Or read the password from a file as raw UTF-8 (a leading BOM and one trailing line break are dropped), so +# spaces, backslashes and non-ASCII characters need no escaping; overrides auth.admin_pa and the init-store.sh prompt. +# It must be a regular file (symlinks are followed), and the password may be at most 72 UTF-8 bytes. +# PD (hstore) and non-persistent backends read it on every start, so keep it readable while it is set #auth.admin_pa_file=/run/secrets/hugegraph-admin-password # Auth Client Config diff --git a/content/en/docs/config/config-backend-hstore.md b/content/en/docs/config/config-backend-hstore.md index 30ddcac8d5..e2bd478c95 100644 --- a/content/en/docs/config/config-backend-hstore.md +++ b/content/en/docs/config/config-backend-hstore.md @@ -176,9 +176,10 @@ in the checked Server master commit `2f827d6` where the option is declared. every graph whose backend is `hstore`. If you turn the whole step off with `init_store.enabled=false`, it validates instead that the admin account can still be created on the PD startup path: `usePD` has to be true, the auth graph has to exist locally with backend `hstore`, and either `auth.admin_pa` has to be set to an explicit -non-empty value or `auth.admin_pa_file` has to point at a readable, non-empty UTF-8 file, which is read at this -point so a bad path fails before the Server starts. Otherwise startup fails rather than handing out the public -default password. +non-empty value or `auth.admin_pa_file` has to name a file that passes the same checks as at Server startup. +That file is read at this point, so a bad path fails before the Server starts. Otherwise startup fails rather +than handing out the public default password. With PD the Server reads `auth.admin_pa_file` again on every +start, not only the first one, so keep the file readable for as long as the option is set. ### 6 How the Server finds the stores diff --git a/content/en/docs/config/config-option.md b/content/en/docs/config/config-option.md index c242e23a4c..bf7a182922 100644 --- a/content/en/docs/config/config-option.md +++ b/content/en/docs/config/config-option.md @@ -69,7 +69,7 @@ Corresponding configuration file `rest-server.properties` | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Used when the Server startup path initializes admin. Explicitly set a strong password before production deployment; the public default is `pa`. On local persistent backends, `init-store.sh` prompts for the initial password. | -| auth.admin_pa_file | | Path of a file holding the initial password for the built-in admin account. The file is read as raw UTF-8 with one trailing line break removed, so spaces, backslashes and non-ASCII characters need no properties escaping. When set, it takes precedence over `auth.admin_pa` and the `init-store.sh` password prompt. A missing, empty or non-UTF-8 file stops startup. Takes effect on first startup. | +| auth.admin_pa_file | | Path of a regular file (symlinks are followed) holding the initial password for the built-in admin account. The file is read as raw UTF-8 with a leading BOM and one trailing line break removed, so spaces, backslashes and non-ASCII characters need no properties escaping. The password may be at most 72 bytes in UTF-8, because the password hash ignores anything after that. When set, it takes precedence over `auth.admin_pa` and the `init-store.sh` password prompt. A file that is missing, unreadable, not a regular file, larger than 4096 bytes, not valid UTF-8, empty, or holding a password longer than 72 bytes stops `init-store.sh` or Server startup. The password is only applied when the admin account is first created, but with PD (hstore) and non-persistent backends the file is read on every start, so keep it readable for as long as the option is set. | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. | From 877f8f4aaae82cc44affd24674f6fbe37406286a Mon Sep 17 00:00:00 2001 From: arshil-khan Date: Wed, 14 Oct 2026 05:07:25 +0530 Subject: [PATCH 3/3] docs(config): say auth.admin_pa_file needs a Server after 1.7.0 Servers up to 1.7.0 do not register the option. They log a warning for the unknown key and create the admin from auth.admin_pa, whose default is pa, or prompt in init-store. Say so in the option rows, the rest-server.properties comments and the hstore init-store paragraph, in EN and CN. --- content/cn/docs/config/config-authentication.md | 1 + content/cn/docs/config/config-backend-hstore.md | 2 +- content/cn/docs/config/config-option.md | 2 +- content/en/docs/config/config-authentication.md | 3 ++- content/en/docs/config/config-backend-hstore.md | 4 +++- content/en/docs/config/config-option.md | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/content/cn/docs/config/config-authentication.md b/content/cn/docs/config/config-authentication.md index e4bc02321f..2e3d9a9ae4 100644 --- a/content/cn/docs/config/config-authentication.md +++ b/content/cn/docs/config/config-authentication.md @@ -95,6 +95,7 @@ auth.graph_store=hugegraph # 也可以从文件读取密码:按原始 UTF-8 读取(去掉开头的 BOM 和末尾一个换行符),空格、反斜杠和非 ASCII 字符无需转义 # 设置后优先于 auth.admin_pa 和 init-store.sh 的交互式输入;必须是普通文件(会跟随符号链接),密码最多 72 个 UTF-8 字节 # 使用 PD(hstore)和非持久化后端时每次启动都会读取该文件,设置该选项期间要保持文件可读 +# 仅适用于 1.7.0 之后的版本:更早版本的 Server 会忽略该配置项,仍需设置 auth.admin_pa #auth.admin_pa_file=/run/secrets/hugegraph-admin-password # auth client config diff --git a/content/cn/docs/config/config-backend-hstore.md b/content/cn/docs/config/config-backend-hstore.md index 55b15ad8ae..94670a5d32 100644 --- a/content/cn/docs/config/config-backend-hstore.md +++ b/content/cn/docs/config/config-backend-hstore.md @@ -148,7 +148,7 @@ PD 对该值的处理方式: | graphspace | {graph}.properties | DEFAULT | PD 看到的图名的第一段 | `CoreOptions.java:679-685` | `init-store.sh` 从不初始化 `hstore` 图。在开启的路径上,它扫描 `conf/graphs` 并跳过后端为 `hstore` 的每一个图。如果用 `init_store.enabled=false` 整体关闭这一步,它会改为校验 admin 账号仍然能在 PD 启动路径上被创建: -`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值,或者 `auth.admin_pa_file` 指向一个能通过 Server 启动时同样校验的文件(此时会立即读取该文件,文件有问题会在 Server 启动前报错)。否则启动会直接失败,而不是使用公开的默认密码创建账号。使用 PD 时 Server 每次启动都会再次读取 `auth.admin_pa_file`,而不只是首次启动,因此只要设置了该选项,就要保持文件可读。 +`usePD` 必须为 true、权限图必须存在于本地配置中且后端为 `hstore`、`auth.admin_pa` 必须显式设置为非空值,或者 `auth.admin_pa_file` 指向一个能通过 Server 启动时同样校验的文件(此时会立即读取该文件,文件有问题会在 Server 启动前报错)。否则启动会直接失败,而不是使用公开的默认密码创建账号。使用 PD 时 Server 每次启动都会再次读取 `auth.admin_pa_file`,而不只是首次启动,因此只要设置了该选项,就要保持文件可读。只有 1.7.0 之后的版本支持 `auth.admin_pa_file`;1.7.0 及更早版本的 Server 会忽略该配置项并只输出一条警告日志,仍按 `auth.admin_pa`(默认值为 `pa`)创建 admin 账号,因此在这些版本上仍需设置 `auth.admin_pa`。 ### 6 Server 如何通过 PD 发现 Store diff --git a/content/cn/docs/config/config-option.md b/content/cn/docs/config/config-option.md index dab548304a..c80065604b 100644 --- a/content/cn/docs/config/config-option.md +++ b/content/cn/docs/config/config-option.md @@ -69,7 +69,7 @@ search_boost: 1.5 | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Server 启动路径初始化内置 admin 账户时使用,默认值为公开的 `pa`,生产部署前必须显式设置强密码。本地持久化后端首次初始化由 `init-store.sh` 交互式读取密码。 | -| auth.admin_pa_file | | 存放内置 admin 账户初始密码的文件路径,必须是普通文件(会跟随符号链接)。文件按原始 UTF-8 读取,并去掉开头的 BOM 和末尾的一个换行符,因此空格、反斜杠和非 ASCII 字符无需按 properties 语法转义。密码按 UTF-8 编码最多 72 字节,超出部分不会参与密码哈希。设置后优先于 `auth.admin_pa` 和 `init-store.sh` 的交互式密码输入。文件不存在、不可读、不是普通文件、超过 4096 字节、不是合法 UTF-8、为空或密码超过 72 字节时,`init-store.sh` 或 Server 启动会失败。密码只在首次创建 admin 账户时使用,但使用 PD(hstore)和非持久化后端时,每次启动都会读取该文件,因此只要设置了该选项,就要保持文件可读。 | +| auth.admin_pa_file | | 仅适用于 1.7.0 之后的版本。1.7.0 及更早版本的 Server 会忽略该配置项,只输出一条警告日志,仍然使用 `auth.admin_pa`(默认值为 `pa`)或 `init-store.sh` 的交互式输入,因此在这些版本上仍需设置 `auth.admin_pa`。存放内置 admin 账户初始密码的文件路径,必须是普通文件(会跟随符号链接)。文件按原始 UTF-8 读取,并去掉开头的 BOM 和末尾的一个换行符,因此空格、反斜杠和非 ASCII 字符无需按 properties 语法转义。密码按 UTF-8 编码最多 72 字节,超出部分不会参与密码哈希。设置后优先于 `auth.admin_pa` 和 `init-store.sh` 的交互式密码输入。文件不存在、不可读、不是普通文件、超过 4096 字节、不是合法 UTF-8、为空或密码超过 72 字节时,`init-store.sh` 或 Server 启动会失败。密码只在首次创建 admin 账户时使用,但使用 PD(hstore)和非持久化后端时,每次启动都会读取该文件,因此只要设置了该选项,就要保持文件可读。 | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. | diff --git a/content/en/docs/config/config-authentication.md b/content/en/docs/config/config-authentication.md index b2588a2b78..f1057390a1 100644 --- a/content/en/docs/config/config-authentication.md +++ b/content/en/docs/config/config-authentication.md @@ -99,7 +99,8 @@ auth.graph_store=hugegraph # Or read the password from a file as raw UTF-8 (a leading BOM and one trailing line break are dropped), so # spaces, backslashes and non-ASCII characters need no escaping; overrides auth.admin_pa and the init-store.sh prompt. # It must be a regular file (symlinks are followed), and the password may be at most 72 UTF-8 bytes. -# PD (hstore) and non-persistent backends read it on every start, so keep it readable while it is set +# PD (hstore) and non-persistent backends read it on every start, so keep it readable while it is set. +# Versions after 1.7.0 only: older Servers ignore this key and still need auth.admin_pa #auth.admin_pa_file=/run/secrets/hugegraph-admin-password # Auth Client Config diff --git a/content/en/docs/config/config-backend-hstore.md b/content/en/docs/config/config-backend-hstore.md index e2bd478c95..565e38da02 100644 --- a/content/en/docs/config/config-backend-hstore.md +++ b/content/en/docs/config/config-backend-hstore.md @@ -179,7 +179,9 @@ the auth graph has to exist locally with backend `hstore`, and either `auth.admi non-empty value or `auth.admin_pa_file` has to name a file that passes the same checks as at Server startup. That file is read at this point, so a bad path fails before the Server starts. Otherwise startup fails rather than handing out the public default password. With PD the Server reads `auth.admin_pa_file` again on every -start, not only the first one, so keep the file readable for as long as the option is set. +start, not only the first one, so keep the file readable for as long as the option is set. Only versions after +1.7.0 have `auth.admin_pa_file`. A 1.7.0 or earlier Server ignores it with a warning and creates the admin from +`auth.admin_pa`, whose default is `pa`, so set `auth.admin_pa` on those versions. ### 6 How the Server finds the stores diff --git a/content/en/docs/config/config-option.md b/content/en/docs/config/config-option.md index bf7a182922..a7b18b950f 100644 --- a/content/en/docs/config/config-option.md +++ b/content/en/docs/config/config-option.md @@ -69,7 +69,7 @@ Corresponding configuration file `rest-server.properties` | auth.authenticator | | The class path of authenticator implementation. e.g., org.apache.hugegraph.auth.StandardAuthenticator, or a custom implementation. | | auth.graph_store | hugegraph | The name of graph used to store authentication information, like users, only for org.apache.hugegraph.auth.StandardAuthenticator. | | auth.admin_pa | pa | Used when the Server startup path initializes admin. Explicitly set a strong password before production deployment; the public default is `pa`. On local persistent backends, `init-store.sh` prompts for the initial password. | -| auth.admin_pa_file | | Path of a regular file (symlinks are followed) holding the initial password for the built-in admin account. The file is read as raw UTF-8 with a leading BOM and one trailing line break removed, so spaces, backslashes and non-ASCII characters need no properties escaping. The password may be at most 72 bytes in UTF-8, because the password hash ignores anything after that. When set, it takes precedence over `auth.admin_pa` and the `init-store.sh` password prompt. A file that is missing, unreadable, not a regular file, larger than 4096 bytes, not valid UTF-8, empty, or holding a password longer than 72 bytes stops `init-store.sh` or Server startup. The password is only applied when the admin account is first created, but with PD (hstore) and non-persistent backends the file is read on every start, so keep it readable for as long as the option is set. | +| auth.admin_pa_file | | Versions after 1.7.0 only. A 1.7.0 or earlier Server ignores this key, logging only a warning, and still uses `auth.admin_pa` (default `pa`) or the `init-store.sh` prompt, so set `auth.admin_pa` on those versions. Path of a regular file (symlinks are followed) holding the initial password for the built-in admin account. The file is read as raw UTF-8 with a leading BOM and one trailing line break removed, so spaces, backslashes and non-ASCII characters need no properties escaping. The password may be at most 72 bytes in UTF-8, because the password hash ignores anything after that. When set, it takes precedence over `auth.admin_pa` and the `init-store.sh` password prompt. A file that is missing, unreadable, not a regular file, larger than 4096 bytes, not valid UTF-8, empty, or holding a password longer than 72 bytes stops `init-store.sh` or Server startup. The password is only applied when the admin account is first created, but with PD (hstore) and non-persistent backends the file is read on every start, so keep it readable for as long as the option is set. | | auth.remote_url | | If the address is empty, it provide auth service, otherwise it is auth client and also provide auth service through rpc forwarding. The remote url can be set to multiple addresses, which are concat by ','. | | exception.allow_trace | true | Whether to allow exception trace stack. | | memory_monitor.threshold | 0.85 | Threshold for JVM memory usage monitoring, 1 means disabling the memory monitoring task. |