Skip to content

Commit

Permalink
Remove reference to default credentials (#217)
Browse files Browse the repository at this point in the history
* Remove reference to default credentials

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add changelog line and change PR to be merged in after 2.12 release

Signed-off-by: Derek Ho <dxho@amazon.com>

* Fix script file - missing fi

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add version logic

Signed-off-by: Derek Ho <dxho@amazon.com>

* Update variable name

Signed-off-by: Derek Ho <dxho@amazon.com>

* Try upgrading lychee action

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add logic to support 'latest'

Signed-off-by: Derek Ho <dxho@amazon.com>

---------

Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho authored Feb 27, 2024
1 parent faf3b79 commit b1246f8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .github/actions/opensearch/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ do
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "http.port=${port}" \
--env "action.destructive_requires_name=false" \
--env "OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!" \
--env "plugins.security.disabled=${DISABLE_SECURITY}" \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
Expand All @@ -55,6 +56,19 @@ if [[ $DISABLE_SECURITY = true ]]; then
--silent \
http://os1:$PORT
else
# Starting in 2.12.0, security demo configuration script requires an initial admin password which is set to
# myStrongPassword123!
OPENSEARCH_REQUIRED_VERSION="2.12.0"
if [ "$CLUSTER_VERSION" == "latest" ]; then
CREDENTIAL="admin:myStrongPassword123!"
else
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $CLUSTER_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
CREDENTIAL="admin:admin"
else
CREDENTIAL="admin:myStrongPassword123!"
fi
fi
docker run \
--network cluster \
--rm \
Expand All @@ -66,7 +80,7 @@ else
--show-error \
--silent \
--insecure \
https://admin:admin@os1:$PORT
https://$CREDENTIAL@os1:$PORT
fi

sleep 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.0.8
uses: lycheeverse/lychee-action@v1.9.0
with:
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "https://github.com/\[your*" --exclude "https://localhost:9200" --exclude "http://localhost:9200" --exclude "git://github.com/opensearch-project/*" --exclude "file:///github/workspace/*" --exclude ".*api.server.org:4430/search" --exclude ".*example.com:9200" --exclude ".*myhost:8080" --exclude ".*localhost:9200/" --exclude-mail
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

test-opensearch-security:
env:
TEST_OPENSEARCH_SERVER: https://admin:admin@localhost:9200
TEST_OPENSEARCH_SERVER: https://admin:myStrongPassword123!@localhost:9200
PORT: 9200
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Pass in an initial admin password, required by security after 2.12.0 release ([#217](https://github.com/opensearch-project/opensearch-ruby/issues/217))
### Changed
### Deprecated
### Removed
Expand Down

0 comments on commit b1246f8

Please sign in to comment.