nk027 / ineq_project

Inequality course project for creation of income inequality profiles of EU countries.
http://shiny.kuschnig.eu/ineq/
MIT License
2 stars 21 forks source link

PostgreSQL credentials verstecken #1

Closed nk027 closed 5 years ago

nk027 commented 5 years ago

Die credentials (bzw. das Passwort) für PostgreSQL sollten nicht auf GitHub öffentlich zugänglich sein und daher auch nicht in Scripts auftauchen. Das könnte man etwa mit einer Umgebungsvariable für das Passwort oder einem Script mit dem Passwort (im .gitignore) verhindern.

nk027 commented 5 years ago

So wie es jetzt aussieht könnte man das pg Objekt ganz selbst in der Kommandozeile erstellen oder nur das Passwort händisch eingeben (wenn das sicher genug ist).

nk027 commented 5 years ago

@stefanhumer Ich würde das in _setup.R so lösen:

password <- readlines(prompt = "Please enter the PostgreSQL password:")

pg <- src_postgres(dbname = "dbname", host = "host", user = "user", password = password, options = "options")

Also mit allen Infos außer dem Passwort im Code. Wäre das okay? (Alternativ auch mit GetPass)

mschnetzer commented 5 years ago

Ich bin eben über das hier gestolpert: https://github.com/r-lib/keyring Hat das Package mal jemand verwendet?

nk027 commented 5 years ago

Sieht interessant aus! Ist aber in dem Fall eher overkill, da die Zugangsdaten sowieso in den learn-Skripten schon als plaintext auftauchen.

Wenn jemand die Passwort-Eingabe umgehen will kann man sich .Rprofile ansehen.