Skip to content

bug: secret add/remove confirmation prints empty label — "Secret '' created" #66

@SPerekrestova

Description

@SPerekrestova

Summary

After running mtproxymax secret add <label> or mtproxymax secret remove <label>, the confirmation message displays empty single quotes instead of the label:

  [✓] Secret '' created
  [✓] Secret '' removed

Expected:

  [✓] Secret 'myuser' created
  [✓] Secret 'myuser' removed

Environment

  • MTProxyMax v1.0.5
  • Ubuntu 24.04 (aarch64)
  • Invoked non-interactively via SSH: ssh host 'mtproxymax secret add myuser'

Steps to reproduce

ssh host 'mtproxymax secret add testuser'

Output:

  [i] Config reloaded (hot-reload, no restart)
  [✓] Secret '' created

The secret itself is created correctly (appears in mtproxymax secret list with the correct label), so this is a display-only issue. The proxy link printed below the confirmation also uses the correct label.

Notes

  • The code at secret_add() line 1721 reads log_success "Secret '${label}' created" — syntactically correct
  • Only observed in non-interactive (no-TTY) SSH context; may not reproduce in an interactive terminal session
  • The secret remove confirmation at line 1805 has the same pattern and shows the same symptom
  • Could be related to the set -eo pipefail interaction with argument parsing in non-TTY mode, or a terminal rendering issue with ANSI codes in captured output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions