diff --git a/.github/actions/opensearch/run.sh b/.github/actions/opensearch/run.sh index ee41c1f..081a318 100755 --- a/.github/actions/opensearch/run.sh +++ b/.github/actions/opensearch/run.sh @@ -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 \ @@ -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 \ @@ -66,7 +80,7 @@ else --show-error \ --silent \ --insecure \ - https://admin:admin@os1:$PORT + https://$CREDENTIAL@os1:$PORT fi sleep 10 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index a0b69a8..0a412b6 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -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: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db56b52..4302692 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,8 +13,8 @@ on: jobs: test-opensearch: env: - TEST_OPENSEARCH_SERVER: http://localhost:9250 - PORT: 9250 + TEST_OPENSEARCH_SERVER: http://localhost:9200 + PORT: 9200 strategy: fail-fast: false matrix: diff --git a/CHANGELOG.md b/CHANGELOG.md index f4a99a0..e28fdc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## Unreleased ### Added ### Changed +- Made CI workflows compatible with OS 2.12 and later. ([#40](https://github.com/opensearch-project/opensearch-ruby-aws-sigv4/pull/40)) ### Deprecated ### Removed ### Fixed