From b601bdd79693b7fae04542c772a91db17b254f20 Mon Sep 17 00:00:00 2001 From: stuce-bot Date: Wed, 25 Jun 2025 14:08:37 +0200 Subject: [PATCH 01/34] updated tarball --- flake.nix | 10 +++++----- stack.yaml | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 8cec79d..d7222c2 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ nixpkgs, }: let tarball = fetchTarball { - url = "https://git.stuce.ch/stuce/sTodo/releases/download/Release1/release1.tar.gz"; + url = "https://git.stuce.ch/stuce/sTodo/releases/download/Release2/release2.tar.gz"; sha256 = "10jyldwmcs5zyz1k8lp3jscn7nhlvn56g0709l5jp91qimw7xiqz"; }; in { @@ -68,10 +68,10 @@ environment.systemPackages = [pkgs.openssl]; users.groups."sTodo".name = "sTodo"; users.users."sTodo" = { - name = "sTodo"; - isSystemUser = true; - group = "sTodo"; - }; + name = "sTodo"; + isSystemUser = true; + group = "sTodo"; + }; systemd.services.sTodo.preStart = '' [ -f ${sessionKey} ] || { "${pkgs.openssl}/bin/openssl" rand 256 > ${sessionKey} diff --git a/stack.yaml b/stack.yaml index be7a8b4..3092e82 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,6 +20,10 @@ snapshot: url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/26.yaml +nix: + enable: true + pure: false + # User packages to be built. # Various formats can be used as shown in the example below. # From c84fa67136162cef2d54246e5631842c2ebf8b03 Mon Sep 17 00:00:00 2001 From: stuce-bot Date: Wed, 25 Jun 2025 15:47:12 +0200 Subject: [PATCH 02/34] . --- flake.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index d7222c2..3896e0e 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }: let tarball = fetchTarball { url = "https://git.stuce.ch/stuce/sTodo/releases/download/Release2/release2.tar.gz"; - sha256 = "10jyldwmcs5zyz1k8lp3jscn7nhlvn56g0709l5jp91qimw7xiqz"; + sha256 = "10jyldwmcs5zyz1k8lp3jsdn7nhlvn56g0709l5jp91qimw7xiqz"; }; in { packages.x86_64-linux.sTodo = with nixpkgs.legacyPackages.x86_64-linux; @@ -19,7 +19,8 @@ pname = "sTodo"; version = "1.0.0"; src = tarball; - buildInputs = [zlib gmp libffi openssl]; + buildInputs = [zlib gmp libffi]; + nativeBuildInputs = [openssl]; installPhase = '' mkdir -p $out/bin cp $src/sTodo $out/bin From c259f6dc1ae8ac467adb08aaf96aad227340d1d2 Mon Sep 17 00:00:00 2001 From: stuce-bot Date: Wed, 25 Jun 2025 16:19:18 +0200 Subject: [PATCH 03/34] fixed link --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 3896e0e..7756549 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ nixpkgs, }: let tarball = fetchTarball { - url = "https://git.stuce.ch/stuce/sTodo/releases/download/Release2/release2.tar.gz"; + url = "https://git.stuce.ch/stuce/sTodo/releases/download/r2/release2.tar.gz"; sha256 = "10jyldwmcs5zyz1k8lp3jsdn7nhlvn56g0709l5jp91qimw7xiqz"; }; in { From e2c414f1085dd89a2de40f552769b3fd526dbf4c Mon Sep 17 00:00:00 2001 From: stuce-bot Date: Wed, 25 Jun 2025 16:26:04 +0200 Subject: [PATCH 04/34] fixed sha --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 7756549..243cf0c 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }: let tarball = fetchTarball { url = "https://git.stuce.ch/stuce/sTodo/releases/download/r2/release2.tar.gz"; - sha256 = "10jyldwmcs5zyz1k8lp3jsdn7nhlvn56g0709l5jp91qimw7xiqz"; + sha256 = "11mmq60w5da42mzlckizbrgnpzzj8a8jz69ap5k86zh6a536v456"; }; in { packages.x86_64-linux.sTodo = with nixpkgs.legacyPackages.x86_64-linux; From 596c830febb89494d1a4119f4166e3ce775fa566 Mon Sep 17 00:00:00 2001 From: stuce Date: Wed, 25 Jun 2025 17:03:58 +0200 Subject: [PATCH 05/34] Update README.md tested, it works --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aacc35a..4840165 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Stuce's simple todo is a web app that let's you self host a simple todolist. The goal is to provide a minimalistic and fast todo list that is self hostable. ## Next goals - Make multi user support - - [ ] Get user by trusted header + - [x] Get user by trusted header - [ ] Add option to enable single user (usefull for vpn single user easy setup) - [ ] Add menu to add other users to the group - [ ] make the code more readable by renaming/moving the handlers better From ee6d6de2124b52525da2d1324e266e3001e728dc Mon Sep 17 00:00:00 2001 From: stuce Date: Wed, 25 Jun 2025 17:05:46 +0200 Subject: [PATCH 06/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4840165..7579f1c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The goal is to provide a minimalistic and fast todo list that is self hostable. - [ ] write a minimal step by step guide to install with nix, - [ ] add some css to make it look nicer - [ ] add htmx to make more agreable without making js manadatory -## Version 1.0.0 +## Version 0.0.0 Simple todo list for **single user only** at the moment. Features : - add and delete (and soon share) groups that contain a list of todolists From 81ca02948bf357f98bede859e45d5e5cd975ec24 Mon Sep 17 00:00:00 2001 From: Stuce Date: Wed, 25 Jun 2025 17:03:00 +0100 Subject: [PATCH 07/34] qol improvements --- config/routes.yesodroutes | 3 ++ src/Handler/TodoEntry.hs | 77 +++++++++++++++++++++++++++------------ 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/config/routes.yesodroutes b/config/routes.yesodroutes index 9413671..86f2549 100644 --- a/config/routes.yesodroutes +++ b/config/routes.yesodroutes @@ -16,8 +16,11 @@ /check/group/#GroupId/todolist/#TodolistId/#TodolistItemId CheckTodolistItemR POST /edit/group/#GroupId/todolist/#TodolistId EditTodolistItemsR GET POST +/sort/group/#GroupId/todolist/#TodolistId SortTodolistItemsR POST +/trim/group/#GroupId/todolist/#TodolistId TrimTodolistItemsR POST /edit/group/#GroupId EditTodolistR GET POST +/adduser/group/#GroupId AddUserR POST /edit EditGroupR GET POST /delete DeleteGroupR POST diff --git a/src/Handler/TodoEntry.hs b/src/Handler/TodoEntry.hs index b49ac60..11f7fb2 100644 --- a/src/Handler/TodoEntry.hs +++ b/src/Handler/TodoEntry.hs @@ -12,6 +12,7 @@ module Handler.TodoEntry where import Import import Text.Read import Database.Persist.Sql (rawExecute, fromSqlKey, toSqlKey) +import GHC.RTS.Flags (TraceFlags(user)) -- TODO: move this back to another handler getHomeR :: Handler Html getHomeR = do @@ -71,12 +72,21 @@ getTodolistR groupId = do $maybe token <- mToken