9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans]  sources browser script?
@ 2009-04-16 17:38 Benjamin Huntsman
  2009-04-16 17:44 ` Felipe Bichued
  0 siblings, 1 reply; 10+ messages in thread
From: Benjamin Huntsman @ 2009-04-16 17:38 UTC (permalink / raw)
  To: 9fans

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 17:38 [9fans] sources browser script? Benjamin Huntsman
@ 2009-04-16 17:44 ` Felipe Bichued
  2009-04-16 17:55   ` Benjamin Huntsman
  0 siblings, 1 reply; 10+ messages in thread
From: Felipe Bichued @ 2009-04-16 17:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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
<BHuntsman@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
>
>
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 17:44 ` Felipe Bichued
@ 2009-04-16 17:55   ` Benjamin Huntsman
  2009-04-16 18:08     ` Felipe Bichued
  2009-04-16 18:12     ` Skip Tavakkolian
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Huntsman @ 2009-04-16 17:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

>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


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 2508 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 17:55   ` Benjamin Huntsman
@ 2009-04-16 18:08     ` Felipe Bichued
  2009-04-16 18:15       ` andrey mirtchovski
  2009-04-16 18:12     ` Skip Tavakkolian
  1 sibling, 1 reply; 10+ messages in thread
From: Felipe Bichued @ 2009-04-16 18:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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
<BHuntsman@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
>
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 17:55   ` Benjamin Huntsman
  2009-04-16 18:08     ` Felipe Bichued
@ 2009-04-16 18:12     ` Skip Tavakkolian
  2009-04-16 23:57       ` Russ Cox
  1 sibling, 1 reply; 10+ messages in thread
From: Skip Tavakkolian @ 2009-04-16 18:12 UTC (permalink / raw)
  To: 9fans

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 18:08     ` Felipe Bichued
@ 2009-04-16 18:15       ` andrey mirtchovski
  2009-04-16 18:17         ` andrey mirtchovski
  2009-04-16 18:20         ` erik quanstrom
  0 siblings, 2 replies; 10+ messages in thread
From: andrey mirtchovski @ 2009-04-16 18:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> 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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 18:15       ` andrey mirtchovski
@ 2009-04-16 18:17         ` andrey mirtchovski
  2009-04-16 18:20         ` erik quanstrom
  1 sibling, 0 replies; 10+ messages in thread
From: andrey mirtchovski @ 2009-04-16 18:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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
<mirtchovski@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.
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 18:15       ` andrey mirtchovski
  2009-04-16 18:17         ` andrey mirtchovski
@ 2009-04-16 18:20         ` erik quanstrom
  1 sibling, 0 replies; 10+ messages in thread
From: erik quanstrom @ 2009-04-16 18:20 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 18:12     ` Skip Tavakkolian
@ 2009-04-16 23:57       ` Russ Cox
  2009-04-17  0:07         ` erik quanstrom
  0 siblings, 1 reply; 10+ messages in thread
From: Russ Cox @ 2009-04-16 23:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Apr 17, 2009 at 4:12 AM, Skip Tavakkolian <9nut@9netics.com> wrote:
> i think it's a different thing.

yes

> there's an old thread where ehg
> mentions it a filtering fs based on exportfs.

that's yet another different thing.

the sources pages are internally rewritten
into /magic/something/path and then
ip/something (not released) gets run to
generate those pages.  ultimately it's just
a shell script wrapped around ls.
i'm sure one could recreate it in not
very much time.

it's not in the distribution, and in fact i don't
even remember the name of "something".

russ


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] sources browser script?
  2009-04-16 23:57       ` Russ Cox
@ 2009-04-17  0:07         ` erik quanstrom
  0 siblings, 0 replies; 10+ messages in thread
From: erik quanstrom @ 2009-04-17  0:07 UTC (permalink / raw)
  To: 9fans

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=/sources&f=/files&d=&p=/sources&dir=/sources

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

- erik



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-04-17  0:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-16 17:38 [9fans] sources browser script? Benjamin Huntsman
2009-04-16 17:44 ` Felipe Bichued
2009-04-16 17:55   ` Benjamin Huntsman
2009-04-16 18:08     ` Felipe Bichued
2009-04-16 18:15       ` andrey mirtchovski
2009-04-16 18:17         ` andrey mirtchovski
2009-04-16 18:20         ` erik quanstrom
2009-04-16 18:12     ` Skip Tavakkolian
2009-04-16 23:57       ` Russ Cox
2009-04-17  0:07         ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).