summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2020-04-04 11:55:39 +0200
committerStefan Kreutz <mail@skreutz.com>2020-04-05 03:23:59 +0200
commit394e05445225984057cca0c2eaef8fc8eab1aeab (patch)
treec8e45d9afa7b694180d5c399c1e7681f0a06947c
parent0666b74cc8ea74ce8c440c3cde5598774fcc3bc4 (diff)
downloadautoinstall-openbsd-on-qemu-394e05445225984057cca0c2eaef8fc8eab1aeab.tar
Add script to install kaphod
-rw-r--r--disklabel2
-rwxr-xr-xinstall_kapho51
2 files changed, 52 insertions, 1 deletions
diff --git a/disklabel b/disklabel
index d3b88fd..eb4c5ea 100644
--- a/disklabel
+++ b/disklabel
@@ -1,4 +1,4 @@
-/ 1G
+/ 2G
swap 8G
/tmp 1G
/var 1G
diff --git a/install_kapho b/install_kapho
new file mode 100755
index 0000000..ac6bc87
--- /dev/null
+++ b/install_kapho
@@ -0,0 +1,51 @@
+#! /bin/sh
+
+set -o errexit
+set -o xtrace
+
+revision="$( git rev-parse --short HEAD )"
+
+if [ ! -e "kapho-${revision}.tar.gz" ] ;
+then
+ git archive \
+ --prefix="kapho-${revision}/" \
+ --output="kapho-${revision}.tar.gz" \
+ "${revision}"
+fi
+
+scp \
+ -o "StrictHostKeyChecking no" \
+ -o "UserKnownHostsFile /dev/null" \
+ -o "Port 2222" \
+ "kapho-${revision}.tar.gz" \
+ puffy@127.0.0.1:
+
+# shellcheck disable=SC2087
+ssh \
+ -o "StrictHostKeyChecking no" \
+ -o "UserKnownHostsFile /dev/null" \
+ -o "Port 2222" \
+ -T \
+ puffy@127.0.0.1 << SSHEOF
+set -o errexit
+set -o xtrace
+
+rm -rf "kapho-${revision}"
+tar -xzf "kapho-${revision}.tar.gz"
+cd "kapho-${revision}"
+doas ./script/openbsd/setup
+CABAL_JOBS=4 ./script/openbsd/build
+doas ./script/openbsd/install
+doas rcctl ls on | grep -q kaphod && exit 0
+cat test_user.sql | doas -u _kapho sqlite3 /var/www/kapho/database.sqlite3
+cat << EOF | doas tee /etc/kapho/kaphod.conf >/dev/null
+port = "80"
+secureCookies = False
+thumbnailGeneratorThreadLimit = 4
+EOF
+doas rcctl set kaphod status on
+doas rcctl start kaphod
+
+# FIXME: Need to restart kaphod once to resolve connection refused error.
+doas rcctl restart kaphod
+SSHEOF
Generated by cgit. See skreutz.com for my tech blog and contact information.