aboutsummaryrefslogtreecommitdiff
path: root/script/dev-env-duck.sh
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-05-15 10:24:20 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-05-15 10:24:20 +0200
commitc8aa1eb481c18b1a35ef45d37071ab1af804a382 (patch)
tree182cf2118eb4ba6fda104f15bc7336b8cdc1fcfa /script/dev-env-duck.sh
parent5fdabf3e75ba16b5ceed99edb1912cb001765d03 (diff)
downloadgarage-c8aa1eb481c18b1a35ef45d37071ab1af804a382.tar.gz
garage-c8aa1eb481c18b1a35ef45d37071ab1af804a382.zip
Add preliminary support for Duckfeature/duck
Diffstat (limited to 'script/dev-env-duck.sh')
-rw-r--r--script/dev-env-duck.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/script/dev-env-duck.sh b/script/dev-env-duck.sh
new file mode 100644
index 00000000..f9d96021
--- /dev/null
+++ b/script/dev-env-duck.sh
@@ -0,0 +1,52 @@
+mkdir -p /tmp/garage.cyberduck.home/.duck/profiles
+
+DUCK_ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f1`
+DUCK_SECRET_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2`
+
+cat > /tmp/garage.cyberduck.home/.duck/credentials <<EOF
+https\://$DUCK_ACCESS_KEY@127.0.0.1\:4443=$DUCK_SECRET_KEY
+EOF
+
+cat > /tmp/garage.cyberduck.home/.duck/profiles/garage.cyberduckprofile <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>Protocol</key>
+ <string>s3</string>
+ <key>Vendor</key>
+ <string>garage</string>
+ <key>Scheme</key>
+ <string>https</string>
+ <key>Description</key>
+ <string>GarageS3</string>
+ <key>Default Hostname</key>
+ <string>127.0.0.1</string>
+ <key>Default Port</key>
+ <string>4443</string>
+ <key>Hostname Configurable</key>
+ <false/>
+ <key>Port Configurable</key>
+ <false/>
+ <key>Username Configurable</key>
+ <true/>
+ <key>Username Placeholder</key>
+ <string>Access Key ID (GK...)</string>
+ <key>Password Placeholder</key>
+ <string>Secret Key</string>
+ <key>Properties</key>
+ <array>
+ <string>s3service.disable-dns-buckets=true</string>
+ </array>
+ <key>Region</key>
+ <string>garage</string>
+ <key>Regions</key>
+ <array>
+ <string>garage</string>
+ </array>
+ </dict>
+</plist>
+EOF
+
+function duck { HOME=/tmp/garage.cyberduck.home/ command duck --username $DUCK_ACCESS_KEY $@ ; }
+