Skip to content

Commit

Permalink
Remove default admin credential references in DEVELOPER_GUIDE (#1415) (
Browse files Browse the repository at this point in the history
…#1420)

* Remove default admin credentials

Signed-off-by: Ryan Bogan <[email protected]>
(cherry picked from commit 0c000ad)

Co-authored-by: Ryan Bogan <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and ryanbogan authored Jan 26, 2024
1 parent f3d7d49 commit 50c5256
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 3 additions & 7 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,12 @@ curl localhost:9200

Additionally, it is also possible to run a cluster with security enabled:
```shell script
./gradlew run -Dsecurity.enabled=true -Dhttps=true -Duser=admin -Dpassword=admin
./gradlew run -Dsecurity.enabled=true -Dhttps=true -Duser=admin -Dpassword=<admin-password>
```

By default, if `-Dsecurity.enabled=true` is passed the following defaults will be used: `https=true`, `user=admin` and
`password=admin`.

Then, to access the cluster, we can run
```bash
curl https://localhost:9200 --insecure -u admin:admin
curl https://localhost:9200 --insecure -u admin:<admin-password>

{
"name" : "integTest-0",
Expand All @@ -301,7 +298,6 @@ curl https://localhost:9200 --insecure -u admin:admin
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
```

### Run Multi-node Cluster Locally

Expand Down Expand Up @@ -331,7 +327,7 @@ Integration tests can be run with remote cluster. For that run the following com
In case remote cluster is secured it's possible to pass username and password with the following command:
```
./gradlew :integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="integTest-0" -Dhttps=true -Duser=admin -Dpassword=admin
./gradlew :integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="integTest-0" -Dhttps=true -Duser=admin -Dpassword=<admin-password>
```
### Debugging
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ integTest {
var is_https = System.getProperty("https")
var user = System.getProperty("user")
var password = System.getProperty("password")

if (System.getProperty("security.enabled") != null) {
// If security is enabled, set is_https/user/password defaults
is_https = is_https == null ? "true" : is_https
user = user == null ? "admin" : user
password = password == null ? "admin" : password
}

systemProperty("https", is_https)
systemProperty("user", user)
systemProperty("password", password)
Expand Down

0 comments on commit 50c5256

Please sign in to comment.