Compare commits

...

13 Commits
ci ... main

Author SHA1 Message Date
Paul Brinkmeier
cf583f5ff6 Change showpdf to showpdfjs
All checks were successful
deliver / deliver (push) Successful in 6m56s
2025-10-19 11:05:15 +02:00
d3dbb6e673 Clean up after dbmate
All checks were successful
deliver / deliver (push) Successful in 1m51s
2025-10-07 18:09:29 +02:00
Paul Brinkmeier
851b3a6076 Use mktemp for dbmate invocation 2025-10-07 17:33:07 +02:00
Paul Brinkmeier
dbc3103980 Don't use /tmp...
All checks were successful
deliver / deliver (push) Successful in 1m48s
2025-10-07 17:07:12 +02:00
Paul Brinkmeier
2dacd4f747 Use /tmp for running dbmate
All checks were successful
deliver / deliver (push) Successful in 2m6s
2025-10-07 16:48:53 +02:00
94ede9a168 Use SIGINT as container StopSignal
Some checks failed
deliver / deliver (push) Failing after 20s
2025-10-07 13:47:12 +02:00
Paul Brinkmeier
c38574e005 Add exec in entrypoint
All checks were successful
deliver / deliver (push) Successful in 1m40s
2025-10-07 13:26:46 +02:00
Paul Brinkmeier
700d53fbb0 Update todo list 2025-10-07 13:09:24 +02:00
Paul Brinkmeier
c5c11ed181 Don't buffer stdout
All checks were successful
deliver / deliver (push) Successful in 1m36s
2025-10-07 12:53:14 +02:00
36c9b880a7 Merge pull request 'Add entrypoint script and cacerts to image' (#2) from image-entry into main
Reviewed-on: #2
2025-10-07 12:50:53 +02:00
c25ead672b Add entrypoint script and cacerts to image
All checks were successful
deliver / deliver (push) Successful in 2m0s
build / build (pull_request) Successful in 16s
2025-10-07 12:43:48 +02:00
Paul Brinkmeier
4a6e3b2454 Reformat image flake output 2025-10-07 10:28:30 +02:00
b739294638 Merge pull request 'CI' (#1) from ci into main
Reviewed-on: #1
2025-10-07 01:17:42 +02:00
5 changed files with 46 additions and 15 deletions

View File

@ -41,8 +41,10 @@ By setting `$BASE_DIR` you can persist the database for later runs.
## TODO
- CI
- Docker container (in flake)
- try fourmolu
- Test leap second handling in the `time` package
- use queue to sync logging of indexer and main thread
- [x] CI
- [x] Docker container (in flake)
- [x] try fourmolu
- [x] Test leap second handling in the `time` package
- [ ] Fix container shutdown delay
- [ ] Fix `responseFile` always returning 200
- [ ] use queue to sync logging of indexer and main thread

View File

@ -65,6 +65,7 @@ import Data.Time.Clock.POSIX (getPOSIXTime)
import qualified Envy
import qualified Yore.DB as DB
import qualified Yore.Log as Log
import System.IO (hSetBuffering, BufferMode (..), stdout)
data ConfigT f = Config
{ yorePort :: f =@@ Int ? 3000
@ -79,6 +80,8 @@ deriving instance Show Config
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
cfg <-
Envy.load @ConfigT >>= \case
Left errs -> do

View File

@ -58,22 +58,48 @@
# Return only the bin folder to curb image size
compose.justStaticExecutables
];
image =
pkgs.dockerTools.buildImage {
name = "git.pbrinkmeier.de/paul/yore";
tag = yore.version;
copyToRoot = [ pkgs.cacert ];
config = {
Cmd = [ "${entrypoint}/bin/run" ];
StopSignal = "SIGINT";
};
};
entrypoint = pkgs.writeShellApplication {
name = "run";
runtimeInputs = [ pkgs.coreutils pkgs.dbmate yore ];
text = ''
set -Eeuo pipefail
mkdir -p "''${YORE_DBMATE_DIR}"
TMPDIR=$(mktemp -dp "''${YORE_DBMATE_DIR}")
mkdir -p "''${TMPDIR}/db"
cp -r ${./db}/* "''${TMPDIR}/db"
cd "''${TMPDIR}"
dbmate up
chmod +w -R "''${TMPDIR}"
rm -rf "''${TMPDIR}"
# Replace bash and inherit PID 1
cd /
exec yore
'';
};
in {
packages = rec {
default = yore;
inherit yore;
inherit yore image;
yore-meta = pkgs.runCommand "yore-meta" {} ''
mkdir -p $out
echo -n ${yore.version} > $out/version
echo -n git.pbrinkmeier.de/paul/yore:${yore.version} > $out/image-tag
echo -n ${image.drvAttrs.imageName}:${image.drvAttrs.imageTag} > $out/image-tag
'';
image =
pkgs.dockerTools.buildImage {
name = "git.pbrinkmeier.de/paul/yore";
tag = yore.version;
config.Cmd = [ "${yore}/bin/yore" ];
};
opium_ = opium.packages.${system}.opium;
};

View File

@ -112,7 +112,7 @@ showpdfRequest (y, m, d) =
NoReqBody
bsResponse
( formToQuery
[ ("cmd" :: Text, "showpdf")
[ ("cmd" :: Text, "showpdfjs")
, ("year", y)
, ("month", m)
, ("day", d)

View File

@ -1,7 +1,7 @@
cabal-version: 3.4
name: yore
version: 0.0.1
version: 0.0.9
author: Paul Brinkmeier
maintainer: hallo@pbrinkmeier.de
copyright: 2023 Paul Brinkmeier