Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: adding warning to user that rclone config is not encrypted by default. fixes #7314 #7793

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KDreynolds
Copy link
Contributor

@KDreynolds KDreynolds commented Apr 22, 2024

What is the purpose of this change?

adds a simple warning message to create new config flow so users know default behavior is to use unencrypted config files.

Was the change discussed in an issue or in the forum before?

issue #7314

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@KDreynolds
Copy link
Contributor Author

not sure if this is how we would want to do this or if this is still needed, but i took a crack at it.

Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for having a go at this.

I put some suggestions inline.

We need to be careful not to break scripting of the rclone config commands here.

return err
}

// Append the security warning about unencrypted configurations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably only show this message if the config isn't encrypted then we can make a definitive statement "your config is not encrypted..."

To do that we need to export the encrypted state from fs/config/crypt.go something like this (untested)

func IsEncrypted() bool {
    return len(configKey) != 0

I think also that this should be printed to Stderr like the rest of the config stuff, and I'd probably hard wrap it to 80 chars.

}

// Append the security warning about unencrypted configurations
fmt.Fprintln(os.Stderr, "\nWARNING: By default, rclone configuration files are not encrypted, which may pose a security risk. It is highly recommended to encrypt your configuration file to protect sensitive information. For details on how to encrypt your configuration, visit https://rclone.org/docs/#configuration-encryption.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably only be on plain rclone config (which is configCommand above) not here which is rclone config create which is often used by scripts and we don't want to print extra stuff here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants