home readme diff tree note docs

0commit dffd8836ff716890fbfc58802d6120072488bed6
1Author: lakefox <mason@lakefox.net>
2Date:   Sat Jun 20 12:23:56 2026 -0600
3
4    README
5
6diff --git a/.README.txt.swp b/.README.txt.swp
7new file mode 100644
8index 0000000..63c738f
9Binary files /dev/null and b/.README.txt.swp differ
10diff --git a/README.txt b/README.txt
11index 637e4a4..6c723a7 100644
12--- a/README.txt
13+++ b/README.txt
14@@ -6,25 +6,41 @@ They are very easy to setup if you are using lighttpd or apache.
15 Git
16 ---------------------------------------
17 
18-Add all git repos to /var/git
19-
20-Lighttpd Setup
21--------------------
22-Setup git http backend like this:
23-alias.url += ( "/repo" => "/usr/lib/git-core/git-http-backend" )
24-  $HTTP["url"] =~ "^/repo" {
25-	cgi.assign = ("" => "")
26-	setenv.add-environment = (
27-		"GIT_PROJECT_ROOT" => "/var/git",
28-		"GIT_HTTP_EXPORT_ALL" => ""
29-	)
30-  }
31-
32-If you want to have a wildcard DNS record that redirects all subdomains to the correct git
33-repo README page add this:
34-$HTTP["host"] =~ "^([^.]+)\.git\.ws$" {
35-  url.redirect = ( "^/(.*)" => "http://git.ws/cgi-bin/git.awk?name=%1&action=readme" )
36-}
37+Features:
38+* Repo list
39+* Git log
40+* Automatic README identification
41+* Diff viewer
42+* Tree viewer with file viewer
43+* Displays git notes
44+* Docs for displaying man pages (Requires mandoc)
45+
46+Getting Started
47+Set git.awk to executable and add it to your cgi-bin directory. Create a
48+/var/git folder. This is where your git repo's will live. Git.awk doesn't
49+handle any git related items like managing the commits. Git.awk is just a 
50+http viewer. 
51+
52+Once you have moved a git repo into /var/git open the cgi-bin script in a browser
53+and you will see your repo listed on the home page! Everything else should
54+be automatic except the docs. To create a docs page you need to make a docs
55+directory in the repo. Git.awk will check that folder for any man pages and if found
56+it will convert them to ascii using manpage and server them.
57+
58+
59+CGI
60+--------------------------------------
61+
62+Features
63+* Easily launch version controlled API's and update them with git push
64+
65+Same setup as git.awk. CGI.awk follows the same URL encoding as git.awk so if you need
66+the url for the script just chnage out the git.awk for cgi.awk.
67+
68+CGI.awk extracts the repo at a specfic commit to a temp folder located at /tmp/{name}/{commit}.
69+Once the commit is extracted or if it already existed the script will execute the file
70+specified with the path query parameter passing any other query parameter as a path variable to
71+the script.
72 
73 Mailto
74 --------------------------------------
75diff --git a/cgi-bin/.cgi.awk.swp b/cgi-bin/.cgi.awk.swp
76new file mode 100644
77index 0000000..fcb62fd
78Binary files /dev/null and b/cgi-bin/.cgi.awk.swp differ
79diff --git a/cgi-bin/cgi.awk b/cgi-bin/cgi.awk
80index 5a7027a..b4da809 100755
81--- a/cgi-bin/cgi.awk
82+++ b/cgi-bin/cgi.awk
83@@ -1,7 +1,5 @@
84 #!/bin/awk -f
85 
86-# /var/git
87-
88 BEGIN {
89         split(ENVIRON["QUERY_STRING"], pairs, "&")
90         for (i in pairs) {
91@@ -13,9 +11,9 @@ BEGIN {
92                         hash = sanitize(kv[2])
93                 } else if (kv[1] == "path") {
94                         path = sanitize(kv[2])
95-                } else {
96-                         params[kv[1]] = kv[2]
97                 }
98+                params[kv[1]] = kv[2]
99+                
100         }
101 
102         if (name == "") { print "Status: 400 Bad Request\r\n\r\nMissing repository."; exit }
103@@ -27,24 +25,17 @@ BEGIN {
104         file = "/tmp/" name "/" hash "/" path
105 
106         if (system("test -x " file) != 0) {
107-                n = split(path, parts, "/")
108-
109-                dir_path = "/tmp/" name "/" hash
110-                for (i = 1; i < n; i++) {
111-                        dir_path = dir_path "/" parts[i]
112-                }
113-
114                 system("mkdir -p /tmp/" name "/" hash)
115 
116-		system("git --git-dir=/var/git/" name ".git/ archive " hash " | tar -x -C /tmp/" name "/" hash)
117-	}
118+                system("git --git-dir=/var/git/" name ".git/ archive " hash " | tar -x -C /tmp/" name "/" hash)
119+        }
120 
121         cmd = query_args " " file
122 
123-       while ((cmd | getline line) > 0) {
124-               print line
125-       }
126-       close(cmd)
127+        while ((cmd | getline line) > 0) {
128+                print line
129+        }
130+        close(cmd)
131 }
132 
133 
134diff --git a/hello.sh b/hello.sh
135deleted file mode 100755
136index 2650b9e..0000000
137--- a/hello.sh
138+++ /dev/null
139@@ -1,5 +0,0 @@
140-#/bin/sh
141-
142-echo "Content-Type: text/plain\r\n"
143-echo ""
144-echo "Hello\r\n"