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.
<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
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants