2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 03:11:24 +00:00

Update garage setup to use existing key, use garage 0.9 for testing, add minio-client to nix

This commit is contained in:
asonix 2023-12-16 17:39:42 -06:00
parent bd0b89b165
commit 3c6d676e51
3 changed files with 57 additions and 22 deletions

View file

@ -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"

View file

@ -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 <<EOF
[server]
address = '0.0.0.0:8080'
worker_id = 'pict-rs-1'
api_key = 'api-key'
max_file_count = 10
[tracing.logging]
format = 'normal'
targets = 'warn,tracing_actix_web=info,actix_server=info,actix_web=info'
targets = 'info'
[tracing.console]
buffer_capacity = 102400
[tracing.opentelemetry]
url = 'http://jaeger:4317'
service_name = 'pict-rs'
targets = 'info'
targets = 'info,pict_rs=debug'
[old_db]
path = '/mnt'
[metrics]
prometheus_address = "127.0.0.1:8070"
[media]
max_width = 10000
max_height = 10000
max_area = 40000000
max_file_size = 40
enable_silent_video = true
enable_full_video = true
video_codec = "vp9"
filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail']
skip_validate_imports = false
[media.image]
format = "webp"
[media.image.quality]
avif = 50
png = 50
jpeg = 75
jxl = 50
webp = 60
[media.animation]
max_width = 2000
max_height = 2000
max_area = 2000000
format = "webp"
[media.animation.quality]
apng = 50
avif = 50
webp = 60
[media.video]
enable = true
allow_audio = true
max_area = 884000000
video_codec = "vp9"
[media.video.quality]
crf_240 = 37
crf_360 = 36
crf_480 = 33
crf_720 = 32
crf_1080 = 31
crf_1440 = 24
crf_2160 = 15
crf_max = 12
[repo]
type = 'sled'
path = '/mnt/sled-repo-garage'
cache_capacity = 67108864
type = 'postgres'
url = 'postgres://pictrs:1234@localhost:5432/pictrs'
[store]
type = 'object_storage'
@ -62,6 +96,6 @@ endpoint = 'http://garage:3900'
use_path_style = true
bucket_name = 'pict-rs'
region = 'garage'
access_key = '${key_id}'
secret_key = '${secret_key}'
access_key = '${KEY_ID}'
secret_key = '${SECRET_KEY}'
EOF

View file

@ -38,6 +38,7 @@
garage
gcc
imagemagick
minio-client
rust-analyzer
rustc
rustfmt