From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.238.84 with SMTP id kr20cs42407qcb; Mon, 20 Feb 2012 08:24:51 -0800 (PST) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCOCkpKnzHBDQ54n6BBoEvuCe7w@googlegroups.com designates 10.52.180.102 as permitted sender) client-ip=10.52.180.102; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCOCkpKnzHBDQ54n6BBoEvuCe7w@googlegroups.com designates 10.52.180.102 as permitted sender) smtp.mail=rack-devel+bncCOCkpKnzHBDQ54n6BBoEvuCe7w@googlegroups.com; dkim=pass header.i=rack-devel+bncCOCkpKnzHBDQ54n6BBoEvuCe7w@googlegroups.com Received: from mr.google.com ([10.52.180.102]) by 10.52.180.102 with SMTP id dn6mr6391097vdc.6.1329755091054 (num_hops = 1); Mon, 20 Feb 2012 08:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:received-spf:date:from:to:message-id :in-reply-to:references:subject:x-mailer:mime-version :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=rtBPAR8pkm0+CTrW6XG2llFycc2SuHe3i7Mo7XnVLAI=; b=OVH6v97YKvD5dbULw03PWLOAS3r/HsCO7iIigN5D7yzs5JJqAlHMxrJoLJMZZvWq8M WuDTwXUA04+OawDY+ZeaMfMQpWsiZJ/RTK1OuqvDq+lAay8w0OqIf9MLIs+jEeWekqPf R+TTj+OrLZCvMtqzvXhckVRyH7+3oRb+2VADM= Received: by 10.52.180.102 with SMTP id dn6mr1952744vdc.6.1329755088769; Mon, 20 Feb 2012 08:24:48 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.52.96.162 with SMTP id dt2ls4087977vdb.3.gmail; Mon, 20 Feb 2012 08:24:48 -0800 (PST) Received: by 10.50.203.99 with SMTP id kp3mr3640861igc.0.1329755087952; Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received: by 10.50.203.99 with SMTP id kp3mr3640859igc.0.1329755087926; Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received: from mail-iy0-f179.google.com (mail-iy0-f179.google.com [209.85.210.179]) by gmr-mx.google.com with ESMTPS id df4si2879331igb.1.2012.02.20.08.24.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received-SPF: pass (google.com: domain of jballanc@gmail.com designates 209.85.210.179 as permitted sender) client-ip=209.85.210.179; Received: by mail-iy0-f179.google.com with SMTP id z21so8640456iab.10 for ; Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received-SPF: pass (google.com: domain of jballanc@gmail.com designates 10.50.203.6 as permitted sender) client-ip=10.50.203.6; Received: from mr.google.com ([10.50.203.6]) by 10.50.203.6 with SMTP id km6mr13781116igc.25.1329755087912 (num_hops = 1); Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received: by 10.50.203.6 with SMTP id km6mr11196129igc.25.1329755087830; Mon, 20 Feb 2012 08:24:47 -0800 (PST) Received: from Earth.local ([38.105.146.82]) by mx.google.com with ESMTPS id b6sm7369406igj.7.2012.02.20.08.24.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Feb 2012 08:24:46 -0800 (PST) Date: Mon, 20 Feb 2012 11:24:45 -0500 From: Joshua Ballanco To: rack-devel@googlegroups.com Message-ID: In-Reply-To: References: Subject: Re: Making a CGI request to a program (fossil-scm) from Rack (Sinatra) X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 X-Original-Sender: jballanc@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jballanc@gmail.com designates 209.85.210.179 as permitted sender) smtp.mail=jballanc@gmail.com; dkim=pass header.i=@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary="4f4273cd_2ae8944a_105" --4f4273cd_2ae8944a_105 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline You might start by reading the wiki page for CGI: http://en.wikipedia.org/wiki/Common_Gateway_Interface (and, if you're up to it, read RFC3875 after that). The moral of the story is that a CGI script is just a script that expects a variety of environment variables describing the request made, and the POST/PUT body on stdin. With a little bit of experimentation, I expect you should be able to simply shell-out to Fossil to do what you want. On Sunday, February 19, 2012 at 8:37 PM, Guillermo Estrada wrote: > Hi, I just hope this is the place where I'll find the answer. > > Fossil-Scm is a Source Code Management System that has a built in web > server for tracking issues and a wiki and such. It supports CGI also > to avoid running long term processes while hosting multiple repos. The > documentation suggests creating a simple CGI script like this one for > each repo you would like to host: > > #!/usr/bin/fossil > repository: /route/to/repo/name.fossil > > And this is all fine and works wonders in my web hosting. > > What I want to do is to create a Sinatra (Rack) app to manage those > repositories, user authentication, common operations, create, delete, > etc... But in order to do that, I want to be able to manipulate the > route and the output of those webpages called via CGI. > > Is there a way to take a request from my Rack application, take some > parameters, send them to the program (fossil) as a CGI request (This I > don't know how) and then get the output html to analyze/modify/etc... > and then sending the response from my Rack app? > > Any help would be GREATLY appreciated. --4f4273cd_2ae8944a_105 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
You might start by reading the wiki page for CGI: http://en.wik= ipedia.org/wiki/Common=5FGateway=5FInterface (and, if you're up = to it, read R=46C3875 after that). The moral of the story is that a CGI s= cript is just a script that expects a variety of environment variables de= scribing the request made, and the POST/PUT body on stdin. With a little = bit of experimentation, I expect you should be able to simply shell-out t= o =46ossil to do what you want.
=20

On Sunday, =46ebruary = 19, 2012 at 8:37 PM, Guillermo Estrada wrote:

Hi, I just hope this is the plac= e where I'll find the answer.

=46ossil-Scm is a = Source Code Management System that has a built in web
server fo= r tracking issues and a wiki and such. It supports CGI also
to = avoid running long term processes while hosting multiple repos. The
=
documentation suggests creating a simple CGI script like this one fo= r
each repo you would like to host:

=23= =21/usr/bin/fossil
repository: /route/to/repo/name.fossil
=

And this is all fine and works wonders in my web host= ing.

What I want to do is to create a Sinatra (R= ack) app to manage those
repositories, user authentication, com= mon operations, create, delete,
etc... But in order to do that,= I want to be able to manipulate the
route and the output of th= ose webpages called via CGI.

Is there a way to t= ake a request from my Rack application, take some
parameters, s= end them to the program (fossil) as a CGI request (This I
don't= know how) and then get the output html to analyze/modify/etc...
and then sending the response from my Rack app=3F

<= div>Any help would be GREATLY appreciated.
=20 =20 =20 =20
=20

--4f4273cd_2ae8944a_105--