Skip to content

Commit

Permalink
chore: ElasticSearch 8 uses TLS and authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
le0m committed Mar 5, 2024
1 parent ffe2b76 commit 977955e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
elastic:
- '{"vendor": "OpenSearch 2", "image": "opensearchproject/opensearch:2", "dsn": "http://127.0.0.1:9200/?className=Cake\\ElasticSearch\\Datasource\\Connection&driver=opensearch", "options": "--health-cmd \"curl --fail --output /dev/null --silent http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s\" --health-interval 1s --health-timeout 2s --health-retries 5"}'
- '{"vendor": "OpenSearch 1", "image": "opensearchproject/opensearch:1", "dsn": "http://127.0.0.1:9200/?className=Cake\\ElasticSearch\\Datasource\\Connection&driver=opensearch", "options": "--health-cmd \"curl --fail --output /dev/null --silent http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s\" --health-interval 1s --health-timeout 2s --health-retries 5"}'
- '{"vendor": "ElasticSearch 8", "image": "elasticsearch:8.11.0", "dsn": "http://127.0.0.1:9200/?className=Cake\\ElasticSearch\\Datasource\\Connection&driver=elasticsearch", "options": "--health-cmd \"curl --fail --output /dev/null --silent http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s\" --health-interval 1s --health-timeout 2s --health-retries 5"}'
- '{"vendor": "ElasticSearch 8", "image": "elasticsearch:8.11.0", "dsn": "https://elastic:admin@127.0.0.1:9200/?className=Cake\\ElasticSearch\\Datasource\\Connection&driver=elasticsearch&auth_type=basic&transport=https", "options": "--health-cmd \"curl --fail --insecure --output /dev/null --silent --user elastic:admin https://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s\" --health-interval 1s --health-timeout 2s --health-retries 5"}'
- '{"vendor": "ElasticSearch 7", "image": "elasticsearch:7.17.14", "dsn": "http://127.0.0.1:9200/?className=Cake\\ElasticSearch\\Datasource\\Connection&driver=elasticsearch", "options": "--health-cmd \"curl --fail --output /dev/null --silent http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=1s\" --health-interval 1s --health-timeout 2s --health-retries 5"}'
include:
- php: '8.2'
Expand Down Expand Up @@ -76,9 +76,12 @@ jobs:
elastic:
image: '${{ fromJson(matrix.elastic).image }}'
env:
# OpenSearch
discovery.type: 'single-node'
DISABLE_INSTALL_DEMO_CONFIG: 'true'
DISABLE_SECURITY_PLUGIN: 'true'
# ElasticSearch
ELASTIC_PASSWORD: 'admin'
ports:
- '9200:9200'
- '9300:9300'
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
// Trust any TLS certificate ElasticSearch/OpenSearch may present.
// This is INSECURE but for unit test purposes should be ok.
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYSTATUS => false,
],

'url' => env('es_dsn'),
Expand Down

0 comments on commit 977955e

Please sign in to comment.