Skip to content

Conversation

@PassionateBytes
Copy link
Contributor

@PassionateBytes PassionateBytes commented Nov 12, 2025

This PR introduces two new configuration parameters that provide greater flexibility when self-hosting TimeTagger, particularly for deployments behind reverse proxies.

New Parameter: path_prefix

By default, TimeTagger serves all endpoints at /timetagger/.... This path prefix can now be configured to custom values.

Usage:

# Via CLI argument
python -m timetagger --path_prefix=/custom/path/

# Via environment variable
TIMETAGGER_PATH_PREFIX=/custom/path/ python -m timetagger

New Parameter: app_redirect

By default, TimeTagger redirects requests at the path / to an informative landing page. This behavior can now be reconfigured, to redirect directly to the application page instead.

Usage:

# Via CLI argument
python -m timetagger --app_redirect=true

# Via environment variable
TIMETAGGER_APP_REDIRECT=true python -m timetagger
  • Defaults to false, preserving the original behavior for backward compatibility.
  • Useful for self-hosting users, that want to access their deployed application more easily.

Testing

Comprehensive test coverage has been added to validate:

  • Parameter normalization and configuration handling
  • Routing behavior with various path_prefix values (default, custom paths, root path)
  • app_redirect functionality with different path prefixes
  • Combined usage of both parameters
  • Edge cases and path normalization
invoke tests  # succeeds.

Closes almarklein#549

This allows administrators to customize the URL path prefix
where the TimeTagger instance is served.
The default remains `/timetagger/`, for full backward compatibility.
Complementary to almarklein#549

This allows direct redirects from the root path `/` to the main
application, bypassing the landing page. This can be useful for
self-hosted instances where the landing page is not needed.

Note: The landing page remains accessible, when accessed explicitly via
`/timetagger/`. (or the configured path prefix)
@PassionateBytes PassionateBytes marked this pull request as draft November 12, 2025 19:19
@PassionateBytes PassionateBytes force-pushed the feat/549-configurable-path-prefix branch from 5b38553 to ce9a5e0 Compare November 12, 2025 21:35
@PassionateBytes PassionateBytes marked this pull request as ready for review November 12, 2025 21:36
@PassionateBytes
Copy link
Contributor Author

Hey @almarklein! Any thoughts or feedback on this? Would love to get this one merged and released, or at least haar Sinne feedback.

@almarklein
Copy link
Owner

Sorry for the late review, I've been rather busy lately.

@almarklein
Copy link
Owner

Looking good, thanks!

@almarklein almarklein merged commit 268f6c9 into almarklein:main Dec 3, 2025
9 checks passed
@PassionateBytes
Copy link
Contributor Author

No problem, and I appreciate the review and merge! 🙏

Will you be kicking off a new release soon?

@almarklein
Copy link
Owner

I just made a new release.

@PassionateBytes
Copy link
Contributor Author

Awesome, thanks mate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants