From 0133cbdbd25929401c58e5c7112a2b5175d55b16 Mon Sep 17 00:00:00 2001 From: tobinio Date: Thu, 27 Aug 2026 17:09:50 +0200 Subject: [PATCH] taskline 3.0 --- flake.lock | 30 +++++++++++++------------- flake.nix | 2 +- hosts/homeserver/services/postgres.nix | 10 +++++++-- hosts/homeserver/services/taskline.nix | 12 +++++++++-- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/flake.lock b/flake.lock index 9fb8adb..f742a60 100644 --- a/flake.lock +++ b/flake.lock @@ -54,11 +54,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1787204541, - "narHash": "sha256-OURZPknrTjQrlNyxPdqzyqmU/81Wes1CUP/Ft1Rv/YI=", + "lastModified": 1787753485, + "narHash": "sha256-BZWCi9ZRJiARTuKTbbtvFTj7t1TK4G3UEckT3HyNfRg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5880666fd9eb563038431edb35c2d0aa595884e6", + "rev": "062346a6d85bc4b49dfaa61c986e9c5be21217d1", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1787360063, - "narHash": "sha256-dt4WdcvsA8/RCe+VZZwqU0X+XMM3wBbGCWA0/sFWzGo=", + "lastModified": 1787498568, + "narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c423e03bbafcff28bfadc6781a4a8257f205cb5", + "rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188", "type": "github" }, "original": { @@ -118,11 +118,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1785318670, - "narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=", + "lastModified": 1787135253, + "narHash": "sha256-RD2kNWCG+Bjo6h+JVjWVNntZs2GtRoeY2xHjts/FNkA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0954f7ee2f6bb3dc7d4e3d0d8bcb8fd4bde4cfc5", + "rev": "ffb3c9b700e759be2ef13237c9d8f953b32a1e46", "type": "github" }, "original": { @@ -187,16 +187,16 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1787224445, - "narHash": "sha256-rXM6SueO/thuHDZ57KOMWGPdX3aqVSMbNLWOo5WCbUw=", - "ref": "refs/tags/v2.4.4", - "rev": "6a37ad61feef4a8a48ba8c043e0b8706af00681b", - "revCount": 462, + "lastModified": 1787321226, + "narHash": "sha256-wFIQxQAglFi7vCffpfDJwwqHHm+gDnheoQTynNMieFg=", + "ref": "refs/tags/v3.0.0", + "rev": "3b63ca63d4e6ec0ba74b836d728bba59948f45ad", + "revCount": 468, "type": "git", "url": "https://tangled.org/tobinio.dev/task-line" }, "original": { - "ref": "refs/tags/v2.4.4", + "ref": "refs/tags/v3.0.0", "type": "git", "url": "https://tangled.org/tobinio.dev/task-line" } diff --git a/flake.nix b/flake.nix index cf12e59..534bd15 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }; lightcontrol.url = "git+https://tangled.org/tobinio.dev/light-control"; - taskline.url = "git+https://tangled.org/tobinio.dev/task-line?ref=refs/tags/v2.4.4"; + taskline.url = "git+https://tangled.org/tobinio.dev/task-line?ref=refs/tags/v3.0.0"; zen-browser = { url = "github:youwen5/zen-browser-flake"; diff --git a/hosts/homeserver/services/postgres.nix b/hosts/homeserver/services/postgres.nix index ee54acd..667c4d1 100644 --- a/hosts/homeserver/services/postgres.nix +++ b/hosts/homeserver/services/postgres.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { systemd.services.postgresql = { after = [ "docker.service" ]; @@ -8,13 +8,14 @@ services.postgresql = { enable = true; - settings.listen_addresses = pkgs.lib.mkForce "127.0.0.1,172.17.0.1"; + settings.listen_addresses = pkgs.lib.mkForce "127.0.0.1,192.168.0.202,172.17.0.1"; dataDir = "/srv/postgresql"; ensureDatabases = [ "nextcloud" "modrinth-statistics" + "taskline-storage" ]; ensureUsers = [ @@ -26,6 +27,10 @@ name = "modrinth-statistics"; ensureDBOwnership = true; } + { + name = "taskline-storage"; + ensureDBOwnership = true; + } { name = "admin"; } @@ -39,6 +44,7 @@ host all all 172.16.0.0/12 scram-sha-256 host all admin 127.0.0.1/32 scram-sha-256 + host all admin 192.168.0.0/24 scram-sha-256 host all admin ::1/128 scram-sha-256 ''; }; diff --git a/hosts/homeserver/services/taskline.nix b/hosts/homeserver/services/taskline.nix index da8c6af..5d2b3c0 100644 --- a/hosts/homeserver/services/taskline.nix +++ b/hosts/homeserver/services/taskline.nix @@ -19,6 +19,12 @@ API_WEBPUSH_PRIVATE_KEY=${config.sops.placeholder.api_webpush_private_key} ''; + users.users.taskline-storage = { + isSystemUser = true; + group = "taskline-storage"; + }; + users.groups.taskline-storage = {}; + systemd.services.taskline-backend = { description = "TaskLine Backend"; after = [ "network.target" ]; @@ -26,17 +32,19 @@ environment = { PORT = "3001"; - API_DATABASE_URL="sqlite:///srv/apps/taskline/data/storage.sqlite?mode=rwc"; + API_DATABASE_URL="postgresql://taskline-storage@localhost/taskline-storage?host=/run/postgresql"; API_AUTH_API_BASE="https://taskline.tobinio.dev"; API_SELF_API_BASE="https://taskline-api.tobinio.dev"; }; serviceConfig = { - ExecStart = "${inputs.taskline.packages.${pkgs.system}.backend}/bin/api"; + ExecStart = "${inputs.taskline.packages.${pkgs.system}.backend-postgres}/bin/api"; EnvironmentFile = config.sops.templates."taskline.api.env".path; + User = "taskline-storage"; + Restart = "always"; RestartSec = 5; -- 2.51.2