Seth Jackson  committed e5cf5bd

Revert allowing the user to specify the password on the command line.

  • Participants
  • Parent commits 5ad2303

Comments (4)

  1. Trevor Basinger

    Wouldn't it make more sense to have a command line flag to specify what method you want to use?

    For example, say it defaults to "interactive" login but you have the option of using "--password" in the event you want to script with it.

    In my particular case, I am setting up a cron job to backup hourly. Interactive login wouldn't work in this instance.

  2. Seth Jackson author

    The problem with passing a password on the command line is that it will show up in your command history, ~/.bash_history if you have that and if you run it via cron then it will show up in your cron logs. Not good.

    1. Trevor Basinger

      Yeah I agree with that. How about reading an environment variable? That seems about as secure as a config file. Less hassle to code also.

      Also, if you have any goals set or a direction you'd like to see this project move in, I'd like to help you make progress on that.

Files changed (1)

File bin/bitbucket-backup

     opts.on("-u", "--username USERNAME", "Required: Username for account to be backed up") do |username|
         options[:username] = username
-    opts.on("-p", "--password PASSWORD", "Required: Password for account to be backed up") do |password|
-        options[:password] = password
-    end
-if ARGV.empty? || !options[:password] || !options[:username]
+if ARGV.empty? || !options[:username]
     puts parser.banner
+options[:password] = ask("Password: ") do |q|
+    q.echo = false
+[:username], options[:password], ARGV.first, options[:all_repos])