hassio-addon-rclone/rclone/rootfs/etc/services.d/web/run
2023-12-07 09:13:45 -08:00

29 lines
826 B
Plaintext
Executable File

#! /usr/bin/with-contenv bashio
bashio::log.info "Starting rclone web..."
# Configure tls
if bashio::config.true 'tls.ssl'; then
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
# 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
exec rclone rcd \
--rc-web-gui \
--rc-serve \
--rc-addr :5572 \
--rc-web-gui-update \
--rc-web-gui-no-open-browser \
"${rclone_flags[@]}"