Nixpkgs: API_ID_PUBLISHED_FLOOD at Telegram Desktop (api_id override?)

Created on 5 Feb 2019  路  9Comments  路  Source: NixOS/nixpkgs

Issue description

The issue and not nixos-related solution are described here in detail: https://github.com/telegramdesktop/tdesktop/issues/4717

The problem is an API_ID_PUBLISHED_FLOOD error on any login, which is caused by 'compromised' api_id, which AFAIK is being produced at per-user basis and not intended to be used by distro maintainers.

There's not much disk space and confidence to keep unstable channel constantly upgraded just because of one particular parameter.

I suggest implementing an override for the tdesktop package, which enables for users to provide their own api_id and api_hash just to comply with Telegram's terms of use.

Steps to reproduce

  • install tdesktop from stable or unstable channel
  • try logging in with your phone number

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.19.14, NixOS, 19.03pre166331.f9bd1533773 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2
  • channels(root): "nixos-18.09.1922.97e0d53d669, nixpkgs-19.03pre166331.f9bd1533773"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

All 9 comments

cc @primeos @abbradar @garbas

Thanks for bringing this up. I was hoping this would be fine for now and it's good to know that it causes some problems (again...).

Regarding the current situation

Unfortunately, the current way of obtaining an API ID doesn't work well for Linux distributions:
1) The API ID must be tied to a personal account (phone number) and we cannot request one for NixOS (I've tried to contact the Telegram team via multiple channels without any success so far...).
2) https://my.telegram.org/apps states: "It is forbidden to pass this value to third parties." which would obviously be a requirement for us (to put it into nixpkgs).

The following options would be available:
1) We use the extracted API ID from Telegram Desktop: https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/telegram-desktop&id=c60c8767fdc5876b4a990bac80404e88fd9b52c4
2) We use the API ID from Debian (wouldn't do that without their approval): https://salsa.debian.org/debian/telegram-desktop/commit/fc149cad60ffdd5475290520f29b02fdcebc2480
3) Someone (community member) provides an API ID for NixOS.

But since none of the above options is really satisfying / legally correct I decided to kept the default API ID for now.

Regarding your comment

There's not much disk space and confidence to keep unstable channel constantly upgraded just because of one particular parameter.

Not sure what you mean by that.

I suggest implementing an override for the tdesktop package, which enables for users to provide their own api_id and api_hash just to comply with Telegram's terms of use.

That would certainly be possible (no objections), but (IIRC) the api_id and api_hash are currently always statically compiled into Telegram Desktop, which can easily take 30-60 minutes to compile (depending on the machine). To make this a viable option we'd have to write a custom patch to e.g. read these parameters at run-time from a file (and use a wrapper to avoid having to recompile everything).

2. https://my.telegram.org/apps states: "It is forbidden to pass this value to third parties." which would obviously be a requirement for us (to put it into nixpkgs).

I don't think they meant it that way. It would make all unofficial clients non-redistributable (it is guaranteed that the user can always fish out a key from a binary). We can't make keys to give out to third parties, but we should be able to make those for ourselves.

I'll try to find a solution that works well for NixOS and other Linux distributions in general.

What other distributions do (the default API ID ist the rate limited one):

API ID list:

  • Upstream API ID: 2040
  • Default API ID: 17349
  • Debian: 50322
  • Void Linux: 209235
  • openSUSE: 340630
  • Snap/Flatpak: 611335

Contacting Telegram:

@ilya-fedin thanks, I've added both links to my list for completeness :)

Regarding this issue: I've unassigned myself as unfortunately I don't see a nice way forward. "Telegram" doesn't seem open at all to communicate with Linux distributions, which is sad...

I'm open for suggestions, PRs, etc. if someone has an idea, but personally I'm out of good ideas (and I'd like to avoid using a personal API ID, at least my own one). I guess one could also ask the maintainers of other distributions if they're using a personal API ID (linked to their phone number) or managed to request one for their Linux distribution.

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

Still the same issue on Arch linux and package community/telegram-desktop 2.2.0-2

Issue description

The issue and not nixos-related solution are described here in detail: telegramdesktop/tdesktop#4717

The problem is an API_ID_PUBLISHED_FLOOD error on any login, which is caused by 'compromised' api_id, which AFAIK is being produced at per-user basis and not intended to be used by distro maintainers.

There's not much disk space and confidence to keep unstable channel constantly upgraded just because of one particular parameter.

I suggest implementing an override for the tdesktop package, which enables for users to provide their own api_id and api_hash just to comply with Telegram's terms of use.

Steps to reproduce

  • install tdesktop from stable or unstable channel
  • try logging in with your phone number

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.19.14, NixOS, 19.03pre166331.f9bd1533773 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2
  • channels(root): "nixos-18.09.1922.97e0d53d669, nixpkgs-19.03pre166331.f9bd1533773"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

I just had this issue occur to me. Where can I get the 'tdesktop' please? Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

vaibhavsagar picture vaibhavsagar  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

copumpkin picture copumpkin  路  3Comments

yawnt picture yawnt  路  3Comments