bitflicker64 commented on code in PR #526:
URL: https://github.com/apache/hugegraph-doc/pull/526#discussion_r4266617551


##########
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 | | 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-persis
 tent backends the file is read on every start, so keep it readable for as long 
as the option is set. |

Review Comment:
   Important: the fallback half of the version note added in 877f8f4 is wrong 
for part of the range it names. The earlier request on 5d97063 to say that 
`auth.admin_pa` still has to be set was checked against master only, not the 
release tags, and it does not hold for them: `auth.admin_pa` exists only from 
1.7.0, and 1.7.0 reads it on the PD startup path only.
   
   Evidence, apache/hugegraph release tags:
   
   - 1.5.0, 1.3.0, 1.2.0, 1.0.0: `git grep admin_pa <tag>` finds nothing, so 
`auth.admin_pa` is as unknown there as `auth.admin_pa_file` (at 1.5.0 
`HugeConfig.addPropertyDirect` logs the same `The config option '{}' is 
redundant` warning for it). The admin password comes from the `init-store.sh` 
prompt (`StandardAuthenticator.initAdminUser()` calls `inputPassword()`), or 
from `auth.admin_token` on the memory backend (`GraphManager.java:439-441` at 
1.5.0).
   - 1.7.0: the only read of `ServerOptions.ADMIN_PA` is in 
`GraphManager.loadMetaFromPD()` (`GraphManager.java:364`). On the memory 
backend, the only non-persistent one, `checkBackendVersionOrExit` still runs 
`initAdminUser(config.get(ServerOptions.AUTH_ADMIN_TOKEN))` 
(`GraphManager.java:1614-1616`), and `auth.admin_token` defaults to the public 
`162f7848-0b6d-4faf-b557-3a0797869c55` (`ServerOptions.java:487`). That path 
moved to `auth.admin_pa` in a93cc218d (#2927, 2026-01-04), which no release tag 
contains.
   
   So on 1.7.0 with the memory backend and auth on, an operator who follows 
this row and sets `auth.admin_pa` still gets an admin whose password is the 
`auth.admin_token` value. The sentence is right for 1.7.0 with PD (hstore).
   
   Requested change: in this row and the CN row 
(`content/cn/docs/config/config-option.md:72`), replace the fallback sentence 
with what the releases do, for example: "Versions after 1.7.0 only. A 1.7.0 or 
earlier Server ignores this key, logging only a warning, and creates admin as 
before: from the `init-store.sh` prompt on local persistent backends, from 
`auth.admin_pa` (default `pa`) on 1.7.0 with PD (hstore), and from 
`auth.admin_token` (public default) on the memory backend. `auth.admin_pa` does 
not exist before 1.7.0." In the two properties comments 
(`content/en/docs/config/config-authentication.md:103`, 
`content/cn/docs/config/config-authentication.md:98`), keep "older Servers 
ignore this key" and point to the option table instead of "still need 
auth.admin_pa". In the two hstore paragraphs 
(`content/en/docs/config/config-backend-hstore.md:183`, 
`content/cn/docs/config/config-backend-hstore.md:151`), change "1.7.0 or 
earlier" / "1.7.0 及更早版本" to 1.7.0, since those parag
 raphs are about PD.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to