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

piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 995551caa chore(docs): clarify root credentials behavior and lifecycle 
(#2312)
995551caa is described below

commit 995551caac83a28738dcb445e588df04f1ced3aa
Author: sijun-yang <[email protected]>
AuthorDate: Wed Nov 5 17:13:05 2025 +0900

    chore(docs): clarify root credentials behavior and lifecycle (#2312)
    
    Clarify that root credentials are only set on first server startup when the 
data directory doesn't exist.
    Align documentation and log messages with actual implementation behavior.
---
 README.md               | 4 ++++
 core/server/src/args.rs | 2 +-
 core/server/src/main.rs | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 7dfeddf45..462e1d115 100644
--- a/README.md
+++ b/README.md
@@ -235,12 +235,16 @@ Start the server:
 
 `cargo run --bin iggy-server`
 
+All the data used by the server will be persisted under the `local_data` 
directory by default, unless specified differently in the configuration (see 
`system.path` in `server.toml`).
+
 One can use default root credentials with optional 
`--with-default-root-credentials`.
 This flag is equivalent to setting `IGGY_ROOT_USERNAME=iggy` and 
`IGGY_ROOT_PASSWORD=iggy`, plus
 it should only be used for development and testing.
 
 `cargo run --bin iggy-server -- --with-default-root-credentials`
 
+Root credentials are only set on the first server startup when the data 
directory doesn't exist yet. Once the server has been started and persisted 
data exists, the existing root credentials will be reused, and the 
`--with-default-root-credentials` flag or environment variables will have no 
effect. To reset credentials, delete the data directory.
+
 For configuration options and detailed help:
 
 `cargo run --bin iggy-server -- --help`
diff --git a/core/server/src/args.rs b/core/server/src/args.rs
index c47da4d24..3a6cfdb96 100644
--- a/core/server/src/args.rs
+++ b/core/server/src/args.rs
@@ -94,7 +94,7 @@ pub struct Args {
     ///
     /// When this flag is set, the root user will be created with username 
'iggy'
     /// and password 'iggy' if it doesn't exist. If the root user already 
exists,
-    /// this flag has no effect and a warning will be printed.
+    /// this flag has no effect.
     ///
     /// This flag is equivalent to setting IGGY_ROOT_USERNAME=iggy and 
IGGY_ROOT_PASSWORD=iggy,
     /// but environment variables take precedence over this flag.
diff --git a/core/server/src/main.rs b/core/server/src/main.rs
index 1ed5e4381..575a72606 100644
--- a/core/server/src/main.rs
+++ b/core/server/src/main.rs
@@ -103,7 +103,8 @@ async fn main() -> Result<(), ServerError> {
                 }
             }
             info!(
-                "Using default root credentials (username: iggy, password: 
iggy) - FOR DEVELOPMENT ONLY!"
+                "Using default root credentials (username: iggy, password: 
iggy) - FOR DEVELOPMENT ONLY! \
+                If root user already exists, existing credentials will be 
reused."
             );
         } else {
             warn!(

Reply via email to