Skip to content

Commit

Permalink
Upgrade to OCaml 4.07 and Mirage 3.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
talex5 committed Jan 8, 2020
1 parent 3ed762e commit 998b5ba
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 29 deletions.
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
_build
.merlin
server/Makefile
server/cuekeeper_libvirt.xml
server/main.ml
server/main.native
server/cuekeeper.xl.in
server/mir-cuekeeper
server/static.ml
server/static1.ml*
server/log
server/conf
server/devices.ml
cuekeeper-bin-*
cuekeeper-bin-*.zip
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM ocaml/opam2:debian-10-opam@sha256:79636246d69ee9d285c87af8a078d2dcc1c893d75e40c581da3284da6cf1841c
#FROM ocaml/opam2:debian-10-opam
ENV DEBIAN_FRONTEND=noninteractive
RUN sudo apt-get -y update && sudo apt-get -y install aspcud zip m4 autoconf build-essential gcc-multilib ca-certificates git rsync time --no-install-recommends
RUN opam init --comp=4.05.0+32bit --disable-sandboxing
FROM ocurrent/opam:debian-10-ocaml-4.07@sha256:2f9a9fc195b29f1006d0f97ae4c6300fb175800703b12a15b51583a1f7a547b7
#FROM ocurrent/opam:debian-10-ocaml-4.07
RUN opam pin add -yn reactiveData https://github.com/hhugo/reactiveData.git
RUN opam pin add -yn irmin-git.1.4.0 https://github.com/talex5/irmin.git#1.4.0-cuekeeper
RUN opam pin add -yn irmin-indexeddb.1.3 https://github.com/talex5/irmin-indexeddb.git#irmin-1.3
RUN mkdir /home/opam/cuekeeper
COPY --chown=opam cuekeeper.opam /home/opam/cuekeeper/
WORKDIR /home/opam/cuekeeper
RUN opam install --solver=aspcud -y -t --deps-only .
RUN opam pin add -yn cuekeeper.dev .
RUN opam depext -t cuekeeper
RUN opam install -t --deps-only cuekeeper
ENTRYPOINT ["opam", "config", "exec", "--"]
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CueKeeper
=========

Copyright Thomas Leonard, 2019
Copyright Thomas Leonard, 2020

CueKeeper is a web-based [GTD][] system (a fancy TODO list) that runs entirely in your browser (the data is stored on your computer, in your browser).

Expand Down Expand Up @@ -46,10 +46,10 @@ Building (without Docker)
-------------------------

You'll need the [opam](http://opam.ocaml.org/) package manager.
It should be available through your distribution, but you can use a [generic opam binary](http://tools.ocaml.org/opam.xml) if it's missing or too old (I use opam 1.2.2).
Ensure you're using OCaml 4.05.0 (check with `ocaml -version`). If not, switch to that version:
It should be available through your distribution, but you can use a [generic opam binary](http://tools.ocaml.org/opam.xml) if it's missing or too old (I use opam 2.0.4).
Ensure you're using OCaml 4.07.1 (check with `ocaml -version`). If not, switch to that version:

opam switch create 4.05.0
opam switch create 4.07.1

Pin a few patches we require:

Expand All @@ -59,7 +59,9 @@ Pin a few patches we require:

Install the dependencies (`-t` includes the test dependencies too):

opam install --deps-only -t .
opam pin add -yn cuekeeper.dev .
opam depext -t cuekeeper
opam install --deps-only -t cuekeeper

Build:

Expand All @@ -68,7 +70,7 @@ Build:
Load `test.html` in a browser to test locally (no server required).

Note that this defaults to "dev" mode, where the Javascript generated will be very large (about 9 MB) and not optimised.
To get a smaller file, use `dune build --profile=release ./js/client.bc.js` (should be about 950 KB).
To get a smaller file, use `dune build --profile=release ./js/client.bc.js` (should be about 980 KB).


Running a server
Expand Down Expand Up @@ -107,7 +109,7 @@ Make sure the `None` line comes last - this rejects all unknown tokens.

To build the server component:

opam pin add mirage 3.5.2
opam pin mirage 3.7.3
make server

You will be prompted to create a self-signed X.509 certificate. Just enter your server's hostname
Expand Down Expand Up @@ -148,7 +150,7 @@ Deploying as a Xen VM

In fact, the server is a [Mirage unikernel][mirage] and can also be compiled and booted as a Xen virtual machine:

make server MIRAGE_FLAGS="--xen"
make server MIRAGE_FLAGS="-t xen"
cd server
xl create -c cuekeeper.xl

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/git_storage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module IO = struct
type out_channel = Buffer.t
let really_input _ch _buf _pos _len = failwith "unused"
let input = really_input
let output = Buffer.add_substring
let output = Buffer.add_subbytes
let close_out _ = ()
end

Expand Down
21 changes: 21 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
conf
config
cuekeeper
cuekeeper_libvirt.xml
cuekeeper.xl.in
devices.ml
dune
dune.build
dune.config
dune-project
*.install
key_gen.ml
main.ml
main.native
Makefile
.mirage.config
mir-cuekeeper
myocamlbuild.ml
*.opam
static1.ml*
static.ml
6 changes: 3 additions & 3 deletions server/unikernel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ module Store = Irmin_git.Mem.Make(IO)(Git.Inflate.None)
(Irmin.Contents.String)(Irmin.Path.String_list)(Irmin.Branch.String)

module Main
(Stack:Mirage_stack_lwt.V4)
(Conf:Mirage_kv_lwt.RO)
(Clock:Mirage_clock_lwt.PCLOCK) = struct
(Stack:Mirage_stack.V4)
(Conf:Mirage_kv.RO)
(Clock:Mirage_clock.PCLOCK) = struct
module TCP = Stack.TCPV4
module TLS = Tls_mirage.Make (TCP)
module X509 = Tls_mirage.X509 (Conf) (Clock)
Expand Down

0 comments on commit 998b5ba

Please sign in to comment.