Copy glitchtip working files to a writeable directory

It's not configurable, but it works, and was able to take my build
system upload.
This commit is contained in:
Eli Ribble 2025-08-27 17:38:37 +00:00
parent 1f663c3e42
commit a12f1c409d

View file

@ -171,7 +171,8 @@ in
wants = [ "network-online.target" ];
requires =
lib.optional cfg.database.createLocally "postgresql.service"
[ "glitchtip-setup.service" ]
++ lib.optional cfg.database.createLocally "postgresql.service"
++ lib.optional cfg.redis.createLocally "redis-glitchtip.service";
after = [
"network-online.target"
@ -188,7 +189,7 @@ in
RuntimeDirectory = "glitchtip";
StateDirectory = "glitchtip";
EnvironmentFile = cfg.environmentFiles;
WorkingDirectory = "${pkg}/lib/glitchtip";
WorkingDirectory = "/var/lib/glitchtip";
# hardening
AmbientCapabilities = "";
@ -242,6 +243,17 @@ in
};
};
glitchtip-setup = {
description = "Setup GlitchTip working directory";
serviceConfig = {
Type = "simple";
#${lib.getExe python.pkgs.gunicorn} \
ExecStartPre="${lib.getExe' pkgs.coreutils "cp"} -pur ${pkg}/lib/glitchtip /var/lib";
ExecStart="/run/current-system/sw/bin/chown -R glitchtip: /var/lib/glitchtip";
Restart="on-abort";
};
};
glitchtip-worker = commonService // {
description = "GlitchTip Job Runner";