clitools icon indicating copy to clipboard operation
clitools copied to clipboard

Separat file for clisync credentials

Open hirnschmalz opened this issue 9 years ago • 5 comments

I really love the ct sync script! We always try to NOT save credentials in our Git repositories for security reasons. So it a would be great if it would be possible to store credentials in a separat file (e.g. clisync-credentials.yml) and put this file in the .gitignore

hirnschmalz avatar Aug 24 '16 12:08 hirnschmalz

Why don't you use ssh keys for logging into the remote server?

kitzberger avatar Sep 14 '16 18:09 kitzberger

I do use SSH keys for authentication. It's the database credentials which I'm talking about.

hirnschmalz avatar Sep 15 '16 05:09 hirnschmalz

Just put em into the .my.cnf file ;-)

kitzberger avatar Sep 15 '16 08:09 kitzberger

@Kitzberger Are there already any possibilities to save db credentials for clisync.yml not in the file direct? If yes, could you tell me how you're doing this? We should add those information to our documentation

josefglatz avatar Oct 31 '16 18:10 josefglatz

@josefglatz, since the user we're using to log onto the remote machine has got read access to the DB credentials in most cases anyway (for e.g. TYPO3 they're within LocalConfiguration.php), we'll simply put the DB credentials in the remote users home dir into the file .my.cnf:

[client]
user=typo3
password=secret_password
[mysql]
database=typo3_db

mysqldump does not like the database value to be specified in this file, so we're on specifying here for mysql. For this ct sync scenario it's not necessary at all (since the database mapping local_db:remote_db is mandatory in clisync.yml), but it's nice to just log on to the remote server via ssh, call mysql and jump right into the correct database without knowing shit.

Other db settings are possible, see http://dev.mysql.com/doc/refman/5.7/en/option-files.html for further information.

kitzberger avatar Nov 01 '16 06:11 kitzberger