Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with htsget #48

Merged
merged 12 commits into from
Apr 17, 2024
12 changes: 11 additions & 1 deletion config/config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ oidc:
trusted:
iss: "/iss.json"

grpc:
host: "reencrypt"
port: 50443
cacert: "/shared/cert/ca.crt"
serverkey: "/shared/cert/server.key"
servercert: "/shared/cert/server.crt"
clientkey: "/shared/cert/client.key"
clientcert: "/shared/cert/client.crt"
timeout: 5

schema:
type: isolated

Expand All @@ -73,4 +83,4 @@ session:
httponly: true
# name of session cookie
# default value = sda_session_key
name: "sda_session_key"
name: "sda_session_key"
20 changes: 19 additions & 1 deletion docker-compose-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,25 @@ services:
environment:
- SERVER_JWTPUBKEYURL=https://oidc:8080/jwk
volumes:
- cacert:/etc/ssl/certs/
- cacert:/etc/ssl/certs/


reencrypt:
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
command: [sda-reencrypt]
container_name: reencrypt
depends_on:
credentials:
condition: service_completed_successfully
restart: always
networks:
- secure
volumes:
- ${CONFIG_FILEPATH}:/config.yaml
- ${ISS_FILEPATH}:/iss.json
- shared:/shared
- cacert:/cacert


volumes:
cacert:
Expand Down
19 changes: 10 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:

auth:
container_name: auth
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94-auth
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25-auth
depends_on:
credentials:
condition: service_completed_successfully
Expand Down Expand Up @@ -63,7 +63,7 @@ services:
interval: 5s
timeout: 20s
retries: 20
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94-rabbitmq
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25-rabbitmq
networks:
- secure
ports:
Expand All @@ -87,7 +87,7 @@ services:
interval: 5s
timeout: 20s
retries: 20
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94-postgres
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25-postgres
networks:
- secure
restart: always
Expand Down Expand Up @@ -137,9 +137,10 @@ services:
- DB_PASSWORD=${download_DB_PASSWORD}
- DB_USER=${download_DB_USER}
- OIDC_CONFIGURATION_URL=http://${DOCKERHOST:-dockerhost}:8080/oidc/.well-known/openid-configuration
- ARCHIVE_TYPE=s3seekable
extra_hosts:
- ${DOCKERHOST:-dockerhost}:host-gateway
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94-download
image: harbor.nbis.se/gdi/sda-download:20240415
networks:
- public
- secure
Expand Down Expand Up @@ -170,7 +171,7 @@ services:
- BROKER_USER=${finalize_BROKER_USER}
- DB_PASSWORD=${finalize_DB_PASSWORD}
- DB_USER=${finalize_DB_USER}
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
networks:
- secure
restart: always
Expand All @@ -196,7 +197,7 @@ services:
- BROKER_USER=${ingest_BROKER_USER}
- DB_PASSWORD=${ingest_DB_PASSWORD}
- DB_USER=${ingest_DB_USER}
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
networks:
- secure
restart: always
Expand All @@ -222,7 +223,7 @@ services:
- BROKER_USER=${mapper_BROKER_USER}
- DB_PASSWORD=${mapper_DB_PASSWORD}
- DB_USER=${mapper_DB_USER}
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
networks:
- secure
restart: always
Expand All @@ -248,7 +249,7 @@ services:
- BROKER_USER=${verify_BROKER_USER}
- DB_PASSWORD=${verify_DB_PASSWORD}
- DB_USER=${verify_DB_USER}
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
networks:
- secure
restart: always
Expand Down Expand Up @@ -277,7 +278,7 @@ services:
- SERVER_JWTPUBKEYURL=http://${DOCKERHOST:-dockerhost}:8080/oidc/jwk
extra_hosts:
- ${DOCKERHOST:-dockerhost}:host-gateway
image: ghcr.io/neicnordic/sensitive-data-archive:v0.2.94
image: ghcr.io/neicnordic/sensitive-data-archive:v0.3.25
networks:
- public
- secure
Expand Down
3 changes: 3 additions & 0 deletions scripts/certs/make_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ chmod 640 auth.key
chown 0:65534 client.*
chmod 640 client.*

chown 0:65534 server.*
chmod 640 server.*

cp ca.crt /cacert/ca-certificates.crt
2 changes: 1 addition & 1 deletion scripts/certs/ssl.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth, serverAuth
subjectAltName = DNS:localhost,DNS:dockerhost,DNS:mq,DNS:db,DNS:doa,DNS:download,DNS:server,DNS:oidc,IP:127.0.0.1
subjectAltName = DNS:localhost,DNS:dockerhost,DNS:mq,DNS:db,DNS:doa,DNS:download,DNS:server,DNS:oidc,DNS:reencrypt,IP:127.0.0.1

[ crl_ext ]
# Extension for CRLs (`man x509v3_config`).
Expand Down
10 changes: 2 additions & 8 deletions scripts/load_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ apk -q --no-cache add curl jq

pip -q install s3cmd

FILES="NA12878.bam NA12878.bai NA12878_20k_b37.bam NA12878_20k_b37.bai"
FILES="htsnexus_test_NA12878.bam htsnexus_test_NA12878.bam.bai htsnexus_test_NA12878.bam.blocks.yaml htsnexus_test_NA12878.bam.gzi"
for file in ${FILES}; do
curl -s -L -o "$file" "https://github.com/ga4gh/htsget-refserver/raw/main/data/gcp/gatk-test-data/wgs_bam/$file"
curl -s -L -o "$file" "https://github.com/umccr/htsget-rs/raw/main/data/bam/$file"

case $file in (*.bai)
newname="$(basename "$file" .bai).bam.bai"
mv "$file" "$newname"
file="$newname"
;;
esac

yes | /shared/crypt4gh encrypt -p /shared/c4gh.pub.pem -f "$file"
ENC_SHA=$(sha256sum "$file.c4gh" | cut -d' ' -f 1)
Expand Down
3 changes: 2 additions & 1 deletion scripts/make_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for n in download finalize inbox ingest mapper sync verify; do
curl -s -u test:test -X PUT "http://rabbitmq:15672/api/users/$n" -H "content-type:application/json" -d "${body_data}"
curl -s -u test:test -X PUT "http://rabbitmq:15672/api/permissions/sda/$n" -H "content-type:application/json" -d '{"configure":"","write":"sda","read":".*"}'

## password and permissions for DB

psql -U postgres -h postgres -d sda -c "ALTER ROLE $n LOGIN PASSWORD '$n';"
done

Expand Down Expand Up @@ -57,3 +57,4 @@ fi

## create TLS certificates
bash /scripts/certs/make_certs.sh