apcgi

Web client for aps on trusted networks
git clone git://jacobedwards.org/apcgi
Log | Files | Refs | README

README (2031B)


      1 This is a CGI script intended to be used as a basic ap client for
      2 a phone which would otherwise have to be programmed in something
      3 like Java.  I'm not sure it's even that useful to have an ap client
      4 on a phone, but I made this anyway.
      5 
      6 Before using this, understand that I did not think about security
      7 while writing this. For instance the player command (which allows
      8 the execution of arbitrary programs as the server) would not be
      9 something you'd want an untrusted entity to have access to. That,
     10 and keep in mind what the license clearly states:
     11 
     12         THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR
     13         DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
     14         INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
     15         FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     16         SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR
     17         ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
     18         OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
     19         OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
     20         CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     21 
     22 Also note that it doesn't do much to ensure text is encoded correctly
     23 for either the HTML document or the audio player server.
     24 
     25 So with that out of the way here's how to get it running on OpenBSD
     26 (and probably other operating systems using a similar process):
     27 
     28 - Setup httpd.conf(5) with 'location "/cgi/*" { fastcgi }'
     29 - Copy the script to the cgi directory (ensuring it's executable by www)
     30 - Copy /bin/sh(1), sed(1), and apc(1) to /var/www for access in
     31   chrooted environment. (echo(1) is also used, but is built into
     32   OpenBSD's sh(1))
     33 - If dynamically linked, also copy the required libraries (which
     34   should only be libc)
     35 - Start aps with apsock=/var/www/tmp/aps
     36 - Start httpd(8) and slowcgi(8)
     37 
     38 I believe with that it should be setup; just point a web browser
     39 at the script and there you have it.
     40 
     41 To drive the point home: It's very important you protect this script
     42 in some way. For my use case, I just use pf(4).