Skip to content

rtl: the config rewrite at every start drops the 2FA secret #102

Closed

Description

@ostermayer

Commit 71a7ef3, modules/rtl.nix lines 201 to 206.

What I found

ExecStartPre rebuilds RTL-Config.json from the Nix template at every start. RTL 0.15.8 writes its own settings back into that same file (server/controllers/shared/RTLConf.ts lines 220 and 250), and the two-factor secret a user sets up in the UI lives there as secret2FA. RTL derives enable2FA from that field. So a restart, a reboot or a rebuild silently turns 2FA off again, and the user doesn't learn it until the next login asks for a password only.

The same applies to every other setting changed through the UI, but 2FA is the one with a security effect.

Options

  1. Write the generated config only when it doesn't exist yet or when the template changed, and merge the password in place with jq instead of overwriting. The Nix side then owns the template and RTL owns its runtime fields.
  2. Keep the overwrite and say in the option docs that UI settings don't survive a restart, with 2FA named.

I'd take the first. I can send the PR. LLM review (GPT-6 Astra xhigh, grading a DeepSeek V4.1 Flash and GLM 5.3 run) flagged this. I verified it against the module and the RTL source.

Activity

  1. added
    area: modules
    type: security
    on Oct 23, 2026
  2. added 2 commits that reference this issue on Nov 13, 2026
    bc4b1e2
    2cebca4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: modulestype: security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions