Git-Auto-Deploy icon indicating copy to clipboard operation
Git-Auto-Deploy copied to clipboard

Deploy as another user

Open TheAifam5 opened this issue 8 years ago • 3 comments

Hey its possible to add feature where is possible to define a username? For example: You have a http server which using "http" user and gitlab server which using "gitlab" user. Gitlab deploying to the http server using http user (/srv/http/xxx.com/).

Regards, TheAifam5

TheAifam5 avatar Jan 28 '17 18:01 TheAifam5

This is a really important feature. Its running as root and is the main failure about security when running an app.

Ronaldo

rrigoni avatar Mar 02 '17 23:03 rrigoni

Hi.

There is two ways which worked for me to run deploy script from another user:

First way Run with command sudo -H -u <insert your user here> bash -c '<insert your deploy command here>'

Worked only if GAD running as root. That`s why righter way is the second: Second way

  1. Create ssh keys for authentication without password to localhost with your user
  2. Add localhost with key and user to GAD user ssh config (/etc/git-auto-deploy/.ssh/config)
  3. Run with command ssh <hostname from ssh config> '<insert your deploy command here>'

levabd avatar Mar 03 '17 05:03 levabd

Actually you can also use supervisord to run it as different user and you can restart it easily and all.

Letme avatar Mar 03 '17 07:03 Letme