• erio's avatar
    feat(channels): gate available channels behind feature switch (backend) · 9ba42aa5
    erio authored
    Add a DB-backed soft switch "available_channels_enabled" controlling
    the user-facing /channels/available endpoint and sidebar entry. Default
    to false (opt-in) — the feature stays invisible until an admin enables
    it under Admin Settings > Features.
    
    - domain_constants: SettingKeyAvailableChannelsEnabled
    - settings_view: AllSettings/PublicSettings + AvailableChannelsEnabled
    - setting_service: public+all read/write, seed default "false",
      GetAvailableChannelsRuntime helper (fail-closed on read error)
    - admin setting_handler: UpdateSettingsRequest *bool + update branch
      + audit diff entry
    - public setting_handler: expose via GET /api/v1/settings
    - available_channel_handler: featureEnabled() guard — returns empty
      list after auth when disabled (401 precedes the feature check to
      preserve existing behavior)
    9ba42aa5
domain_constants.go 17.6 KB