Permalink
Browse files

Fixed license. Renamed from HTTPM to DataBallet.

  • Loading branch information...
1 parent 850c3c5 commit 65c8440a79dfbe25cb4c0c6c211855b582015449 @lparenteau committed Jun 7, 2012
Showing with 84 additions and 84 deletions.
  1. +5 −5 README.md
  2. +13 −13 conf/{httpm.conf → default.conf}
  3. +4 −4 r/caching.m
  4. +18 −18 r/{httpm.m → databallet.m}
  5. +4 −4 r/date.m
  6. +12 −12 r/log.m
  7. +4 −4 r/request.m
  8. +4 −4 r/response.m
  9. +4 −4 r/routing.m
  10. +4 −4 r/static.m
  11. +4 −4 r/template.m
  12. +8 −8 script/{httpm.sh → databallet.sh}
View
@@ -1,16 +1,16 @@
-# HTTPM
+# DataBallet
-HTTPM is an HTTP server and web framework implemented using the [M](https://en.wikipedia.org/wiki/MUMPS) language. It is being developped and tested using [GT.M](http://sourceforge.net/projects/fis-gtm/).
+DataBallet is a web server and application framework implemented using the [M](https://en.wikipedia.org/wiki/MUMPS) language. It is being developped and tested using [GT.M](http://fis-gtm.com/).
## Configuring it
-See conf/httpm.conf and modify it to suits your needs. Better yet, copy, modify, and pass the new file as the second argument to httpm.sh.
+See conf/default.conf and modify it to suits your needs. Better yet, copy, modify, and pass the new file as the second argument to script/databallet.sh.
## Starting the server
-Start the server by executing `./script/httpm.sh start <configuration file>`.
+Start the server by executing `./script/databallet.sh start <configuration file>`.
## Stoping the server
-Stop the server by executing `./script/httpm.sh stop <configuration file>`.
+Stop the server by executing `./script/databallet.sh stop <configuration file>`.
@@ -1,19 +1,19 @@
#
-# httpm
+# This file is part of DataBallet.
# Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
#
-# This program is free software: you can redistribute it and/or modify
+# DataBallet is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
+# DataBallet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
#
# Setup GT.M
@@ -30,7 +30,7 @@ export gtm_log="$gtm_tmp"
# Principal editing
export gtm_principal_editing="EDITING"
# Prompt
-export gtm_prompt="HTTPM>"
+export gtm_prompt="DataBallet>"
# Global directory
export gtmgbldir="$gtmdir/$gtmver/g/gtm.gld"
# M routines
@@ -41,23 +41,23 @@ mkdir -p $gtmdir/$gtmver/r $gtmdir/$gtmver/g $gtmdir/$gtmver/o $gtm_tmp $gtm_log
# PID file location
# Default value : With GT.M's log files.
-export pid="$gtm_log/httpm.pid"
+export pid="$gtm_log/databallet.pid"
# SCRIPT log file location
# Default value : With GT.M's log files.
-export log="$gtm_log/httpm_script.log"
+export log="$gtm_log/databallet_script.log"
-# HTTPM configuration
+# DataBallet configuration
# Port to listen on
-export httpm_port="8080"
+export databallet_port="8080"
# Server string
-export httpm_server="httpm"
+export databallet_server="databallet-20120606"
# Default document name
-export httpm_index="index.html"
+export databallet_index="index.html"
# Error log file
-export httpm_errorlog="$gtm_log/httpm_error.log"
+export databallet_errorlog="$gtm_log/databallet_error.log"
# Common Log Format file
-export httpm_log="$gtm_log/httpm_access.log"
+export databallet_log="$gtm_log/databallet_access.log"
# Routing
cat > $gtmdir/$gtmver/r/routingconf.m << EOF
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
update()
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
conf()
@@ -99,27 +99,27 @@ set conf("compressible","application/javascript")=1
;
; Configuration from environment variable
;
- set conf("serverstring")=$ztrnlnm("httpm_server","","","","","VALUE")
- set conf("listenon")=$ztrnlnm("httpm_port","","","","","VALUE")
- set conf("index")=$ztrnlnm("httpm_index","","","","","VALUE")
- set conf("errorlog")=$ztrnlnm("httpm_errorlog","","","","","VALUE")
- set conf("log")=$ztrnlnm("httpm_log","","","","","VALUE")
+ set conf("serverstring")=$ztrnlnm("databallet_server","","","","","VALUE")
+ set conf("listenon")=$ztrnlnm("databallet_port","","","","","VALUE")
+ set conf("index")=$ztrnlnm("databallet_index","","","","","VALUE")
+ set conf("errorlog")=$ztrnlnm("databallet_errorlog","","","","","VALUE")
+ set conf("log")=$ztrnlnm("databallet_log","","","","","VALUE")
quit
start()
;
; Start the HTTP server.
;
- set $ZTRAP="do errhandler^httpm"
+ set $ZTRAP="do errhandler^databallet"
; Cleanup scratch global
- kill ^TMP("httpm")
+ kill ^TMP("DataBallet")
new conf
do conf
job start^log(conf("log")):(output="/dev/null":error="/dev/null")
new socket,key,handle,p,socketfd
- set socket="httpm"
- open socket:(ZLISTEN=conf("listenon")_":TCP":znoff:zdelay:zbfsize=2048:zibfsize=2048:attach="httpm"):30:"SOCKET"
+ set socket="databallet"
+ open socket:(ZLISTEN=conf("listenon")_":TCP":znoff:zdelay:zbfsize=2048:zibfsize=2048:attach="databallet"):30:"SOCKET"
use socket
write /listen(5)
; When a connection will be made and the connected socket created, it will use the next number, so we can use that to
@@ -133,14 +133,14 @@ set conf("log")=$ztrnlnm("httpm_log","","","","","VALUE")
close p
use socket
set socketfd=socketfd+1
- for do quit:$data(^TMP("httpm","quit"))
+ for do quit:$data(^TMP("DataBallet","quit"))
. set key=""
- . for do quit:key'="" quit:$data(^TMP("httpm","quit"))
+ . for do quit:key'="" quit:$data(^TMP("DataBallet","quit"))
. . write /wait(1)
. . set key=$key
. set handle=$piece(key,"|",2)
. ; Spawn a new process to handle the connection then close the connected socket as we won't use it from here.
- . zsystem "$gtm_dist/mumps -run serve^httpm <&"_socketfd_" >&"_socketfd_" 2>>"_conf("errorlog")_" &"
+ . zsystem "$gtm_dist/mumps -run serve^databallet <&"_socketfd_" >&"_socketfd_" 2>>"_conf("errorlog")_" &"
. close socket:(socket=handle:exception="new dontcare")
. use socket
close socket
@@ -150,7 +150,7 @@ set conf("log")=$ztrnlnm("httpm_log","","","","","VALUE")
;
; Server web page(s) to a connected client.
;
- set $ZTRAP="do errhandler^httpm"
+ set $ZTRAP="do errhandler^databallet"
; VIEW "TRACE":1:"^trace"
new conf
do conf
@@ -242,7 +242,7 @@ set request("uri")=$$geturi^request(line)
; Handle keep-alive connections for HTTP/1.0 and HTTP/1.1.
;
- for do servesinglereq(line) quit:$data(^TMP("httpm","quit")) quit:connection("CONNECTION")'="KEEP-ALIVE" read line:timeout quit:'$test quit:$zeof
+ for do servesinglereq(line) quit:$data(^TMP("DataBallet","quit")) quit:connection("CONNECTION")'="KEEP-ALIVE" read line:timeout quit:'$test quit:$zeof
quit
errhandler()
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
isolder(a,b)
View
24 r/log.m
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
start(commonfile)
@@ -23,13 +23,13 @@
new count
open commonfile:(append:nofixed:wrap:noreadonly:chset="M")
use commonfile
- set ^TMP("httpm","commonlog","count")=0
- for do quit:$data(^TMP("httpm","quit"))
- . if '$data(^TMP("httpm","commonlog","msg")) hang 1
+ set ^TMP("DataBallet","commonlog","count")=0
+ for do quit:$data(^TMP("DataBallet","quit"))
+ . if '$data(^TMP("DataBallet","commonlog","msg")) hang 1
. else do
- . . set count=$order(^TMP("httpm","commonlog","msg",""))
- . . write ^TMP("httpm","commonlog","msg",count),!
- . . kill ^TMP("httpm","commonlog","msg",count)
+ . . set count=$order(^TMP("DataBallet","commonlog","msg",""))
+ . . write ^TMP("DataBallet","commonlog","msg",count),!
+ . . kill ^TMP("DataBallet","commonlog","msg",count)
close commonfile
quit
@@ -41,7 +41,7 @@
zshow "D":devices
set msg=$zpiece($zpiece(devices("D",2),"=",4),"@",1)_" - - ["_$zdate(response("date"),"DD/MON/YEAR:24:60:SS ")_"+0000] """_request("method")_" "_request("uri")_" "_connection("HTTPVER")_""" "_response("status")_" "_$get(response("headers","Content-Length"),"0")
tstart ():serial
- set (cnt,^TMP("httpm","commonlog","count"))=^TMP("httpm","commonlog","count")+1
+ set (cnt,^TMP("DataBallet","commonlog","count"))=^TMP("DataBallet","commonlog","count")+1
tcommit
- set ^TMP("httpm","commonlog","msg",cnt)=msg
+ set ^TMP("DataBallet","commonlog","msg",cnt)=msg
quit
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
gethttpver(line)
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
set(status)
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
route() ;
View
@@ -1,19 +1,19 @@
;
- ; httpm
+ ; This file is part of DataBallet.
; Copyright (C) 2012 Laurent Parenteau <laurent.parenteau@gmail.com>
;
- ; This program is free software: you can redistribute it and/or modify
+ ; DataBallet is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
- ; This program is distributed in the hope that it will be useful,
+ ; DataBallet is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ; along with DataBallet. If not, see <http://www.gnu.org/licenses/>.
;
handle(docroot,urlroot,file)
Oops, something went wrong.

0 comments on commit 65c8440

Please sign in to comment.