You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Cillian de Róiste <ci...@gmail.com> on 2010/06/15 09:42:13 UTC

Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Hi,

I would like to write a CouchDB app which creates an inventory of
files on the user's computer. I know I could write a client in Python
which would update CouchDB but I would really like to be able to do it
all from the couchdb app. Is there a way to call system commands from
CouchDB with JavaScript (or Erlang)? Something similar to Python's
subprocess module would be perfect:
http://docs.python.org/release/2.5.2/lib/module-subprocess.html

Many thanks,
Cillian

Re: Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Posted by Sebastian Cohnen <se...@googlemail.com>.
since Erlang views are not sandboxed IIRC, this should be possible.

On 15.06.2010, at 09:42, Cillian de Róiste wrote:

> Hi,
> 
> I would like to write a CouchDB app which creates an inventory of
> files on the user's computer. I know I could write a client in Python
> which would update CouchDB but I would really like to be able to do it
> all from the couchdb app. Is there a way to call system commands from
> CouchDB with JavaScript (or Erlang)? Something similar to Python's
> subprocess module would be perfect:
> http://docs.python.org/release/2.5.2/lib/module-subprocess.html
> 
> Many thanks,
> Cillian


Re: Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Posted by Cillian de Róiste <ci...@gmail.com>.
I'm not sure why exactly, but jan on IRC advised against trying to use
Erlang for this even though it may be possible. Using
ExternalProcesses sounds like the way to go. I was hoping to avoid
external dependencies and extra configuration for clients but I guess
it will be easier to manage security issues with this approach.

Thanks a lot!
Cillian

Re: Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Posted by 7zark7 <7z...@gmail.com>.
This is also an option:
http://wiki.apache.org/couchdb/ExternalProcesses


On 6/15/10 12:42 AM, Cillian de Róiste wrote:
> Hi,
>
> I would like to write a CouchDB app which creates an inventory of
> files on the user's computer. I know I could write a client in Python
> which would update CouchDB but I would really like to be able to do it
> all from the couchdb app. Is there a way to call system commands from
> CouchDB with JavaScript (or Erlang)? Something similar to Python's
> subprocess module would be perfect:
> http://docs.python.org/release/2.5.2/lib/module-subprocess.html
>
> Many thanks,
> Cillian


Re: Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Posted by Cillian de Róiste <ci...@gmail.com>.
On Tue, Jun 15, 2010 at 7:51 AM, Iain Sproat <ia...@gmail.com> wrote:
> It would depend on the browser security permissions.  The default
> setting in almost all modern browsers is that javascript in the
> browser is not allowed access to the client's local filesystem.
>
> Iain
>

Thanks Iain, I suspect I didn't make my question clear. I really want
to run the code on the server-side from CouchDB e.g. in a show, not on
the client side.

Cheers,
Cillian

Re: Can I call system shell commands from server side CouchDB JavaScript or Erlang?

Posted by Iain Sproat <ia...@gmail.com>.
It would depend on the browser security permissions.  The default
setting in almost all modern browsers is that javascript in the
browser is not allowed access to the client's local filesystem.

Iain