Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Add labels for configured secrets and surface matched secret in logs #60

Description

@dvershinin

Context

MTProxy already supports multiple secrets via repeated -S flags, and Docker support for multi-secret startup landed in #54.

The remaining gap from the upstream discussion is operator visibility: being able to attach a stable human-readable label to each configured secret and see which label matched on incoming connections.

Reference discussion:

This is not a claim that secret rotation prevents IP blocking once a link has already escaped into the wild. The value here is narrower and operational:

  • distinguish family / friends / test users / temporary shares
  • identify which secret is being used when investigating abuse or abnormal traffic
  • revoke one secret without touching the others

Requested behavior

  • Keep current repeated -S <secret> behavior unchanged.
  • Add an optional way to associate a human-readable label or ID with each configured secret.
  • When a client handshake succeeds, surface the matched secret label/ID in logs and/or stats output.
  • Do not expose raw secret values in runtime logs.
  • Document both native and Docker usage.

Acceptance criteria

  • Existing single-secret and multi-secret setups remain backward compatible.
  • Operators can define labels for 1..N configured secrets.
  • Secret matching still preserves current protocol behavior and compatibility.
  • Only labels/IDs are emitted for observability; secret material is not.
  • Tests cover labeled multi-secret matching and unknown-secret rejection.

Notes

Implementation detail is open. We do not need to copy mtg's TOML UX exactly if a simpler CLI- or Docker-oriented interface fits this codebase better.

Existing related work:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions