Skip to content

Commit dd2654c

Browse files
committed
add changelog and fix local dev
1 parent f23505c commit dd2654c

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.9.9]
11+
12+
- Fix reported vulnerabilities.
13+
1014
## [1.9.8]
1115

1216
- Fix reported vulnerabilities.

docker-compose.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
version: '3.8'
21
services:
32
ndc-elasticsearch:
43
image: ghcr.io/hasura/ndc-elasticsearch:latest
4+
build:
5+
context: .
56
volumes:
67
- ./resources/configuration.json:/etc/connector/configuration.json
78
- certs:/usr/share/elasticsearch/config/certs
9+
user: "0"
810
ports:
911
- 8080:8080
1012
environment:
@@ -16,6 +18,7 @@ services:
1618
ELASTICSEARCH_USERNAME: elastic
1719
ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD:-default}
1820
ELASTICSEARCH_CA_CERT_PATH: /usr/share/elasticsearch/config/certs/es01/es01.crt
21+
HASURA_LOG_LEVEL: debug
1922
command: serve
2023
depends_on:
2124
jaeger:
@@ -58,22 +61,18 @@ services:
5861
chown -R root:root config/certs;
5962
find . -type d -exec chmod 750 \{\} \;;
6063
find . -type f -exec chmod 640 \{\} \;;
61-
echo "Waiting for Elasticsearch availability";
62-
until curl -s --cacert config/certs/ca/ca.crt https://es01:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
63-
echo "Setting kibana_system password";
64-
until curl -s -X POST --cacert config/certs/ca/ca.crt -u "elastic:${ELASTIC_PASSWORD:-default}" -H "Content-Type: application/json" https://es01:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD:-default}\"}" | grep -q "^{}"; do sleep 10; done;
6564
echo "All done!";
6665
'
6766
healthcheck:
6867
test: ["CMD-SHELL", "[ -f config/certs/es01/es01.crt ]"]
6968
interval: 1s
7069
timeout: 5s
7170
retries: 120
72-
71+
7372
es01:
7473
depends_on:
7574
setup:
76-
condition: service_healthy
75+
condition: service_completed_successfully
7776
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-8.13.4}
7877
volumes:
7978
- certs:/usr/share/elasticsearch/config/certs

internal/utils.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,20 @@ func Contains(s []string, e string) bool {
191191
//
192192
// The path of the file will change based on the component that is accessing it
193193
func GetUsersFile(filePath string) ([]byte, error) {
194-
if os.Getenv("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH") != "" {
195-
// the plugin is accessing the file
196-
// we'll prepend the value of this env var to the file path
197-
filePath = filepath.Join(os.Getenv("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH"), filePath)
198-
} else if os.Getenv("HASURA_CONFIGURATION_DIRECTORY") != "" {
199-
// the docker container is accessing the file
200-
filePath = filepath.Join(os.Getenv("HASURA_CONFIGURATION_DIRECTORY"), filePath)
201-
} else {
202-
// since no env var is set, we'll assume that the docker container is accessing the file
203-
// and the file is mounted to the /etc/connector/ directory, according to the spec:
204-
// https://github.com/hasura/ndc-hub/blob/a764938e13fa3cc719745edaff73b584a936e3ef/rfcs/0000-deployment.md?plain=1#L23
205-
filePath = filepath.Join("/etc/connector/", filePath)
194+
if !filepath.IsAbs(filePath) {
195+
if os.Getenv("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH") != "" {
196+
// the plugin is accessing the file
197+
// we'll prepend the value of this env var to the file path
198+
filePath = filepath.Join(os.Getenv("HASURA_PLUGIN_CONNECTOR_CONTEXT_PATH"), filePath)
199+
} else if os.Getenv("HASURA_CONFIGURATION_DIRECTORY") != "" {
200+
// the docker container is accessing the file
201+
filePath = filepath.Join(os.Getenv("HASURA_CONFIGURATION_DIRECTORY"), filePath)
202+
} else {
203+
// since no env var is set, we'll assume that the docker container is accessing the file
204+
// and the file is mounted to the /etc/connector/ directory, according to the spec:
205+
// https://github.com/hasura/ndc-hub/blob/a764938e13fa3cc719745edaff73b584a936e3ef/rfcs/0000-deployment.md?plain=1#L23
206+
filePath = filepath.Join("/etc/connector/", filePath)
207+
}
206208
}
207209

208210
if !FileExists(filePath) {

0 commit comments

Comments
 (0)