Rclone supports download Web GUI manually or full file with Web GUI

Sometime the network is not ok.

Run command

./rclone.exe rcd --rc-web-gui

get

2020/11/05 22:35:25 Error while fetching the latest release of Web GUI: failed getting latest release of rclone-webui: Get "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest": net/http: TLS handshake timeout

Can one download those file manually?

Or is there a release contain Web GUI content, then the download doesn't need?


What is your current rclone version (output from rclone version)?

v1.53.2

What problem are you are trying to solve?

Find the source code

There is a function CheckAndDownloadWebGUIRelease,It seem like that GetLatestReleaseURL always will be run?

How do you think rclone should be changed to solve that?

  1. Support more information in
2020/11/05 22:35:25 Error while fetching the latest release of Web GUI: failed getting latest release of rclone-webui: Get "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest": net/http: TLS handshake timeout

Tell user he/she can download the file manully to directory xxx

  1. Support a rclone release with Web GUI embeddly

I don't think this is a fatal error is it?

The GUI can be downloaded manually from https://github.com/rclone/rclone-webui-react/releases

Nice idea... I guess it might make rclone quite big

The GUI can be downloaded manually from https://github.com/rclone/rclone-webui-react/releases

Thanks!

But there is still a question. i.e After download currentbuild.zip from releases, which path it should be.

When someone downloads gui releases manually, he/she doesn't know where to put it.

It is possible to show some prompt?Like follow

./rclone.exe rcd --rc-web-gui
Try to download xxx from url https://api.github.com/repos/rclone/rclone-webui-react/releases/latest
Or you can download it manually, and rename it to path ~/path/to/web/gui/zip/cache

The zip file needs to be unpacked into the cache directory which is typically ~/.cache/rclone/wegui/current

On windows. It works on directory ~\AppData\Local\rclone\webgui\current\build

i.e the file index.html in xxx.zip which download from https://github.com/rclone/rclone-webui-react/releases, should be path ~\AppData\Local\rclone\webgui\current\build\index.html.

Here is the situation.

$ ./rclone.exe rcd --rc-web-gui --rc-user admin --rc-pass admin
2020/11/18 09:11:18 NOTICE: Web GUI exists. Update skipped.
2020/11/18 09:11:18 NOTICE: Serving Web GUI
2020/11/18 09:11:18 NOTICE: Serving remote control on http://127.0.0.1:5572/

Rclone use cache file instead of download zip file.

Thanks.

Check the source code.

The code of log in
fs.Logf(nil, "Web GUI exists. Update skipped.")

When condition
!extractPathExist || checkUpdate || forceUpdate
fail, rclone skip download.

From func CheckAndDownloadWebGUIRelease

	cachePath := filepath.Join(cacheDir, "webgui")
	tagPath := filepath.Join(cachePath, "tag")
	extractPath := filepath.Join(cachePath, "current")

	extractPathExist, extractPathStat, err := exists(extractPath)

we know the cache path is extractPath, i.e cacheDir/webgui/current.

About cacheDir, it inits in CacheDir = makeCacheDir()

From func makeCacheDir

// makeCacheDir returns a directory to use for caching.
//
// Code borrowed from go stdlib until it is made public
func makeCacheDir() (dir string) {
	// Compute default location.
	switch runtime.GOOS {
	case "windows":
		dir = os.Getenv("LocalAppData")

	case "darwin":
		dir = os.Getenv("HOME")
		if dir != "" {
			dir += "/Library/Caches"
		}

	case "plan9":
		dir = os.Getenv("home")
		if dir != "" {
			// Plan 9 has no established per-user cache directory,
			// but $home/lib/xyz is the usual equivalent of $HOME/.xyz on Unix.
			dir += "/lib/cache"
		}

	default: // Unix
		// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
		dir = os.Getenv("XDG_CACHE_HOME")
		if dir == "" {
			dir = os.Getenv("HOME")
			if dir != "" {
				dir += "/.cache"
			}
		}
	}

	// if no dir found then use TempDir - we will have a cachedir!
	if dir == "" {
		dir = os.TempDir()
	}
	return filepath.Join(dir, "rclone")
}

We know cacheDir from environment LocalAppData on windows.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.