Deploy as another user
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
This is a really important feature. Its running as root and is the main failure about security when running an app.
Ronaldo
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
- Create ssh keys for authentication without password to localhost with your user
- Add localhost with key and user to GAD user ssh config (/etc/git-auto-deploy/.ssh/config)
- Run with command
ssh <hostname from ssh config> '<insert your deploy command here>'
Actually you can also use supervisord to run it as different user and you can restart it easily and all.