diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9e00772 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM hasufell/alpine-haskell:3.16 AS build + +RUN cabal update + +COPY . /app/ + +WORKDIR /app + +RUN cabal update +RUN cabal build exe:fedi --enable-executable-static +RUN strip `cabal list-bin fedi` + +FROM scratch AS artifact +COPY --from=build /app/dist-newstyle/build/x86_64-linux/*/*/x/*/build/*/fedi . diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e23f8b2 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +.PHONY: format +format: + find ./src -type f -name "*.hs" -exec sh -c 'fourmolu -i {}' \; + find ./app -type f -name "*.hs" -exec sh -c 'fourmolu -i {}' \; + # find ./test -type f -name "*.hs" -exec sh -c 'fourmolu -i {}' \; + +.PHONY: clean +clean: + rm -rf ./newdist ./out ./dist-newstyle + +.PHONY: build +build: fedi.cabal cabal.project + cabal build all --enable-tests --enable-benchmarks + +.PHONY: serve +serve: + FEDI_DETAILS="test/public/details.json" cabal run fedi -- serve + +.PHONY: insert +insert: + FEDI_DETAILS="test/public/details.json" cabal run fedi -- insert note.html + +.PHONY: docker +docker: fedi.cabal cabal.project clean + DOCKER_BUILDKIT=1 docker build -o ./out/ . + file out/fedi diff --git a/todo.org b/todo.org new file mode 100644 index 0000000..effc58c --- /dev/null +++ b/todo.org @@ -0,0 +1,11 @@ +* Fedi +** DONE Outbox of notes +** DONE Inbox +** DONE Publish +** DONE HTTP Signatures +** DONE Follow me / Unfollow me +** TODO Test http signature +** TODO Test outbox +** TODO Test inbox + follow +** TODO Like my note +** TODO Reply to notes