diff options
| author | Hellekin O. Wolf =8) <[email protected]> | 2010-06-18 18:44:31 (GMT) |
|---|---|---|
| committer | Hellekin O. Wolf =8) <[email protected]> | 2010-06-18 18:53:52 (GMT) |
| commit | 08f669be5ccd2b705fc6e09a8e2ad779939d551c (patch) | |
| tree | 4e56bd6f35fcceb5fa1656f350a33e5e3d362c0b | |
| parent | a63aef90d8c443231b9fde37fe6e12087451c139 (diff) | |
Release v0.1.0 - "Squatting Action"0.1
Revert "make test now runs server.awk with 404 support!"
This reverts commit 4a2c3836cf20021c2329ec5f8ce8ddf37f14d473.
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile.am | 12 | ||||
| -rw-r--r-- | doc/404.org | 14 | ||||
| -rw-r--r-- | doc/index.org | 16 | ||||
| -rw-r--r-- | src/Makefile.am | 26 | ||||
| -rw-r--r-- | src/favicon.ico | bin | 5688 -> 0 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | src/server.awk (renamed from src/server.awk.in) | 47 |
7 files changed, 30 insertions, 87 deletions
@@ -1,7 +1,6 @@ \#* .\#* *~ -*.awk *.sh !autogen.sh *.do @@ -39,7 +38,6 @@ ltmain.sh Makefile Makefile.in missing -/pub /org src/*.el stamp-h1 diff --git a/Makefile.am b/Makefile.am index a566f08..33d385c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,9 +24,17 @@ targets: autorg-greeting # FIXME: use awk-server, or check more dependencies such as a web server... test: autorg-greeting - @$(shell ./src/server.awk) + @echo "starting an minimal apache server to test (requires root)" + @echo "make sure your /etc/hosts is configured accordingly" + @echo "sudo sh -c 'echo \"127.0.0.1 autorg.$(DOMAIN)\" >> /etc/hosts'" @echo - @echo " II AutOrg Web Server stopped." + sudo mkdir -p /var/run/apache2 log/ + sudo apache2 -f etc/apache/apache.$(DOMAIN).conf + @sleep 1 + @echo + @echo "apache2 running with pid `cat etc/apache/test.pid`" + @echo "to stop it, use 'sudo killall apache2' or simply:" + @echo "sudo kill `cat etc/apache/test.pid`" @echo doc: autorg-greeting autorg-dirs diff --git a/doc/404.org b/doc/404.org deleted file mode 100644 index 99590fc..0000000 --- a/doc/404.org +++ b/dev/null @@ -1,14 +0,0 @@ -#+TITLE: HTTP Error 404 -- Document Not Found -#+OPTIONS: toc:nil - -* HTTP Error 404 -- Document Not Found - -The page you're looking for does not exist. - -* Get Started With AutOrg - - - Read the [[file:doc/index.org][documentation]]! - - Create [[org-protocol://open-source://../org/hello-world.org][org/hello-world.org]] - - Run: make new-pages - - Browse to [[http://localhost:8080/hello-world.html][your new page]]. - diff --git a/doc/index.org b/doc/index.org index 6a95e55..7792f5f 100644 --- a/doc/index.org +++ b/doc/index.org @@ -1,19 +1,5 @@ #+TITLE: AutOrg - autonomous distributed information system #+DATE: <2010-06-13 Sun> -* About AutOrg -A minimalist information management system, distributed among -autonomous publishers using Git, Emacs, Org-Mode and basic UN*X -tools. It brings the power of Org-Mode to the Web, and back. - -[[http://autorg.dyne.org/][AutOrg]] is [[#license][free software]] brought to you by the [[http://dyne.org][dyne hackers]]. - -** See also: [[autonomy-is-organization.html][Autonomy Is Organization]] - -** AutOrg FAQ -*** But... Why? - -* [[file:doc/getting-started.html][Getting Started]] -* [[file:doc/org-protocol.html][Org Protocol]] -* [[file:TODO.html][TODO]] +* It Works! diff --git a/src/Makefile.am b/src/Makefile.am index af02dfe..06b62dc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,31 +1,21 @@ - -mklistscripts = $(shell find . -type f -name "*.$1.in" -print | sed 's/.in//g') - -AWKSCRIPTS = $(call mklistscripts,awk) -ELISPSCRIPTS = $(call mklistscripts,el) -SHELLSCRIPTS = $(call mklistscripts,sh) +ELISPSCRIPTS = $(shell find . -type f -name "*.el.in" -print | sed 's/.el.in/.el/g') +SHELLSCRIPTS = $(shell find . -type f -name "*.sh.in" -print | sed 's/.sh.in/.sh/g') mkscript = sed \ -e "s|%autorg_path%|$(AUTORG_PATH)|g" \ -e "s|%domain%|$(DOMAIN)|g" \ -e "s|%orgmode_path%|$(ORGMODE)|g" \ - $1.in 2>/dev/null - -%.awk: %.awk.in - @$(call mkscript,$@) > $@ - @chmod +x $@ + $1.in %.el : %.el.in - @$(call mkscript,$@) > $@ + $(call mkscript,$@) > $@ %.sh : %.sh.in - @$(call mkscript,$@) > $@ + $(call mkscript,$@) > $@ @chmod +x $@ -all: ${AWKSCRIPTS} ${ELISPSCRIPTS} ${SHELLSCRIPTS} - @mkdir -p ../pub/ - @cp favicon.ico ../pub +all: ${ELISPSCRIPTS} ${SHELLSCRIPTS} clean: - @rm -f *.awk *.el *.sh - @rm -f *~ + rm -f *.el *.sh + rm -f *~ diff --git a/src/favicon.ico b/src/favicon.ico Binary files differdeleted file mode 100644 index d2484de..0000000 --- a/src/favicon.ico +++ b/dev/null diff --git a/src/server.awk.in b/src/server.awk index cbd1ab1..dc451d2 100644..100755 --- a/src/server.awk.in +++ b/src/server.awk @@ -25,66 +25,41 @@ BEGIN { status = 200 # 200 == OK reason = "OK" # server response RS = ORS = "\r\n" # header line terminators - doc = "doc/index.html" # html default document - - print ".:| AutOrg Web Server running on",url,"|:." + doc = "index.html" # html default document while (!quit) { - if ($1 == "GET") doc = substr($2, 2) - if (doc ~ "cmd$") Exec(doc) # FIXME: should be a POST (but we're on localhost) + if (doc ~ "cmd$") Exec(doc) else Serve(doc) - if (quit) break + if(quit) break close(host) # close client connection - print "Closed client connection" host |& getline # wait for new client request - print "New Request:",$0 } # server terminated... - print "Received Command QUIT: good bye!" close(host) exit } function Exec(cmd) { - if ( cmd ~ /quit.cmd/) quit = 1 + if( cmd ~ /quit.cmd/) quit = 1 } function Serve(page) { - if ( page == "" ) page = "index.html" - - page_file = "%autorg_path%/pub/" page - - # FIXME: echo -n is not portable - file_exists_p = "test -f " page_file " && echo -n 0 || echo -n 1" - file_exists_p | getline file_not_found - close(file_exists_p) - if ( file_not_found+1 > 1 ) { - page = "doc/404.html" - page_file = "%autorg_path%/pub/" page - status = 404 - reason = "File Not Found" - } - - data = "" - while ((getline line < page_file) > 0) - data = data line - if( page ~ /html$/) content = "text/html" else if( page ~ /jpg$/) content = "image/jpeg" - else if( page ~ /ico$/) content = "image/x-icon" else if( page ~ /png$/) content = "image/png" else if( page ~ /pdf$/) content = "application/pdf" else content = "text/plain" - print "HTTP/1.1", status, reason |& host - print "Content-Type:", content |& host - print "Content-Length:", length(data) |& host - print "Connection: Close" |& host - print ORS ORS data |& host + print "HTTP/1.1", status, reason |& host + print "Content-Type:", content |& host + print "Connection: Close" |& host + getline line < page + print ORS line |& host + while ((getline line < page) > 0) + print line |& host close(page) - print status,reason," [ GET",page,"]" } |

