Bibzball / Git-Mediawiki

Gate between git and mediawiki
https://github.com/Bibzball/Git-Mediawiki/wiki
31 stars 4 forks source link

Initial setup seems to fail #7

Closed becatlibra-zz closed 11 years ago

becatlibra-zz commented 11 years ago

I have tried this on two different mediawiki installations. On the first, more important one, it appears to be failing to login:

[2012.12.13]-[benito]-=(darkhouse)=-[pts/18]-[~/wiki.int] [master #] [11:58:17]$ git fetch origin Failed to log in mediawiki user "username" on https://wiki.int.domain.com/ (error 2: 401 Authorization Required : error occurred when accessing https://wiki.int.domain.com//api.php after 1 attempt(s)) fatal: bad object 0000000000000000000000000000000000000000 error: mediawiki::https://wiki.int.domain.com/ did not send all necessary objects

I have the username and password setup in the .git/config file as you list necessary:

[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = mediawiki::https://wiki.int.domain.com/ fetch = +refs/heads/:refs/remotes/origin/ mwLogin = username mwPassword = password

Not really sure what to check there otherwise. On the other, it seems to work to a point but not really.

The other wiki, the login seems to work okay however each of the 50+ articles, when listed when doing the initial fetch, show:

Found 0 revision(s)

Then it dies out with:

Fetching & writing export data... You appear to have cloned an empty MediaWiki. fatal: bad object 0000000000000000000000000000000000000000 error: mediawiki::http://wiki.domain.org/w did not send all necessary objects

Please help

Thanks

B

moy commented 11 years ago

Benjamin Cathey notifications@github.com writes:

I have the username and password setup in the .git/config file as you list necessary:

You can also use the credential helper system, i.e. if you do not provide the password, Git will prompt for it.

You may need to set mwDomain too if you have e.g. an LDAP extension installed on your wiki.

Matthieu Moy http://www-verimag.imag.fr/~moy/

becatlibra-zz commented 11 years ago

We do not actually use LDAP for this particular wiki. There must be some sort of extension though since when you visit in a browswer, it has a popup which asks for username and password (like an htpasswd protection) however once past that, it logs you in to the correct user account.

Removing the username and password, it is still failing:

fatal: could not get the list of wiki pages. fatal: 'https://wiki.int.domain.com/' does not appear to be a mediawiki fatal: make sure 'https://wiki.int.domain.com//api.php' is a valid page. fatal: bad object 0000000000000000000000000000000000000000 error: mediawiki::https://wiki.int.domain.com/ did not send all necessary objects

I am guessing this is due to whatever htpasswd module they are using :( Possibly the no longer maintained HttpAuth extension. I'm asking to try to find out ...

Is there a way to code past this by any chance? I don't mind getting my hands dirty with the perl if you can tell me where the file is that I would want to make changes in?

Thanks

B

becatlibra-zz commented 11 years ago

I found the source in /usr/lib/git-core and from looking through it, realized that you allow for https://username:password@wiki.int.domain.com/ ... Changed the remote to reflect this and it seems to be working fantastically! On article 517 out of 2752!

Thanks

B

moy commented 11 years ago

Benjamin Cathey notifications@github.com writes:

I found the source in /usr/lib/git-core and from looking through it, realized that you allow for https://username: password@wiki.int.domain.com/ ... Changed the remote to reflect this and it seems to be working fantastically! On article 517 out of 2752!

Be careful, this URL is passed on the command-line to the remote helper, which means that anyone running "ps" on your machine during fetch/push will be able to see the password.

Ideally, there should be a credential helper for that, but IIRC this is not implemented.

Matthieu Moy http://www-verimag.imag.fr/~moy/