Skip to content

Add create comfort command-line arguments to tkserv (--smtp-server etc)#128

Merged
berthubert merged 3 commits into
berthubert:mainfrom
wandernauta:creature-comforts
May 24, 2026
Merged

Add create comfort command-line arguments to tkserv (--smtp-server etc)#128
berthubert merged 3 commits into
berthubert:mainfrom
wandernauta:creature-comforts

Conversation

@wandernauta
Copy link
Copy Markdown
Contributor

This adds a few command-line arguments to make it a bit easier to run and debug "unofficial" instances of tkserv:

  • --smtp-server takes an IP address and port of a mail server to use for user invites and such, rather than being hardcoded to 10.0.0.2:25; for Mailpit one would set 127.0.0.1:1025 for example. Taken from tkbot.
  • --sender-email and --base-url tweak the message that gets sent in such cases.
  • --dev for now just adds some additional SQLite logging.
  • --insecure-cookie is removed; tkserv never sends Secure cookies, with or without the flag.

The port and root arguments are now parsed using argparse; this avoids tkserv getting confused if these are not given but flags are given.

This logs all SQLite errors to stdout. This necessarily duplicates
logging somewhat: if we (actually SQLiteWriter) convert the error into
an exception, and that exception is logged, it is now logged twice. If
we drop the exception, intending to quietly ignore it, that is now no
longer quiet. Therefore, put this behind a runtime flag.

The logging callback also serves as a convenient place for a debugger
breakpoint.

See https://sqlite.org/errlog.html for the possible messages.
The --insecure-cookie flag is removed.
@berthubert berthubert merged commit e00b11c into berthubert:main May 24, 2026
1 check passed
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