161 Commits

Author SHA1 Message Date
086c3e2ebb Make first time setup more robust. (#58)
Split out prerequisite validation from creation. Distinguish system prereqs from application prereqs. Support URL autodetection to eliminate requirement to edit file as part of setup.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/58
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-05 21:48:10 +00:00
e5945e91a3 Add error handling to remaining controllers. (#56)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/56
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-05 00:44:27 +00:00
d9d0ed9571 Add error handling for external dependencies. (#55)
Protect functions that interact with databases and filesystems.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/55
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-04 11:46:55 +00:00
51abf33ad1 Optimize initialization logic and simplify error handling. (#54)
Consolidate prerequisite tests - include database migrations.
Remove SetupException and fold database initialization error handling into prereqs.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/54
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-04 01:54:45 +00:00
7816581216 Focus unit tests on business logic and fix log test state pollution (#53)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/53
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-04 01:19:45 +00:00
832b7b95fa Remove all static model methods. (#52)
Replace all static model methods. Support dependency injection for all models. Clean up things that used the static model methods. Decouple ConfigModel and CssModel.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/52
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-03 19:15:24 +00:00
dc4f60ce2e refactor-app-initialization (#51)
Separate database migrations from other database initialization functions.
Move some initialization directly into index to keep classes targeted.
Simplify setup validation and redirection logic.
Clean up comments.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/51
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-03 16:04:06 +00:00
2e82f946ae Add TickController tests and logs (#50)
Closes https://gitea.subcultureofone.org/greg/tkr/issues/45

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/50
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-02 20:57:01 +00:00
0b0fd29913 simplify-dependency-injection (#44)
Closes https://gitea.subcultureofone.org/greg/tkr/issues/43

Use a global $app dictionary to manage global state rather than having complex class constructors that expect three input arguments. Update and fix tests. Add tests for Util class functions that broke in the refactor.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/44
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-02 19:52:33 +00:00
9593a43cc0 make-homepage-testable (#42)
Add logging and tests for the homepage and settings page. Make both support dependency injection.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/42
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-02 01:43:48 +00:00
879bd9ff9f Move route logging to router and log missing routes as warnings. 2025-08-01 14:21:28 -04:00
a7e79796fa Add log viewer and tests for the logs and the viewer (#41)
Now that I'm adding more logging, I wanted to add a log viewer so people don't have to ssh to their servers to inspect logs. Also added tests around logging and the viewer.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/41
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-01 01:52:45 +00:00
dc0abf8c7c Add debug logging to feeds. Add route info to all debug logs. (#39)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/39
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-31 13:19:35 +00:00
8b5a249450 Make URL building more resilient and add tests. (#38)
Since the base URL and base path are user inputs, I'd like tkr to be resilient to any combination of leading and trailing slashes so people don't have to worry about that. This adds some helper functions to normalize URLs and adds tests to confirm that all combinations are handled correctly.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/38
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-31 02:39:09 +00:00
a9f610fc60 Make home page similar to feeds. Simplify tick retrieval. (#37)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/37
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-31 01:30:25 +00:00
dc63d70944 Refactor feeds to be more testable and to remove templates. (#36)
Move feed generation into generator classes and out of templates. Remove feed templates, since they don't have any UI elements.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/36
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-31 00:05:46 +00:00
bb58e09cbf add-runtime-logging (#35)
Set up logging framework and add runtime logging to foundational operations (database, sessions, auth).

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/35
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-29 22:45:17 +00:00
659808f724 Add prereq script to package build. (#32)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/32
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-28 01:45:39 +00:00
681f64c527 Add prereq check to README. Remove installation by cloning. Fix CI typos. (#31)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/31
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-28 01:04:46 +00:00
dc44d51479 Add posix_getuid detection to the right place. 2025-07-27 15:33:15 -04:00
3c0f2a2ca5 Skip root test if POSIX PHP extension not installed (e.g. alpine) 2025-07-27 15:14:34 -04:00
64e2ff56da add instructions for setting permissions when CLI is run as root. 2025-07-27 14:50:42 -04:00
fb0b58dcbf Don't recomment curl php extension. 2025-07-27 14:20:32 -04:00
53ed66dce9 Name .yaml files consistently. 2025-07-27 12:48:49 -04:00
b53d58df8c Run prereq check on push to catch PR merge. 2025-07-27 12:45:18 -04:00
6337fa2dfb Add Prerequisite class and cli script to confirm prereqs. (#30)
Add a Prerequisite class to manage all initilaization prerequisites. Invoke before each request. Provide a CLI script to allow checking Prereqs from command line. Add CI  workflow to confirm prereq validation behavior.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/30
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-27 16:43:09 +00:00
4255f46fc7 Fix database migrations for first-time setup. (#29)
The database initialization had a number of bugs for the first-time setup. This PR fixes them.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/29
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-26 15:46:06 +00:00
edd7f6effe Closes #24 (#27)
Remove all references to `storage/ticks`, including code that migrates those files.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/27
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-24 19:53:12 +00:00
3867bc36cf Closes #25 (#26)
Co-authored-by: Greg Sarjeant <1686767+gsarjeant@users.noreply.github.com>
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/26
2025-07-24 18:49:32 +00:00
b40a4dce18 Remove no-longer-used settings (#23)
Simplifying the app.

The "about" profile field is somewhat redundant. There's already a site title and description.
I'm removing mood emoji from the ticks and just using the user-level mood. That toggle is no longer necessary.

Co-authored-by: Greg Sarjeant <1686767+gsarjeant@users.noreply.github.com>
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/23
2025-07-24 13:28:47 +00:00
Greg Sarjeant
c7acca6bb3 Fix validation error and bootstrap order of operations issue. 2025-07-23 23:27:02 -04:00
Greg Sarjeant
f5123e5044 Remove backup database. 2025-07-23 22:13:46 -04:00
9338332536 refactor-storage (#19)
Move ticks from filesystem into database.

I'm going to preserve the filesystem and just delete it manually. I'll add a login warning, but I'm pretty sure I'm the only person who'll ever be affected by this.

Co-authored-by: Greg Sarjeant <1686767+gsarjeant@users.noreply.github.com>
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/19
2025-07-24 02:12:31 +00:00
Greg Sarjeant
7b7f8d205d Convert test to use DataProvider. Add cleanup TODO to relativeTime 2025-07-07 08:48:29 -04:00
Greg Sarjeant
81123945f4 remove unused fuction 2025-07-04 21:42:35 -04:00
Greg Sarjeant
075155adf5 job name underscores to hyphens 2025-07-04 10:49:52 -04:00
Greg Sarjeant
3914d50dbc Fix build and publish workflow name. Add status badge for tests. 2025-07-02 21:30:18 -04:00
Greg Sarjeant
77dfefa794 minor indentation tweak 2025-07-02 21:04:47 -04:00
Greg Sarjeant
56f3af14a8 Fix tar command 2025-07-02 20:44:32 -04:00
Greg Sarjeant
cfb8bd8f2e create tkr parent directory in tar archive 2025-07-02 20:42:38 -04:00
Greg Sarjeant
db8f3fa93e Fix curl command 2025-07-02 19:57:10 -04:00
Greg Sarjeant
b46d79653d Try adding step to push to registry 2025-07-02 19:50:33 -04:00
Greg Sarjeant
29416efdb0 Run tests on PR, add initial build action 2025-07-02 08:22:38 -04:00
Greg Sarjeant
45dd85ca8e contig -> config 2025-07-01 19:17:39 -04:00
Greg Sarjeant
4e346e4fa0 Attempt to actually run unit tests. 2025-07-01 19:16:06 -04:00
Greg Sarjeant
f4fd6a946b Add node to container image and bump version 2025-07-01 18:21:42 -04:00
Greg Sarjeant
7350cc29f9 Try checkoing out code. 2025-07-01 18:16:30 -04:00
Greg Sarjeant
e3dc9e8953 Fix token variable name 2025-07-01 17:55:30 -04:00
Greg Sarjeant
7e3f024413 use existing (wrong) label to see if action starts 2025-07-01 17:51:42 -04:00
Greg Sarjeant
9fef2b5121 First attempt at using custom container with gitea actions 2025-07-01 17:48:32 -04:00