[9fans] sources browser script?

2009-04-16 Thread Benjamin Huntsman
Speaking of web servers...
Is the script that creates the pages for the source browsing on 
plan9.bell-labs.com/sources/ included in the distribution or otherwise 
available?  It's pretty neat, and may be useful...

Thanks in advance!

-Ben




Re: [9fans] sources browser script?

2009-04-16 Thread Felipe Bichued
http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ip/httpd/webls.c

On Thu, Apr 16, 2009 at 2:38 PM, Benjamin Huntsman
bhunts...@mail2.cu-portland.edu wrote:
 Speaking of web servers...
 Is the script that creates the pages for the source browsing on 
 plan9.bell-labs.com/sources/ included in the distribution or otherwise 
 available?  It's pretty neat, and may be useful...

 Thanks in advance!

 -Ben






Re: [9fans] sources browser script?

2009-04-16 Thread Benjamin Huntsman
http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ip/httpd/webls.c

That looks to be useful too, though that's not the script that sources is using 
to generate the pages.
The HTML source produced by webls.c looks different than what is produced by 
the pages.
Looks like the script in question should be called sources.tr?

Thanks!

-Ben

winmail.dat

Re: [9fans] sources browser script?

2009-04-16 Thread Felipe Bichued
i'm not sure what you mean by script, the server in question
probably runs a tweaked version of webls.
it's also interesting to note that they managed to hide the
/magic/prog stuff  from the urls somehow.

On Thu, Apr 16, 2009 at 2:55 PM, Benjamin Huntsman
bhunts...@mail2.cu-portland.edu wrote:
http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ip/httpd/webls.c

 That looks to be useful too, though that's not the script that sources is 
 using to generate the pages.
 The HTML source produced by webls.c looks different than what is produced by 
 the pages.
 Looks like the script in question should be called sources.tr?

 Thanks!

 -Ben





Re: [9fans] sources browser script?

2009-04-16 Thread Skip Tavakkolian
i think it's a different thing.  there's an old thread where ehg
mentions it a filtering fs based on exportfs.

a filterfs would make this type of thing trivial; i have an outline of
one.  cgifs is already done (in fgb's contrib) and there's a cgi.c in
rsc's contrib that you could use with httpd to get it done in rc.

http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/ip/httpd/webls.c
 
 That looks to be useful too, though that's not the script that sources is 
 using to generate the pages.
 The HTML source produced by webls.c looks different than what is produced by 
 the pages.
 Looks like the script in question should be called sources.tr?
 
 Thanks!
 
 -Ben




Re: [9fans] sources browser script?

2009-04-16 Thread andrey mirtchovski
 it's also interesting to note that they managed to hide the
 /magic/prog stuff  from the urls somehow.


that's accomplished via /sys/lib/httpd.rewrite. from httpd(8):

  Httpd handles replacements pre-
  fixed with @ internally, treating the request as if it were
  for the replacement (without the @) but not informing the
  client of the rewritten name.

i have a version of httpd that accepts full regular expressions in
httpd.rewrite.



Re: [9fans] sources browser script?

2009-04-16 Thread andrey mirtchovski
oops, forgot example:

^(.*)/download(.*)/$@/magic/webls?dir=\1/download/\2
^(.*)/src(.*)/$ @/magic/webls?dir=\1/src\2


On Thu, Apr 16, 2009 at 12:15 PM, andrey mirtchovski
mirtchov...@gmail.com wrote:
 it's also interesting to note that they managed to hide the
 /magic/prog stuff  from the urls somehow.


 that's accomplished via /sys/lib/httpd.rewrite. from httpd(8):

          Httpd handles replacements pre-
          fixed with @ internally, treating the request as if it were
          for the replacement (without the @) but not informing the
          client of the rewritten name.

 i have a version of httpd that accepts full regular expressions in
 httpd.rewrite.




Re: [9fans] sources browser script?

2009-04-16 Thread erik quanstrom
that's nice.

i wrote a slightly different version of webls to handle
coraid's mirror of sources (http://sources.coraid.com)
to allow the arguments to always be hidden and to
gloss over the differences between source directories
and source files.

- erik



Re: [9fans] sources browser script?

2009-04-16 Thread erik quanstrom
this is what i'm using.  it's not as pretty.
and the arguments are downright ugly.

adding the code to pretty-up the source listings
would eliminate the sleeze and ugliness
but i didn't want to drag all that code in too.

i added this to /lib/httpd.rewrite
# sleezy
bind /usr/sources /usr/web/sources/sources
bind /usr/sources /usr/web/sources/files

and this to /sys/lib/httpd.rewrite
/sources@/magic/sources?r=/sourcesf=/filesd=p=/sourcesdir=/sources

and use /n/sources/contrib/quanstro/sources.c

- erik