Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/mautrix-telegram: add documentation for setting arbitrary secrets #103347

Closed
wants to merge 1 commit into from

Conversation

CRTified
Copy link
Contributor

@CRTified CRTified commented Nov 10, 2020

Motivation for this change

services.mautrix-telegram.environmentFile can be used to set arbitrary options and is not limited
to the five tokens listed in the original documentation.
In my case, I used it to set bridge.login_shared_secret (as a secret, it should not be added to the store), which maps to the environment value MAUTRIX_TELEGRAM_BRIDGE_LOGIN_SHARED_SECRET.

This PR adds documentation on how to override arbitrary other settings.
This is possible because of the changes here: mautrix/telegram#332

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@pacien might want to have a look at this, too.

The change that allows setting the secrets by an environment file had
the undocumented side effect of allowing to set any key by the environment
file (Related PR: mautrix/telegram#332).

This is required to e.g. set `bridge.login_shared_secret`, which was not
documented before.
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Nov 10, 2020
<literal>MAUTRIX_TELEGRAM_APPSERVICE_AS_TOKEN</literal>,
<literal>MAUTRIX_TELEGRAM_APPSERVICE_HS_TOKEN</literal>,
<literal>MAUTRIX_TELEGRAM_TELEGRAM_API_ID</literal>,
<literal>MAUTRIX_TELEGRAM_TELEGRAM_API_HASH</literal> and optionally
<literal>MAUTRIX_TELEGRAM_TELEGRAM_BOT_TOKEN</literal>.
</para>

<para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blindly relying on how the manual is assembled (i.e. that each description is inside a <para> right now) is IMHO not a good idea, this can easily cause some weird side-effects as soon as some config of our docbook build changes.

@stale
Copy link

stale bot commented Jun 4, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2021
@doronbehar
Copy link
Contributor

@CRTified is there an upstream documentation page that explains this behavior to which we can add a link instead of giving an incomplete list of environment variables?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 9, 2021
@CRTified
Copy link
Contributor Author

CRTified commented Aug 9, 2021

@doronbehar I was not able to find any documentation in the official docs, probably because this was integrated only due to the PR that I referenced when opening this PR (and that contribution came from @pacien). This would suggest that setting these options with other means is not the intended method of configuration.

There's also this "long standing" issue that some configuration options are not accessible from the environment anymore: mautrix/telegram#584

@stale
Copy link

stale bot commented Apr 19, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 19, 2022
@Artturin Artturin added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 7, 2022
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 7, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 12, 2022
pacien pushed a commit to pacien/nixpkgs that referenced this pull request Nov 16, 2022
The change that allows setting the secrets by an environment file had
the undocumented side effect of allowing to set any key by the environment
file (Related PR: mautrix/telegram#332).

This is required to e.g. set `bridge.login_shared_secret`, which was not
documented before.

GitHub: closes NixOS#103347
@winterqt winterqt closed this in 4a8f6ce Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants