From 3c6d676e511bba8cf5fd7e2f247a775a124f3507 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 16 Dec 2023 17:39:42 -0600 Subject: [PATCH] Update garage setup to use existing key, use garage 0.9 for testing, add minio-client to nix --- docker/object-storage/docker-compose.yml | 2 +- docker/object-storage/setup-garage.sh | 76 +++++++++++++++++------- flake.nix | 1 + 3 files changed, 57 insertions(+), 22 deletions(-) diff --git a/docker/object-storage/docker-compose.yml b/docker/object-storage/docker-compose.yml index 3a028a9..9dfa7c6 100644 --- a/docker/object-storage/docker-compose.yml +++ b/docker/object-storage/docker-compose.yml @@ -39,7 +39,7 @@ services: - ./storage/minio:/mnt garage: - image: dxflrs/garage:v0.8.3 + image: dxflrs/garage:v0.9.0 ports: - "3900:3900" - "3901:3901" diff --git a/docker/object-storage/setup-garage.sh b/docker/object-storage/setup-garage.sh index 43f7bb0..2410682 100755 --- a/docker/object-storage/setup-garage.sh +++ b/docker/object-storage/setup-garage.sh @@ -7,16 +7,19 @@ touch "${STDOUT}" touch "${STDERR}" rm "${STDOUT}" "${STDERR}" +KEY_ID='GK2182acf19c2bdb8b9c20e16e' +SECRET_KEY='0072105b8659adc02cce21d9135a88ebc279b3a35e170d23d31c63fb9307a168' + node_id=$(garage -c garage-local.toml status 2>>"${STDERR}" | tail -n 1 | awk '{ print $1 }') -garage -c garage-local.toml layout assign -z dc1 -c 1 "${node_id}" >>"${STDOUT}" 2>>"${STDERR}" +garage -c garage-local.toml layout assign -z dc1 -c 50GB "${node_id}" >>"${STDOUT}" 2>>"${STDERR}" garage -c garage-local.toml layout apply --version 1 >>"${STDOUT}" 2>>"${STDERR}" garage -c garage-local.toml bucket create pict-rs >>"${STDOUT}" 2>>"${STDERR}" -garage -c garage-local.toml key new --name pict-rs-key >>"${STDOUT}" 2>>"${STDERR}" -key_id=$(garage -c garage-local.toml key info pict-rs-key 2>>"${STDERR}" | grep "Key ID" | awk '{ print $3 }') -secret_key=$(garage -c garage-local.toml key info pict-rs-key 2>>"${STDERR}" | grep "Secret key" | awk '{ print $3 }') +garage -c garage-local.toml key import \ + -n pict-rs-key --yes "${KEY_ID}" "${SECRET_KEY}" \ + >> "${STDOUT}" 2>> "${STDERR}" garage -c garage-local.toml bucket allow --read --write --owner pict-rs --key pict-rs-key >>"${STDOUT}" 2>>"${STDERR}" garage -c garage-local.toml bucket website pict-rs --allow >> "${STDOUT}" 2>>"${STDERR}" @@ -24,37 +27,68 @@ garage -c garage-local.toml bucket website pict-rs --allow >> "${STDOUT}" 2>>"${ cat > pict-rs-garage.toml <