commit 6d469c8012c37b6723dcb180a4df3c023bae378b
parent 123e72cfd7f7eab149f171e4f55ad948243b954d
Author: Andrew Laack <andrew@laack.co>
Date: Sun, 15 Nov 2026 11:52:21 -0600
Starting with work on lighttpd stuff
Diffstat:
10 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,3 @@
+cgi/
+_build
+_build*
diff --git a/Makefile b/Makefile
@@ -0,0 +1,19 @@
+ocaml:
+ cd ojudge && dune build
+ cp ojudge/_build/default/bin/index.exe cgi
+
+ensure-config:
+ id http # required for lighttpd
+ensure-deps:
+ lighttpd -h
+ dune --version
+ opam --version
+ echo "All dependencies were already installed"
+start-server:
+ sudo rm -rf /srv/http/ojudge
+ sudo mkdir -p /srv/http/ojudge
+ sudo cp -r cgi /srv/http/ojudge/
+ sudo cp config/lighttpd.conf /etc/lighttpd/lighttpd.conf
+ sudo systemctl stop lighttpd
+ sudo systemctl start lighttpd
+ sudo systemctl enable lighttpd
diff --git a/config/lighttpd.conf b/config/lighttpd.conf
@@ -0,0 +1,11 @@
+server.document-root = "/srv/http/ojudge/cgi/"
+server.port = 80
+server.username = "http"
+server.groupname = "http"
+
+static-file.exclude-extensions = ( "*")
+
+server.modules += ( "mod_cgi" )
+
+cgi.assign = (".exe" => "")
+index-file.names = ( "index.exe" )
diff --git a/ojudge/bin/dune b/ojudge/bin/dune
@@ -0,0 +1,4 @@
+(executable
+ (public_name ojudge)
+ (name main)
+ (libraries ojudge))
diff --git a/ojudge/bin/main.ml b/ojudge/bin/main.ml
@@ -0,0 +1 @@
+let () = print_endline "Hello, World!"
diff --git a/ojudge/dune-project b/ojudge/dune-project
@@ -0,0 +1,26 @@
+(lang dune 3.24)
+
+(name ojudge)
+
+(generate_opam_files true)
+
+(source
+ (github username/reponame))
+
+(authors "Author Name <author@example.com>")
+
+(maintainers "Maintainer Name <maintainer@example.com>")
+
+(license LICENSE)
+
+(documentation https://url/to/documentation)
+
+(package
+ (name ojudge)
+ (synopsis "A short synopsis")
+ (description "A longer description")
+ (depends ocaml)
+ (tags
+ ("add topics" "to describe" your project)))
+
+; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html
diff --git a/ojudge/lib/dune b/ojudge/lib/dune
@@ -0,0 +1,2 @@
+(library
+ (name ojudge))
diff --git a/ojudge/ojudge.opam b/ojudge/ojudge.opam
@@ -0,0 +1,32 @@
+# This file is generated by dune, edit dune-project instead
+opam-version: "2.0"
+synopsis: "A short synopsis"
+description: "A longer description"
+maintainer: ["Maintainer Name <maintainer@example.com>"]
+authors: ["Author Name <author@example.com>"]
+license: "LICENSE"
+tags: ["add topics" "to describe" "your" "project"]
+homepage: "https://github.com/username/reponame"
+doc: "https://url/to/documentation"
+bug-reports: "https://github.com/username/reponame/issues"
+depends: [
+ "dune" {>= "3.24"}
+ "ocaml"
+ "odoc" {with-doc}
+]
+build: [
+ ["dune" "subst"] {dev}
+ [
+ "dune"
+ "build"
+ "-p"
+ name
+ "-j"
+ jobs
+ "@install"
+ "@runtest" {with-test}
+ "@doc" {with-doc}
+ ]
+]
+dev-repo: "git+https://github.com/username/reponame.git"
+x-maintenance-intent: ["(latest)"]
diff --git a/ojudge/test/dune b/ojudge/test/dune
@@ -0,0 +1,3 @@
+(test
+ (name test_ojudge)
+ (libraries ojudge))
diff --git a/ojudge/test/test_ojudge.ml b/ojudge/test/test_ojudge.ml