jcwillox / hassio-rclone-backup

Home Assistant addon to automatically sync backups to remote locations using Rclone
MIT License
115 stars 19 forks source link

Using S3/Minio from rclone, cannot use https endpoint from UI #23

Open zaggash opened 1 year ago

zaggash commented 1 year ago

The problem

I tried to setup my Minio server and I ran into an issue with the WebUI. I can't make it work with my S3 https endpoint. I can't list the files from the "Explorer"

The logs keep saying : error listing: RequestError: send request failed caused by: Get "https://<mydns>:9000/": x509: certificate signed by unknown authority 2022/10/12 00:02:23 ERROR : rc: "operations/list": error: error in ListJSON: RequestError: send request failed I added the following to my job config.

flags:
    no-check-certificate: true

I tried with extra_flags, with no success.

However, the jobs are working. If run the job with run_once, I can make the connection and it syncs just fine.

What version of Rclone Backup has the issue?

Add-on version: 3.0.0

What version of Home Assistant are you running?

Home Assistant Core: 2022.10.3

What type of installation are you running?

Home Assistant OS

If you're running HA OS/Supervised, what version of the Supervisor are you running?

Supervisor: 2022.10.0

Example YAML snippet

- name: Sync Backups
  command: sync
  schedule: 10 5 * * *
  sources:
    - /backup
  destination: minio:hassio-backup
  flags:
    no-check-certificate: true

Anything in the logs that might be useful for us?

[23:59:59] INFO: Starting Scheduler...
[2022-10-11] [23:59:59] [INFO]: rclone config found
[2022-10-11] [23:59:59] [INFO]: checking job configs...
[2022-10-11] [23:59:59] [INFO]: scheduled jobs:
10 5 * * * sync "Sync Backups"; /backup -> minio:hassio-backup
2022/10/11 23:59:59 NOTICE: Serving files from "/usr/share/rclone-webui-react"
2022/10/11 23:59:59 NOTICE: Serving remote control on http://[::]:8099/
2022/10/11 23:59:59 NOTICE: Web GUI is not automatically opening browser. Navigate to http://[::]:8099/ to use.
2022/10/12 00:02:23 ERROR : : error listing: RequestError: send request failed
caused by: Get "https://<mydns>:9000/": x509: certificate signed by unknown authority
2022/10/12 00:02:23 ERROR : rc: "operations/list": error: error in ListJSON: RequestError: send request failed
caused by: Get "https://<mydns>:9000/": x509: certificate signed by unknown authority

Additional information

rclone --config /config/rclone.conf ls minio:/hassio-config is working directly on the container as well.

Just the UI is not working correctly.

jcwillox commented 1 year ago

The flags and extra_flags sections only effect jobs and have no effect on the rclone webui. It's mainly for configuring remotes rather than interacting with them at the moment.

You may be able to include no-check-certificate in your rclone remote config instead and that might fix your issue.

zaggash commented 1 year ago

I'm not sure this option is available in the rclone.conf remote configuration.

It is a CLI option, a global flag to be precise.

https://github.com/rclone/rclone/issues/468#issuecomment-740702722

jcwillox commented 1 year ago

Hmm yeah so putting it in the config doesn't work yet. Do you want to check if that flag would actually work when running the rclone gui?

If it does I can add an additional config option to set flags specifically for the webui.

zaggash commented 1 year ago

I tried to edit the s6 service from the container. However, I'm not able to restart the service when it's changed.

I'll have to rebuild it unless I can run 2 WebUI at the same time which I didn't test.

jcwillox commented 1 year ago

You can just run it on your computer, just install rclone and run rclone rcd --rc-web-gui --no-check-certificate from your terminal, it should be the same as if it were inside the container.

zaggash commented 1 year ago

Sorry I've been slacking. I did the test on my workstation and it is working with or without --no-check-certificate I can list the remote with the same config I use on the container.

rclone --version
rclone v1.60.1
- os/version: arch "rolling" (64 bit)
- os/kernel: 6.0.9-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.3
- go/linking: dynamic
- go/tags: none

Edit: Same Rclone on 1.59.2 is working as well. Something is happening on the container.

EDIT: Brain fart, my workstation had the custom certificate installed. Same error occurs without the certificate.

Adding the --no-check-certificate flag fix the issue

jcwillox commented 1 year ago

All good, same here 😄

I'll convert this to a feature request to add the ability to specify flags for the rclone webui.