[Tutor] Storing passwords and version control

Joel Goldstick joel.goldstick at gmail.com
Sun May 27 12:21:16 EDT 2018


On Sun, May 27, 2018 at 12:08 PM, Pat Martin <wpmartin at gmail.com> wrote:
> Hello all,
>
> I am writing a script that will be using an API to connect to some systems
> to pull info for a search. Since it will be a script I will be running
> through cron I won't be able to type the password at time of running. I
> also am going to be putting this in source control, using git specifically.
>
> The process I am currently thinking of using is having a separate file with
> the username and password in it and just having that ignored by source
> control. That of course doesn't solve the problem of the password sitting
> in a file on the system unencrypted. Is there a better or more accepted way
> to do this in python?
>
> Thanks
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


You can set environment variables on the system that runs the script.
Then the script reads the environment variables.  This keeps the
secrets out of code anywhere.

On your local machine you can ssh into the target machine and set the
environment as required
-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays


More information about the Tutor mailing list