hassio-addon-rclone/rclone/rootfs/etc/services.d/web/run

29 lines
826 B
Plaintext
Raw Normal View History

2021-06-14 21:48:31 +00:00
#! /usr/bin/with-contenv bashio
bashio::log.info "Starting rclone web..."
# Configure tls
if bashio::config.true 'tls.ssl'; then
2023-12-07 17:12:19 +00:00
bashio::config.require.ssl 'tls' 'tls.certfile' 'tls.keyfile'
rclone_flags=(\
"--rc-cert" "/ssl/$(bashio::config 'tls.certfile')" \
"--rc-key" "/ssl/$(bashio::config 'tls.keyfile')" \
)
fi
2023-12-07 17:12:19 +00:00
# Optionally set a user and pass
if bashio::config.has_value 'credentials.username' && bashio::config.has_value 'credentials.password'; then
rclone_flags+=("--rc-user" "$(bashio::config 'credentials.username')")
rclone_flags+=("--rc-pass" "$(bashio::config 'credentials.password')")
else
rclone_flags+=("--rc-no-auth")
fi
2021-06-14 21:48:31 +00:00
exec rclone rcd \
--rc-web-gui \
--rc-serve \
--rc-addr :5572 \
--rc-web-gui-update \
--rc-web-gui-no-open-browser \
2023-12-07 17:12:19 +00:00
"${rclone_flags[@]}"