Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  Yaws Args leaked deep into ErlyWeb

Guest
Posted: Wed Sep 26, 2007 1:05 am Reply with quote
Guest
ErlyWeb provides nice isolation between M,V,C. Unfortunately, Yaws
args have been allowed to leak deep within ErlyWeb. As the Yaws args
change, ErlyWeb code will break, need to be audited and rewritten, or
worse yet, break silently. Why not keep Yaws args at the gate, and in
doing so make ErlyWeb even more stable and portable to other web
servers?

I could try to submit a patch, but this would require more than a
'patch'.

ErlyWeb is the most efficient and scalable web framework available.
Kudos!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Sep 26, 2007 1:29 am Reply with quote
Guest
It's an interesting idea. The Yaws arg is indeed a pain point because
it keeps changing, but it contains data that is useful all the way up
to ErlyWeb controller functions, so I don't think we can completely
avoid it. We could maybe wrap the arg in an ErlyWeb data structure,
but we would still have to recompile the mapping code when the arg
changes. I do like the idea, though, because the only arg field that
ErlyWeb uses is the appmoddata, i.e., the requested path. Maybe
instead of passing the arg to controllers, ErlyWeb could pass a tuple
such as {RequestedPath, Opaque}. When you run ErlyWeb in Yaws, Opaque
would be the arg. I'm not sure this would be a big win though.

Thoughts?

Yariv

If you want your controllers to be

On 9/25/07, Robin <robi123@gmail.com> wrote:
>
> ErlyWeb provides nice isolation between M,V,C. Unfortunately, Yaws
> args have been allowed to leak deep within ErlyWeb. As the Yaws args
> change, ErlyWeb code will break, need to be audited and rewritten, or
> worse yet, break silently. Why not keep Yaws args at the gate, and in
> doing so make ErlyWeb even more stable and portable to other web
> servers?
>
> I could try to submit a patch, but this would require more than a
> 'patch'.
>
> ErlyWeb is the most efficient and scalable web framework available.
> Kudos!
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Wed Sep 26, 2007 5:15 am Reply with quote
Guest
Hey Yariv! This is the same Robin from Erlounge...

Ironically, tonight I am using the new Yaws 1.71 and ErlyWeb 0.6.2 is
now adding an extra '/' in the paths.

http://localhost:3000/blog//post/list/1
http://localhost:3000/blog//post/new
http://localhost:3000/blog//post/edit/1
http://localhost:3000/blog//post/edit/2

(note the extra '/' on all the paths)

start_yaws()->
code:add_patha("/opt/local/lib/yaws/ebin"),
code:add_patha("./apps/blog/ebin"),
erlyweb:compile("./apps/blog",[{auto_compile, true},{erlydb_driver,
mnesia }]),
yaws:start_embedded("./apps/blog/www",[{servername, "localhost"},
{port, 3000},
{appmods,[{"blog",erlyweb}]},
{opaque,[{"appname",blog}]},
{allowed_scripts,[]}],
[{logdir,"./log"}]).

The problem could be caused by unfiltered use of the Yaws args, but I
have not debugged it yet.

Back to the topic...

You are right that Erlyweb does not need all the fields of Yaws arg.
The Yaws arg seems to have lots of unused fields that get carried
around inside Erlyweb.

Using an ErlyWeb record that is adapted from a filtered version of the
Yaws arg would help isolate future modifications to the adapter code
when Yaws arg changes.

Also, adapters could be made to support other web servers.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Thu Sep 27, 2007 1:25 am Reply with quote
Guest
Ugh, it's really annoying how every Yaws version treats the appmod
differently. However, I'm a bit wary of breaking existing apps by
passing something different from the arg. Also, supporting other web
servers using an adapter sounds like a good concept, but I'm not sure
than in practice anyone needs it. Please correct me if I'm wrong.

Yariv

On 9/25/07, Robin <robi123@gmail.com> wrote:
>
> Hey Yariv! This is the same Robin from Erlounge...
>
> Ironically, tonight I am using the new Yaws 1.71 and ErlyWeb 0.6.2 is
> now adding an extra '/' in the paths.
>
> http://localhost:3000/blog//post/list/1
> http://localhost:3000/blog//post/new
> http://localhost:3000/blog//post/edit/1
> http://localhost:3000/blog//post/edit/2
>
> (note the extra '/' on all the paths)
>
> start_yaws()->
> code:add_patha("/opt/local/lib/yaws/ebin"),
> code:add_patha("./apps/blog/ebin"),
> erlyweb:compile("./apps/blog",[{auto_compile, true},{erlydb_driver,
> mnesia }]),
> yaws:start_embedded("./apps/blog/www",[{servername, "localhost"},
> {port, 3000},
> {appmods,[{"blog",erlyweb}]},
> {opaque,[{"appname",blog}]},
> {allowed_scripts,[]}],
> [{logdir,"./log"}]).
>
> The problem could be caused by unfiltered use of the Yaws args, but I
> have not debugged it yet.
>
> Back to the topic...
>
> You are right that Erlyweb does not need all the fields of Yaws arg.
> The Yaws arg seems to have lots of unused fields that get carried
> around inside Erlyweb.
>
> Using an ErlyWeb record that is adapted from a filtered version of the
> Yaws arg would help isolate future modifications to the adapter code
> when Yaws arg changes.
>
> Also, adapters could be made to support other web servers.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Thu Sep 27, 2007 1:54 am Reply with quote
Guest
As a short term solution would be to just freeze and filter the
current Yaws arg record.

-This will not break any ErlyWeb compatibility.
-This will help Erlyweb guard against future changes in Yaws.

Freeze would mean copy the existing Yaws arg record, and create an
ErlyWeb arg record with the same fields. (the Arg record is no longer
susceptible to coincidental change).

Filter would mean pass the Yaws arg through an ErlyWeb arg constructor
that ensures certain arg characteristics are upheld. ( eg. the
requested_path field of the arg should [never|always] end in a '/')

Robin



On Sep 26, 6:23 pm, "Yariv Sadan" <yarivsa...@gmail.com> wrote:
> Ugh, it's really annoying how every Yaws version treats the appmod
> differently. However, I'm a bit wary of breaking existing apps by
> passing something different from the arg. Also, supporting other web
> servers using an adapter sounds like a good concept, but I'm not sure
> than in practice anyone needs it. Please correct me if I'm wrong.
>
> Yariv
>
> On 9/25/07, Robin <robi...@gmail.com> wrote:
>
>
>
> > Hey Yariv! This is the same Robin from Erlounge...
>
> > Ironically, tonight I am using the new Yaws 1.71 and ErlyWeb 0.6.2 is
> > now adding an extra '/' in the paths.
>
> >http://localhost:3000/blog//post/list/1
> >http://localhost:3000/blog//post/new
> >http://localhost:3000/blog//post/edit/1
> >http://localhost:3000/blog//post/edit/2
>
> > (note the extra '/' on all the paths)
>
> > start_yaws()->
> > code:add_patha("/opt/local/lib/yaws/ebin"),
> > code:add_patha("./apps/blog/ebin"),
> > erlyweb:compile("./apps/blog",[{auto_compile, true},{erlydb_driver,
> > mnesia }]),
> > yaws:start_embedded("./apps/blog/www",[{servername, "localhost"},
> > {port, 3000},
> > {appmods,[{"blog",erlyweb}]},
> > {opaque,[{"appname",blog}]},
> > {allowed_scripts,[]}],
> > [{logdir,"./log"}]).
>
> > The problem could be caused by unfiltered use of the Yaws args, but I
> > have not debugged it yet.
>
> > Back to the topic...
>
> > You are right that Erlyweb does not need all the fields of Yaws arg.
> > The Yaws arg seems to have lots of unused fields that get carried
> > around inside Erlyweb.
>
> > Using an ErlyWeb record that is adapted from a filtered version of the
> > Yaws arg would help isolate future modifications to the adapter code
> > when Yaws arg changes.
>
> > Also, adapters could be made to support other web servers.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Thu Sep 27, 2007 6:30 am Reply with quote
Guest
Before we switched from yaws to mochiweb, we had a module "mochiyaws"
that had accessor functions for the yaws arg such that we could return
something consistent regardless of the yaws version and without
polluting the rest of our code with yaws include files.

-bob

On 9/26/07, Yariv Sadan <yarivsadan@gmail.com> wrote:
>
> Ugh, it's really annoying how every Yaws version treats the appmod
> differently. However, I'm a bit wary of breaking existing apps by
> passing something different from the arg. Also, supporting other web
> servers using an adapter sounds like a good concept, but I'm not sure
> than in practice anyone needs it. Please correct me if I'm wrong.
>
> Yariv
>
> On 9/25/07, Robin <robi123@gmail.com> wrote:
> >
> > Hey Yariv! This is the same Robin from Erlounge...
> >
> > Ironically, tonight I am using the new Yaws 1.71 and ErlyWeb 0.6.2 is
> > now adding an extra '/' in the paths.
> >
> > http://localhost:3000/blog//post/list/1
> > http://localhost:3000/blog//post/new
> > http://localhost:3000/blog//post/edit/1
> > http://localhost:3000/blog//post/edit/2
> >
> > (note the extra '/' on all the paths)
> >
> > start_yaws()->
> > code:add_patha("/opt/local/lib/yaws/ebin"),
> > code:add_patha("./apps/blog/ebin"),
> > erlyweb:compile("./apps/blog",[{auto_compile, true},{erlydb_driver,
> > mnesia }]),
> > yaws:start_embedded("./apps/blog/www",[{servername, "localhost"},
> > {port, 3000},
> > {appmods,[{"blog",erlyweb}]},
> > {opaque,[{"appname",blog}]},
> > {allowed_scripts,[]}],
> > [{logdir,"./log"}]).
> >
> > The problem could be caused by unfiltered use of the Yaws args, but I
> > have not debugged it yet.
> >
> > Back to the topic...
> >
> > You are right that Erlyweb does not need all the fields of Yaws arg.
> > The Yaws arg seems to have lots of unused fields that get carried
> > around inside Erlyweb.
> >
> > Using an ErlyWeb record that is adapted from a filtered version of the
> > Yaws arg would help isolate future modifications to the adapter code
> > when Yaws arg changes.
> >
> > Also, adapters could be made to support other web servers.
> >
> >
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Thu Sep 27, 2007 10:00 am Reply with quote
Guest
Hey Bob, mochiweb could be a nice lightweight container for erlyweb
apps, any hint when you will 'properly' open source it?

On Sep 26, 11:30 pm, "Bob Ippolito" <b...@redivi.com> wrote:
> Before we switched from yaws to mochiweb, we had a module "mochiyaws"
> that had accessor functions for the yaws arg such that we could return
> something consistent regardless of the yaws version and without
> polluting the rest of our code with yaws include files.
>
> -bob
>
> On 9/26/07, Yariv Sadan <yarivsa...@gmail.com> wrote:
>
>
>
> > Ugh, it's really annoying how every Yaws version treats the appmod
> > differently. However, I'm a bit wary of breaking existing apps by
> > passing something different from the arg. Also, supporting other web
> > servers using an adapter sounds like a good concept, but I'm not sure
> > than in practice anyone needs it. Please correct me if I'm wrong.
>
> > Yariv
>
> > On 9/25/07, Robin <robi...@gmail.com> wrote:
>
> > > Hey Yariv! This is the same Robin from Erlounge...
>
> > > Ironically, tonight I am using the new Yaws 1.71 and ErlyWeb 0.6.2 is
> > > now adding an extra '/' in the paths.
>
> > >http://localhost:3000/blog//post/list/1
> > >http://localhost:3000/blog//post/new
> > >http://localhost:3000/blog//post/edit/1
> > >http://localhost:3000/blog//post/edit/2
>
> > > (note the extra '/' on all the paths)
>
> > > start_yaws()->
> > > code:add_patha("/opt/local/lib/yaws/ebin"),
> > > code:add_patha("./apps/blog/ebin"),
> > > erlyweb:compile("./apps/blog",[{auto_compile, true},{erlydb_driver,
> > > mnesia }]),
> > > yaws:start_embedded("./apps/blog/www",[{servername, "localhost"},
> > > {port, 3000},
> > > {appmods,[{"blog",erlyweb}]},
> > > {opaque,[{"appname",blog}]},
> > > {allowed_scripts,[]}],
> > > [{logdir,"./log"}]).
>
> > > The problem could be caused by unfiltered use of the Yaws args, but I
> > > have not debugged it yet.
>
> > > Back to the topic...
>
> > > You are right that Erlyweb does not need all the fields of Yaws arg.
> > > The Yaws arg seems to have lots of unused fields that get carried
> > > around inside Erlyweb.
>
> > > Using an ErlyWeb record that is adapted from a filtered version of the
> > > Yaws arg would help isolate future modifications to the adapter code
> > > when Yaws arg changes.
>
> > > Also, adapters could be made to support other web servers.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum