Browse Source

Added rclone encryption support

expose_links
Drew Short 4 years ago
parent
commit
60827ee90f
  1. 9
      README.md
  2. 6
      assets/common.sh

9
README.md

@ -15,12 +15,16 @@ resource_types:
source:
repository: warricksothr/concourse-rclone-resource
tag: latest
files:
serviceAccountFile: |
...contents...
```
## Source Configuration
* `config`: Required. The rclone config file contents to use.
* `files`: Optional. Additional files to write to the /tmp directory. This is a map of key/value pairs for the filename and contents of that file
* `password`: Optional. Encryption password used for encrypted rclone configurations. Please use secrets management for this value.
* `files`: Optional. Additional files to write to the /tmp directory. This is a map of key/value pairs for the filename and contents of that file.
### Example
@ -37,9 +41,6 @@ resources:
root_folder_id = <Your root folder id>
service_account_file = /tmp/serviceAccountFile
token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}
files:
serviceAccountFile: |
...contents...
```
### Note

6
assets/common.sh

@ -7,6 +7,12 @@ load_config() {
local rclone_config_file=$rclone_config_path/.rclone.conf
(jq -r '.source.config // empty' < "$1") > "$config_path"
config_pass=$('.source.password // ""' < "$1")
if [[ -n "${config_pass}" ]]; then
RCLONE_CONFIG_PASS="${config_pass}"
export RCLONE_CONFIG_PASS
fi
if [ -s "$config_path" ]; then
mkdir -p $rclone_config_path

Loading…
Cancel
Save