Commit 6e372320 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added bucket config

parent ae1aca86
...@@ -9,5 +9,6 @@ config s3 'credentials' ...@@ -9,5 +9,6 @@ config s3 'credentials'
option uri '' option uri ''
option accesskey '' option accesskey ''
option secretkey '' option secretkey ''
option bucket ''
endef endef
export S3_CONFIG export S3_CONFIG
...@@ -18,6 +18,7 @@ entry_execute_method_root_S3() { ...@@ -18,6 +18,7 @@ entry_execute_method_root_S3() {
common_execute_method_param "$DMROOT.S3.URI" "1" "s3_get_uri" "s3_set_uri" common_execute_method_param "$DMROOT.S3.URI" "1" "s3_get_uri" "s3_set_uri"
common_execute_method_param "$DMROOT.S3.AccessKey" "1" "s3_get_accesskey" "s3_set_accesskey" common_execute_method_param "$DMROOT.S3.AccessKey" "1" "s3_get_accesskey" "s3_set_accesskey"
common_execute_method_param "$DMROOT.S3.SecretKey" "1" "" "s3_set_secretkey" common_execute_method_param "$DMROOT.S3.SecretKey" "1" "" "s3_set_secretkey"
common_execute_method_param "$DMROOT.S3.Bucket" "1" "s3_get_bucket" "s3_set_bucket"
return 0; return 0;
;; ;;
esac esac
...@@ -62,3 +63,17 @@ s3_set_secretkey() { ...@@ -62,3 +63,17 @@ s3_set_secretkey() {
chmod a+r /etc/config/s3 chmod a+r /etc/config/s3
fi fi
} }
s3_get_bucket() {
echo `$UCI_GET s3.credentials.bucket`
}
s3_set_bucket() {
local bucket=`$UCI_GET s3.credentials.bucket`
if [ "$bucket" != "$1" ]; then
$UCI_SET s3.credentials.bucket="$1"
$UCI_COMMIT
chmod a+r /etc/config/s3
fi
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment