Erlang/OTP Forums

Author Message

<  Erlyweb mailing list  ~  "Sandboxing" apps

dmitriid
Posted: Tue Nov 04, 2008 12:28 pm Reply with quote
User Joined: 17 Aug 2006 Posts: 213
This is a problem I ran into with ErlyWeb, but I guess this affects all
other apps running under yaws.

If I have a component named main_controller.erl in app A and another
component named main_controller.erl in app B, they will clash. That is, the
servere will only pickup the most recently compiled component (so it seems
though I can be completely wrong).

Is there a way to "sandbox" these apps, to shield them from each other?

--~--~---------~--~----~------------~-------~--~----~
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 received from mailinglist
View user's profile Send private message
Guest
Posted: Tue Nov 04, 2008 1:15 pm Reply with quote
Guest
One way to "sandbox" applications would be to use ErlHive.

http://erlhive.sourceforge.net/

http://code.google.com/p/erlhive/wiki/ErlhiveUserGuide

You can see an example of how it could look when calling
into erlhive from a yaws-based application (not using ErlyWeb)
in http://erlhive.svn.sourceforge.net/viewvc/erlhive/trunk/lib/nofrills/src/blog.erl?revision=57&view=markup

85 auth_do(Who, Mod, Args) ->
86 ...
89 Val = case check_args(Args) of
90 true ->
91 erlhive:with_user(Who,
92 fun(M) ->
93 M:apply(Who, top_blog,
94 main_auth, [Mod,Who,Args])
95 end);
96 false -> ...
98 end,
99 [{html, Val}].

In this case, the full name of the actual module called by erlhive
is going to be erlhive.<Who>.top_blog

Erlhive does put some restrictions on what code can be in the
modules, but it's fairly liberal. There is also a 'trusted' flag that
allows you to break out of the sandbox.

It may be overkill for your needs, but it does solve the problem
you mentioned.

BR,
Ulf W

2008/11/4 Dmitrii Dimandt <dmitriid@gmail.com>:
>
> This is a problem I ran into with ErlyWeb, but I guess this affects all
> other apps running under yaws.
>
> If I have a component named main_controller.erl in app A and another
> component named main_controller.erl in app B, they will clash. That is, the
> servere will only pickup the most recently compiled component (so it seems
> though I can be completely wrong).
>
> Is there a way to "sandbox" these apps, to shield them from each other?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 received from mailinglist
dmitriid
Posted: Tue Nov 04, 2008 2:10 pm Reply with quote
User Joined: 17 Aug 2006 Posts: 213
Thank you. This, indeed, looks like an overkill, but I guess I'll have to
take a look into it

--On November 4, 2008 2:15:25 PM +0100 Ulf Wiger <ulf.wiger@gmail.com>
wrote:

>
> One way to "sandbox" applications would be to use ErlHive.
>
> http://erlhive.sourceforge.net/
>
> http://code.google.com/p/erlhive/wiki/ErlhiveUserGuide
>
> You can see an example of how it could look when calling
> into erlhive from a yaws-based application (not using ErlyWeb)
> in
> http://erlhive.svn.sourceforge.net/viewvc/erlhive/trunk/lib/nofrills/src/
> blog.erl?revision=57&view=markup
>
> 85 auth_do(Who, Mod, Args) ->
> 86 ...
> 89 Val = case check_args(Args) of
> 90 true ->
> 91 erlhive:with_user(Who,
> 92 fun(M) ->
> 93 M:apply(Who, top_blog,
> 94 main_auth, [Mod,Who,Args])
> 95 end);
> 96 false -> ...
> 98 end,
> 99 [{html, Val}].
>
> In this case, the full name of the actual module called by erlhive
> is going to be erlhive.<Who>.top_blog
>
> Erlhive does put some restrictions on what code can be in the
> modules, but it's fairly liberal. There is also a 'trusted' flag that
> allows you to break out of the sandbox.
>
> It may be overkill for your needs, but it does solve the problem
> you mentioned.
>
> BR,
> Ulf W
>
> 2008/11/4 Dmitrii Dimandt <dmitriid@gmail.com>:
>>
>> This is a problem I ran into with ErlyWeb, but I guess this affects all
>> other apps running under yaws.
>>
>> If I have a component named main_controller.erl in app A and another
>> component named main_controller.erl in app B, they will clash. That is,
>> the servere will only pickup the most recently compiled component (so it
>> seems though I can be completely wrong).
>>
>> Is there a way to "sandbox" these apps, to shield them from each other?
>>
>> >
>>
>
> >
>





--~--~---------~--~----~------------~-------~--~----~
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 received from mailinglist
View user's profile Send private message
Guest
Posted: Tue Nov 04, 2008 4:13 pm Reply with quote
Guest
Hi Dmitrii,

Are you using runmod to boot up separate instances of yaws for each up
or you have one yaws instance for all the apps?

On Nov 4, 12:28
Guest
Posted: Tue Nov 04, 2008 11:18 pm Reply with quote
Guest
The workaround I've used is to use a different yaws instance per app.
I run vimagi and twoorl in the same vps but in different VMs. It only
costs like $1/month to get an extra IP address for the vps.

On Tue, Nov 4, 2008 at 4:28 AM, Dmitrii Dimandt <dmitriid@gmail.com> wrote:
>
> This is a problem I ran into with ErlyWeb, but I guess this affects all
> other apps running under yaws.
>
> If I have a component named main_controller.erl in app A and another
> component named main_controller.erl in app B, they will clash. That is, the
> servere will only pickup the most recently compiled component (so it seems
> though I can be completely wrong).
>
> Is there a way to "sandbox" these apps, to shield them from each other?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 received 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