Create repo with Diffusion API

Hi, i’d made little web page my users to create remotly repos in Phabricator and connect them with Mercurial server with URL in observe mode just with the name of their repository.
Useing that example https://secure.phabricator.com/book/phabricator/article/diffusion_api/ & cURL with credentials token of admin user (not local in OS user, nor root)
Today I’ve spotted that owner of repos is root:root and Phabricator can’t update it from URL.
I’ve resolve that trough chown -R www-data:www-data like Apache2 user, but in future how to proceed ?

Make sure both the webserver and the daemons are running at www-data and not as root.
If you have any other script that’s running outside of Phabricator, make sure it’s also running as the right OS user.

You mean user running cURL API script at primary server became owner of repo at destination sever?

You mean user running cURL API script at primary server became owner of repo at destination sever?

no, that doesn’t how it works. When running curl, you’re making an HTTP request, and that does not transmit the user information of the active user.

I mean make sure that anything you run (on the phabricator machine) is running as the right system user.

Correct… I was sure phd is running as www-data. Instead update script is running it as root!