]> Git repositories of Nishi - koakuma.git/commitdiff
some
authorNishi <nishi@nishi.boats>
Tue, 1 Oct 2024 03:45:55 +0000 (03:45 +0000)
committerNishi <nishi@nishi.boats>
Tue, 1 Oct 2024 03:45:55 +0000 (03:45 +0000)
git-svn-id: file:///raid/svn-personal/koakuma/trunk@2 219d0f9c-2d94-d447-890a-813e76b88fe9

Components/vcs_cvs.tcl [new file with mode: 0644]
Components/vcs_svn.tcl [new file with mode: 0644]
Makefile [new file with mode: 0644]
Tool/create-task [new file with mode: 0644]
Tool/launch-job [new file with mode: 0644]
apache.conf.in [new file with mode: 0644]
koakuma.cgi.in [new file with mode: 0644]
koakuma.png [new file with mode: 0644]

diff --git a/Components/vcs_cvs.tcl b/Components/vcs_cvs.tcl
new file mode 100644 (file)
index 0000000..7dd8e10
--- /dev/null
@@ -0,0 +1,2 @@
+# $Id$
+lappend components "CVS" "CVS Integration" "1.00"
diff --git a/Components/vcs_svn.tcl b/Components/vcs_svn.tcl
new file mode 100644 (file)
index 0000000..58cadf0
--- /dev/null
@@ -0,0 +1,2 @@
+# $Id$
+lappend components "Subversion" "Subversion Integration" "1.00"
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..9f254a5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+# $Id$
+
+PREFIX = /usr/local
+REPLACE = sed "s%@@PREFIX@@%$(PREFIX)%g"
+
+.PHONY: install
+
+install: Components/* Tool/* koakuma.cgi.in
+       mkdir -p $(PREFIX)/lib/koakuma/components/
+       mkdir -p $(PREFIX)/lib/koakuma/htdocs/static/
+       mkdir -p $(PREFIX)/etc/koakuma/
+       mkdir -p $(PREFIX)/lib/koakuma/cgi-bin/
+       mkdir -p $(PREFIX)/bin/
+       cp -rf Components/* $(PREFIX)/lib/koakuma/components/
+       cp -rf Tool/* $(PREFIX)/bin/
+       cp -rf koakuma.png $(PREFIX)/lib/koakuma/htdocs/static/
+       $(REPLACE) koakuma.cgi.in > $(PREFIX)/lib/koakuma/cgi-bin/koakuma.cgi
+       $(REPLACE) apache.conf.in > $(PREFIX)/etc/koakuma/apache.conf
+       chmod +x $(PREFIX)/lib/koakuma/cgi-bin/koakuma.cgi
+       chmod +x $(PREFIX)/bin/create-task
+       chmod +x $(PREFIX)/bin/launch-job
diff --git a/Tool/create-task b/Tool/create-task
new file mode 100644 (file)
index 0000000..614af38
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env tclsh
+# $Id$
diff --git a/Tool/launch-job b/Tool/launch-job
new file mode 100644 (file)
index 0000000..614af38
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env tclsh
+# $Id$
diff --git a/apache.conf.in b/apache.conf.in
new file mode 100644 (file)
index 0000000..b4fb8a6
--- /dev/null
@@ -0,0 +1,15 @@
+# $Id$
+# vim: syntax=apache
+
+DocumentRoot @@PREFIX@@/lib/koakuma/htdocs
+<Directory @@PREFIX@@/lib/koakuma/htdocs>
+       Require all granted
+</Directory>
+<Directory @@PREFIX@@/lib/koakuma/cgi-bin>
+       Options +ExecCGI
+       Require all granted
+</Directory>
+ScriptAlias /koakuma @@PREFIX@@/lib/koakuma/cgi-bin/koakuma.cgi
+
+RewriteEngine on
+RewriteRule ^/$ /koakuma [END,NE,R=permanent]
diff --git a/koakuma.cgi.in b/koakuma.cgi.in
new file mode 100644 (file)
index 0000000..bea049e
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/env tclsh
+# $Id$
+
+set KOAKUMA_VERSION "1.00"
+set components ""
+
+proc exiting {code} {
+       exit $code
+}
+
+proc crash {reason} {
+       global components KOAKUMA_VERSION
+       puts stderr "----- Start Koakuma Crash dump log -----"
+       puts stderr "Included components:"
+       foreach {name description version} $components {
+               puts stderr "   $name: $description, version $version"
+       }
+       puts stderr "Reason: $reason"
+       puts stderr "----- End Koakuma Crash dump log -----"
+       puts    "Content-Type: text/html"
+       puts    "Status: 500 Internal Server Error"
+       puts    ""
+       puts    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">"
+       puts    "<html>"
+       puts    "       <head>"
+       puts    "               <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
+       puts    "               <title>Oops</title>"
+       puts    "       </head>"
+       puts    "       <body>"
+       puts    "               <h1>Oops</h1>"
+       puts    "               <hr>"
+       puts    "               Koakuma version $KOAKUMA_VERSION crashed, reason: <code>$reason</code><br>"
+       puts    "               See the server error log for details."
+       puts    "       </body>"
+       puts    "</html>"
+       exiting 1
+}
+
+foreach path [glob @@PREFIX@@/lib/koakuma/components/*.tcl] {
+       source "$path"
+}
+
+proc start_html {title} {
+       puts    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
+       puts    "<html>"
+       puts    "       <head>"
+       puts    "               <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
+       puts    "               <title>$title - Koakuma</title>"
+       puts    "       </head>"
+       puts    "       <body>"
+}
+proc end_html {} {
+       puts    "       </body>"
+       puts    "</html>"
+}
diff --git a/koakuma.png b/koakuma.png
new file mode 100644 (file)
index 0000000..0426f25
Binary files /dev/null and b/koakuma.png differ