Skip to content

Commit

Permalink
fix: update docker config for key transform and region endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmalec committed Apr 12, 2024
1 parent ec7da06 commit 4a1aba1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions docker/001-config.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#!/bin/sh
set -ex

echo "IPFS PATH: ${IPFS_PATH}"
echo "IPFS Path: ${IPFS_PATH}"

# We backup old config file
# backup old config file
cp ${IPFS_PATH}/config ${IPFS_PATH}/config_bak

# We inject the S3 plugin datastore
# Important: Make sure your fill out the optionnal parameters $CLUSTER_S3_BUCKET, $CLUSTER_AWS_KEY, $CLUSTER_AWS_SECRET in the cloudformation parameters
# inject the S3 plugin datastore
cat ${IPFS_PATH}/config_bak | \
jq ".Datastore.Spec = {
mounts: [
{
child: {
type: \"s3ds\",
region: \"${AWS_REGION}\",
bucket: \"${CLUSTER_S3_BUCKET}\",
region: \"${BUCKET_REGION}\",
bucket: \"${BUCKET}\",
rootDirectory: \"${CLUSTER_PEERNAME}\",
accessKey: \"${CLUSTER_AWS_KEY}\",
secretKey: \"${CLUSTER_AWS_SECRET}\"
accessKey: \"${BUCKET_ACCESS_KEY}\",
secretKey: \"${BUCKET_SECRET_KEY}\",
regionEndpoint: \"${BUCKET_ENDPOINT}\",
keyTransform: \"${KEY_TRANSFORM}\"
},
mountpoint: \"/blocks\",
prefix: \"s3.datastore\",
Expand All @@ -38,5 +39,5 @@ jq ".Datastore.Spec = {
type: \"mount\"
}" > ${IPFS_PATH}/config

# We override the ${IPFS_PATH}/datastore_spec file
echo "{\"mounts\":[{\"bucket\":\"${CLUSTER_S3_BUCKET}\",\"mountpoint\":\"/blocks\",\"region\":\"${AWS_REGION}\",\"rootDirectory\":\"${CLUSTER_PEERNAME}\"},{\"mountpoint\":\"/\",\"path\":\"datastore\",\"type\":\"levelds\"}],\"type\":\"mount\"}" > ${IPFS_PATH}/datastore_spec
# override the ${IPFS_PATH}/datastore_spec file
echo "{\"mounts\":[{\"bucket\":\"${BUCKET}\",\"mountpoint\":\"/blocks\",\"region\":\"${BUCKET_REGION}\",\"rootDirectory\":\"${CLUSTER_PEERNAME}\"},{\"mountpoint\":\"/\",\"path\":\"datastore\",\"type\":\"levelds\"}],\"type\":\"mount\"}" > ${IPFS_PATH}/datastore_spec

0 comments on commit 4a1aba1

Please sign in to comment.