ruby on rails - Authenticating Heroku gem from rake task -
i trying automatic backup script work. using heroku gem. script being run heroku's scheduler addon.
require "heroku/command/pg" require "heroku/command/pg_backups" .... def initialize @client = heroku::command::pg.new([], app: env['app_name']) end ... attachment = @client.send(:generate_resolver) ... as call attachment = @client.send(:generate_resolver), scripts stops execution , ask for
enter heroku credentials. email: is there way avoid this, given task being initiated within heroku anyway , therefore should authenticated.
any appreciated
for non-interactive login, need use api key, heroku will read heroku_api_key environment variable. can fetch key account logged-in cli using heroku auth:token.
there's no way avoid authentication because you're running inside heroku already. have significant inter-app security implications.
also check out pgbackups-archive. looks you're after, or @ least might have useful techniques you.
Comments
Post a Comment