How To Not to Use Auto Config using Golang

Hi,
When we do code like this :

package main

import (
	"log"

	_ "github.com/rclone/rclone/backend/drive"
	_ "github.com/rclone/rclone/backend/local"
	"github.com/rclone/rclone/fs/config"
	"github.com/rclone/rclone/fs/rc"
)

func main() {
	config.ConfigPath = "/home/henrio/.myconfig"
	out := rc.Params{}
	err := config.CreateRemote("henriotest3", "drive", out, false, false)
	if err != nil {
		log.Fatal(err.Error())
	}
}

Either Using empty rc.Params{}, out["env_auth"] = true or out["env_auth"] = false,
it still linked to local auth like this. What we want is to not use auto config. so it can worked on headless machine. right now still like this one:

If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=secret
Log in and authorize rclone for access
Waiting for code...

Check the docs for rclone config create

https://rclone.org/commands/rclone_config_create/

It tells you how to answer the config questions there

1 Like

Hi,

Thanks. I looked at the link and it worked when I tested

1 Like

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