2024-02-26 17:21:14 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
2024-12-07 21:46:30 +01:00
|
|
|
let
|
|
|
|
mediaRoot = "/var/www/tandoor-recipes/media/";
|
|
|
|
in
|
2024-11-20 20:32:38 +01:00
|
|
|
mkIf (elem "tandoor" config.machine.services) {
|
|
|
|
services.tandoor-recipes = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
2024-12-07 21:46:30 +01:00
|
|
|
# https://docs.tandoor.dev/system/configuration/
|
2024-11-20 20:32:38 +01:00
|
|
|
# Set explicitly so it can be referenced by web-server
|
2024-12-07 21:46:30 +01:00
|
|
|
MEDIA_ROOT = mediaRoot;
|
|
|
|
# Upstream likes to break stuff and apparently make it less insecure...
|
|
|
|
GUNICORN_MEDIA = "0";
|
|
|
|
SECRET_KEY_FILE = config.sops.secrets."services/tandoor/secretKey".path;
|
|
|
|
# Useful settings
|
|
|
|
# ENABLE_SIGNUP = "1";
|
|
|
|
# DEBUG = "1";
|
|
|
|
# DEBUG_TOOLBAR = "1";
|
|
|
|
# GUNICORN_LOG_LEVEL="debug";
|
2024-02-26 17:21:14 +01:00
|
|
|
};
|
2024-11-20 20:32:38 +01:00
|
|
|
};
|
2024-12-07 21:46:30 +01:00
|
|
|
systemd.services.tandoor-recipes.serviceConfig = {
|
|
|
|
ReadWritePaths = [ mediaRoot ];
|
|
|
|
WorkingDirectory = lib.mkForce "/var/lib/tandoor-recipes";
|
|
|
|
};
|
|
|
|
sops.secrets."services/tandoor/secretKey" = {
|
|
|
|
owner = "tandoor_recipes";
|
|
|
|
group = "tandoor_recipes";
|
|
|
|
};
|
2024-11-20 20:32:38 +01:00
|
|
|
}
|