Wednesday, July 29, 2009

my gsoc2009 @ July 29

Thanks to php-manual, I can generate mod_auth_digest MD5 hash nicely =]

The hash is highlighted below ~


So, what I'm doing to simulate a "cvs-login" on subversion is to fire a MKACTIVITY request to the server. (this is documented in the protocol that most "write" operations first fire it before any other operation).

This MKACTIVITY request will be responded with HTTP-401 Authorization Required =]

Then, I use the info from the HTTP-401 and generate a valid hash of it.... Fire back another MKACTIVITY request with Authorization header.

If... server still reply me with HTTP-401... then the user-password is not valid to the server.
If... server reply me with the superb HTTP-201... That's valid user-password pair.

The whole stuff like this ...


p.s. ... invalid credential give me an apache-error on my own repository ...
[Wed Jul 29 17:20:41 2009] [error] [client 144.214.121.111] Digest: user kschan: password mismatch: /svn/acm/!svn/act/67764a9e-5629-6c72-d9fc-6205068e0a1a

Tuesday, July 28, 2009

my gsoc2009 @ July 28

SVN is good for source control "only".

Why I'm saying so ^^? Read the story...

The story is simple....

In doc-editor, user won't need to register in which doc-editor will check for cvs-credential automatically. As cvs2svn migration complete, I need to adopt svn for doc-editor. So, the very first thing is that I need to understand how svn authenticate!!

Just before my study ... I just know ... svn uses Apache and Http... That's ALL! So, I googled ... "subversion http protocol" and failed. Then, I read subversion *documents* slowly and know that it's using webdav. So, I googled "subversion webdav protocol"... Yes! It give me this!

Therefore, I make my first trail with php-webdav-extension from here...

The codes are simple as shown here ~.~ It fires a webdav-put request and so the authentication stuff are sent to server.


Even it worked... but ... drawbacks come.... no matter what, Apache give me error log as the webdav request is not valid to mod_dav_svn.


Thus, I think I better seek advice from mentor =] And mentor just said, if we're going to use php-extension, we better use the official ... However, the official svn package is somehow like the native svn-client in which the authentication is fired when some operations ask for that... That's to say... it's not much different that I use exec('svn ci') =.=" So, it's much better to do it raw!

To do it raw... I need to understand how's the webdav protocol actually works out ... That's pretty difficult (I should say it's evil honestly =.=) I tried to seek help from freenode-irc #svn but not much help ... So I googled to see how can I trace a http-request and response....

The answer is .... strace!



As fas as I know from the strace ... Apache may be using mod_auth_digest for authentication ... Therefore ... i'm going to study how it works now ... so that i can MD5 the "password" for the authorization header.

( another hard task for me -.-" but that's quite enjoyable =] )

Friday, July 24, 2009

my gsoc2009 @ July 24

php svn-migration is complete and that's time to commit changes :p (excuse for my laziness)

the project is now on http://svn.php.net/viewvc/web/doc-editor/trunk/

You may have a look into the dirty codes by "svn co http://svn.php.net/repository/web/doc-editor/trunk doc-editor"

What I've done thus far from the last commit is that I factored the php files from the ground to the top. The single pain-long (yup, pain-long not plain-long as that's really painful!) class.php is now separated into dozen of files in which each of them groups related functions. The groupings are now written on http://wiki.php.net/gsoc/2009/phdoe#factored_php_classes

Let's have a sneak preview :p


Anyway, what are other excuses of a late commit ^^?

The trouble was that .... i failed to commit the codes .... OMG... What a pity?
The case was that ... when i did svn ci, server responded me ..

svn: Commit failed (details follow):
svn: At least one property change failed; repository is unchanged
svn: Server sent unexpected return value (400 Bad Request) in response to PROPPATCH request


err.... what can I do? Of course.... shout SOS!


And, I got a hand from the mailing list and lovely Apache told me ...

[Wed Jul 22 02:29:46 2009] [error] [client (screened)] Could not fetch resource information. [301, #0]
[Wed Jul 22 02:29:46 2009] [error] [client (screened)] Requests for a collection must have a trailing slash on the URI. [301, #0]




So ... the last resort is Goooooogle!

With a day or two of searching and guessing ... I came to this... The archived mail told me that ... perhaps my network proxy did something naughty to my svn ci .... ( :[ damn hidden proxy? )

The solution is this... i bring the patch back to my home with no hidden proxy ... and committed =]

p.s. Have a footnote here... I'm brainstorming further refactor the project ... see http://wiki.php.net/gsoc/2009/phdoe#brainstorming_idea

Tuesday, July 21, 2009

Code Jam is back!

Tuesday, July 07, 2009

my gsoc2009 @ July 07

When I read the gsoc timeline, I was expected to submit a "mid-term evaluation" that I thought it's a written report. But... finally, it turns out that it's a MC-alike survey ^^ My Life Is MUCH EASIER!!



Anyway, there are still 2 big empty boxes to fill in texxxxxxxxxxxxxxxxxt :( I'm not feeling comfortable with it as the boxes are at the bottom of the MCs :p (quite disappoint me that I need to think of something to fill the boxes :p)



By the way, I got a good news and bad news from the php mailing list ... Good news is that php is going to use SVN. Bad news is that doc-editor is CVS-dependent. That's to say I need to twist the code and adopt the migration ^^"

Friday, July 03, 2009

香港人在做什麼?

晚, 與友聚, 夜回家. 路經街市後巷, 見老婆婆數名, 在垃圾箱裡找紙皮.

到底, 誰是兇手? 誰要老婆婆在大熱天時的深夜拾紙皮?

是因為廢紙回收商的幾元吸引了老婆婆? 是因為企業商品價格高漲? 還是因為政府官員不力?
坦白說, 誰人走到銀行裡, 要求補印單據, 服務費定超十元... 而老婆婆拾紙半天, 可能還得不到十元的"利潤"

到底企業盈利增長, 是不是代表窮人愈來愈多? 是官商釣結? 還是官被商弄?

有錢商人每半年的忽然"捐出"數十/百/千萬給一些慈善機構的整體社會意義大? 還是商人旗下企業商品價格每半年的下調0.1%的整體社會意義大?

有"心"的商人們哦... 你們在做什麼? 你們的盈利是否遠超於香港社會整體的發展? 為什麼香港還窮的時候沒有老婆婆拾紙皮, 到了香港發展了卻"新興起"這"行業"?

政府的官員們..公務員們.. 你們在做什麼? 你們的高薪價值是否只在於你們的學歷與經驗? 可否大膽一點的執行些有利香港整體社會的措施? 可否令老婆婆拾紙皮這"行業"沒落?

我不是聰明人, 我不是有能力之人. 我是小市民. 我是平凡的小市民. 我明白人是自私的動物, 理想的社會主義並不能完美的實現. 但資本主義持久下去, 只會令更多更多適合老人家的"行業"出現... 不要問我共產不共產, 我心只想問我們下一代會怎.

我可以做什麼... ? 有人可以指教我嗎?

my gsoc2009 @ July 03

=] The first milestone is reached!

The clearance of js namespace has been completed and ui-components resulted.



main.js keeps several things in its namespace and a clear layout in the source.



The next milestone is to cleanup the PHPs as listed in the todo.



Currently, a single ExtJsController.php dispatches corresponding handler for particular request. This will be kept but the handler structure will be changed as the handlers are all messed up in class.php. My plan is like this... first groups those related handlers (some are listed in todo), then try to build a hierarchy if there's any. Hope this can be finished before mid of July =]

Wednesday, July 01, 2009

FF3.5 and the Evil

The long waited Firefox 3.5 is released!!! get it =]

But.. the evil comes .... :(

 
© 2009 Emptiness Blogging. All Rights Reserved | Powered by Blogger
Design by psdvibe | Bloggerized By LawnyDesignz