From 57e884fb0310bc52b199fe2a686175d106fb23a7 Mon Sep 17 00:00:00 2001 From: David Turnbull Date: Fri, 26 Apr 2019 11:41:31 +1000 Subject: [PATCH 1/3] fix postfix apt installation & remove ** usage so cabal copy works. --- Dockerfile | 4 ++-- hackage-server.cabal | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5913057f2..8457a305e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ RUN apt-add-repository ppa:hvr/ghc RUN apt-get update # Dependencies -RUN apt-get install -yy unzip libicu-dev postfix -RUN apt-get install -y ghc-8.2.1 cabal-install-2.0 +RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy unzip libicu-dev postfix +RUN apt-get install -y ghc-8.2.2 cabal-install-2.4 ENV PATH /opt/ghc/bin:$PATH RUN cabal update diff --git a/hackage-server.cabal b/hackage-server.cabal index 181369b38..4d709882a 100644 --- a/hackage-server.cabal +++ b/hackage-server.cabal @@ -31,13 +31,19 @@ tested-with: GHC ==8.4.4 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 data-dir: datafiles data-files: - templates/**/*.st - - static/**/*.css - static/**/*.js - static/**/*.svg - static/**/*.png - static/**/*.ico + templates/AdminFrontend/*.st + templates/EditCabalFile/*.st + templates/Html/*.st + templates/LegacyPasswds/*.st + templates/Search/*.st + templates/UserSignupReset/*.st + templates/Users/*.st + + static/datatables/*.css + static/datatables/*.js + static/icons/*.svg + static/images/*.png + static/*.ico TUF/README.md TUF/mirrors.json From bde03585e678badf7b620a8570fff93ce656640e Mon Sep 17 00:00:00 2001 From: David Turnbull Date: Fri, 26 Apr 2019 15:46:55 +1000 Subject: [PATCH 2/3] fix example usage in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c520eea2..39a40341f 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ you can find these as the file names of the files created in `signed.roles.root.keyids`). An example `cabal` client configuration might look something like - remote-repo my-private-hackage + repository my-private-hackage url: http://example.com:8080/ secure: True root-keys: 865cc6ce84231ccc990885b1addc92646b7377dd8bb920bdfe3be4d20c707796 From b73f96013307d780f132e958400872b49028bea7 Mon Sep 17 00:00:00 2001 From: David Turnbull Date: Tue, 18 Jun 2019 10:43:59 +1000 Subject: [PATCH 3/3] use v2- prefixed cabal commands --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8457a305e..a2e1280b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy unzip libicu-dev postfix RUN apt-get install -y ghc-8.2.2 cabal-install-2.4 ENV PATH /opt/ghc/bin:$PATH -RUN cabal update +RUN cabal v2-update # Required Header files RUN apt-get install -y zlib1g-dev libssl-dev @@ -35,13 +35,11 @@ RUN apt-get install -y zlib1g-dev libssl-dev RUN mkdir /build WORKDIR /build ADD ./hackage-server.cabal ./hackage-server.cabal -RUN cabal sandbox init -# TODO: Switch to Nix-style cabal new-install -RUN cabal install --only-dependencies --enable-tests -j --force-reinstalls -ENV PATH /build/.cabal-sandbox/bin:$PATH +RUN cabal v2-install -j --force-reinstalls +ENV PATH /root/.cabal/bin:$PATH # needed for creating TUF keys -RUN cabal install hackage-repo-tool +RUN cabal v2-install hackage-repo-tool # add code # note: this must come after installing the dependencies, such that @@ -56,13 +54,13 @@ RUN hackage-repo-tool create-root --keys keys -o datafiles/TUF/root.json RUN hackage-repo-tool create-mirrors --keys keys -o datafiles/TUF/mirrors.json # build & test & install hackage -RUN cabal configure -f-build-hackage-mirror --enable-tests -RUN cabal build +RUN cabal v2-configure -f-build-hackage-mirror --enable-tests +RUN cabal v2-build # tests currently don't pass: the hackage-security work introduced some # backup/restore errors (though they look harmless) # see https://github.com/haskell/hackage-server/issues/425 #RUN cabal test -RUN cabal copy && cabal register +RUN cabal v2-install all # setup server runtime environment RUN mkdir /runtime