Support supplying config variables through means other than the main config file #633

Open
opened 2022-06-06 07:10:12 -04:00 by artemislena · 1 comment
artemislena commented 2022-06-06 07:10:12 -04:00 (Migrated from github.com)

L: I'm thinking of something like environment variables (that override the default config) or a secondary config file (passed via a command line flag, e.g. --extra-config /etc/nitter_secrets.conf) here. The reason for this being useful is that the config file may contain secrets (such as the HMAC key), but you might still want to publish the non-secret parts of it. As for environment variables, the mapping might be something like NITTER_[Section]_[Variable], e.g. NITTER_Config_hmacKey (though all upper-case, i.e. NITTER_CONFIG_HMACKEY would probably be even better). Alternatively, some special placeholder format in the config that makes it get it from an environment variable instead would work, too (e.g.

[Config]
hmacKey = "@NITTER_HMAC@"

to get it from the NITTER_HMAC environment variable).

Edit: Oh, there's also the Redis password, which should be secret too, I guess, and of course there might be other secrets in the future, so uh, it would be best if this was implemented so it could be used for any config variable.

L: I'm thinking of something like environment variables (that override the default config) or a secondary config file (passed via a command line flag, e.g. `--extra-config /etc/nitter_secrets.conf`) here. The reason for this being useful is that the config file may contain secrets (such as the HMAC key), but you might still want to publish the non-secret parts of it. As for environment variables, the mapping might be something like `NITTER_[Section]_[Variable]`, e.g. `NITTER_Config_hmacKey` (though all upper-case, i.e. `NITTER_CONFIG_HMACKEY` would probably be even better). Alternatively, some special placeholder format in the config that makes it get it from an environment variable instead would work, too (e.g. ``` [Config] hmacKey = "@NITTER_HMAC@" ``` to get it from the `NITTER_HMAC` environment variable). Edit: Oh, there's also the Redis password, which should be secret too, I guess, and of course there might be other secrets in the future, so uh, it would be best if this was implemented so it could be used for any config variable.
halostatue commented 2022-06-20 12:30:03 -04:00 (Migrated from github.com)

The environment variable approach would be very good from my perspective. I have been trying to run nitter on Fly.io this morning and there doesn’t seem to be a secure way of providing a nitter.conf to an image.

The environment variable approach would be very good from my perspective. I have been trying to run nitter on Fly.io this morning and there doesn’t seem to be a secure way of providing a `nitter.conf` to an image.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PAS/nitter#633
No description provided.