Start config validation and ssl

ssl doesn't seem to work right now, so stick to ingress
This commit is contained in:
ViViDboarder 2021-06-14 14:48:40 -07:00
parent e03459a288
commit 100f24ddfd
2 changed files with 16 additions and 3 deletions

View File

@ -2,6 +2,12 @@
bashio::log.info "Configuring rclone..."
bashio::config.require.username 'credentials.username'
bashio::config.require.password 'credentials.password'
bashio::config.suggest.true 'tls.ssl'
bashio::config.require.ssl 'tls' 'tls.certfile' 'tls.keyfile'
sync_command=$(bashio::config 'sync_command')
destination=$(bashio::config 'destination')

View File

@ -2,13 +2,19 @@
bashio::log.info "Starting rclone web..."
# Configure tls
if bashio::config.true 'tls.ssl'; then
ssl_flags=(\
"--rc-cert" "/ssl/$(bashio::config 'tls.certfile')" \
"--rc-key" "/ssl/$(bashio::config 'tls.keyfile')" \
)
fi
# TODO: Something with UN and PASS
# Maybe switch to --rc-no-auth and use proxy
username=$(bashio::config 'credentials.username')
password=$(bashio::config 'credentials.password')
# TODO: Add cert paths here if ssl is true
exec rclone rcd \
--rc-web-gui \
--rc-serve \
@ -16,4 +22,5 @@ exec rclone rcd \
--rc-user "$username" \
--rc-pass "$password" \
--rc-web-gui-update \
--rc-web-gui-no-open-browser
--rc-web-gui-no-open-browser \
"${ssl_flags[@]}"