Copy auth token to a dynamic-user visible path.

This commit is contained in:
niten 2022-06-19 11:34:04 -07:00
parent a7e058e809
commit d52684ae6c
1 changed files with 3 additions and 1 deletions

View File

@ -63,13 +63,15 @@ in {
environment = {
PRICEBOT_EXCHANGE_HOST = cfg.exchange-host;
PRICEBOT_BEBOT_URL = cfg.mattermost-url;
PRICEBOT_BEBOT_AUTH_TOKEN_FILE = cfg.mattermost-auth-token-file;
PRICEBOT_BEBOT_AUTH_TOKEN_FILE = "%T/auth.token";
PRICEBOT_BEBOT_CHANNEL_ID = opts.mattermost-channel-id;
PRICEBOT_TARGET_CURRENCY = opts.currency;
PRICEBOT_NOTIFY_USER = opts.notify-user;
};
serviceConfig = {
ExecStart = "${pkgs.jre}/bin/java -jar ${pricebot-jar}";
ExecStartPre =
"/usr/bin/install --owner=%u --mode=400 -T ${cfg.mattermost-auth-token-file} %T/auth.token";
DynamicUser = true;
PrivateTmp = true;
PrivateDevices = true;