Search code examples
phpgitgithubwindows-server-2003

Git autodeploy on Windows 2003 with WAMP


I work for a company that for some reason uses a Windows 2003 server with WAMP for its live product (please don't ask me why). Currently we have to push updates locally to github, manually connect to this production server with Remote Desktop Connection and pull.

We want to automate this proccess.

I have tried github webhooks with no success -> Couldn't find a way to create SSH keys for the system account (NT AUTHORITY/SYSTEM), which is the one used by apache on that server solution. The project is currently cloned via HTTPS, so we could also try saving credentials globally so that git won't prompt the local system account for password when trying to pull via PHP, but that seems like the worst possible solution security-wise.

Any ideas?

-- UPDATE --

We've decided not to worry about security implications right now. I then followed all the steps to save credentials for a new read-only user, but no success. I can see a .git-credentials file with the correct user/pass/url in:

C:\WINDOWS\system32\config\systemprofile

All commands work (via browser) except for pull, fetch, etc.

Any more ideas?

-- UPDATE 2 --

I've now changed the wampapache service to run as an administrator account instead, which also has credentials stored on its "root" folder (~). It's the same account I can push/pull via cmd without user/pass prompts. But when I try via browser... No luck.

I'm now officially out of ideas.


Solution

  • I have finally found a solution!

    Simply editting the git config file to add user:password to the url parameter under [remote "origin"] has done the job.

    url = https://user:[email protected]/organization/project.git