nixpkgs/nixos/modules/services
Vincent Haupert 3cf9508c72 nixos/github-runner: refactor tokens handling
This commit changes how we deal with the current token, i.e., the token
which may exist from a previous runner registration, and the configured
token, i.e., the path set for the respective NixOS configuration option.

Until now, we copied the configured and the current token (if any) to
the runtime directory to compare them. The path of the current token may
reference a file which is only accessible to specific users (even only
root). Therefore, we ran the copying of credentials with elevated
privileges by prefixing the `ExecStartPre=` script with a `+` (see
systemd.service(5)). In this script, we also changed the owner of the
files to the service user. Apparently, however, the user/group pair
sometimes did not exist because we use `DynamicUser=`.

To address this issue, we no longer change the owner of the file.
Instead, we change the file permissions to 0666 to allow the runner
configuration script (runs with full sandboxing) to read-write the file.
Due to the current permissions of the runtime directory (0755), this
would expose the token. Therefore, we process the tokens in the state
directory, which is only accessible to the service user.

If a new token file exists in the state directory, the configuration
script should trigger a new runner registration. Afterward, it deletes
the new token file. The token is still available using the path of the
current token which is inaccessible within the service's sandbox.
2021-12-01 16:15:43 +01:00
..
admin nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
amqp nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
audio roon-server: 1.8-831 -> 1.8-846 2021-11-04 09:40:19 -07:00
backup nixos/borgbackup: specify systemd WorkingDirectory 2021-10-31 13:39:46 +01:00
blockchain/ethereum nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
cluster Merge pull request #138125 from juselius/unified-cgroup-fix 2021-11-13 21:21:28 +01:00
computing nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
continuous-integration nixos/github-runner: refactor tokens handling 2021-12-01 16:15:43 +01:00
databases Merge pull request #137176 from GoldsteinE/clickhouse-package 2021-11-21 21:43:58 +01:00
desktops treewide: switch `builtins.fromJSON(builtins.readFile ./file.json)` to lib.importJSON ./file.json 2021-11-03 14:43:52 +01:00
development blackfire: 1.49.4 → 2.5.1 2021-10-21 17:40:19 +02:00
display-managers nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
editors nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
finance nixos/odoo: apply suggestions from review 2021-11-03 12:40:59 +01:00
games nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
hardware nixos/bluetooth: fix bluetooth warnings 2021-11-23 10:54:26 +01:00
logging Merge pull request #136630 from mweinelt/logrotate-hourly 2021-11-29 07:42:14 -05:00
mail Merge pull request #141833 from poscat0x04/dovecot-quota-backend 2021-11-21 19:37:08 +01:00
matrix nixos/mjolnir: set rawHomeserverUrl in config 2021-11-16 19:21:33 +01:00
misc Merge pull request #147490 from illdefined/nix-daemon 2021-11-26 19:31:02 -03:00
monitoring prometheus-nginx-exporter: boolean conversion to string 2021-11-19 16:22:04 +01:00
network-filesystems nixos/webdav: set uid and gid 2021-11-30 10:19:14 +08:00
networking nixos/charybdis: implement reload functionality 2021-11-30 23:33:34 +01:00
printing nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
scheduling nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
search nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
security Merge pull request #122452 from ju1m/tor 2021-11-09 21:50:57 +01:00
system Merge pull request #140604 from obadz/earlyoom-stderr 2021-10-05 17:16:59 +02:00
torrent transmission: add extraFlags configuration option 2021-10-21 23:36:06 +02:00
ttys nixos/getty: remove serialSpeed 2021-11-19 10:17:26 +01:00
video treewide: switch `builtins.fromJSON(builtins.readFile ./file.json)` to lib.importJSON ./file.json 2021-11-03 14:43:52 +01:00
wayland nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
web-apps Merge pull request #145049 from fernsehmuell/patch-1 2021-11-22 06:15:57 -08:00
web-servers Merge pull request #146533 from SuperSandro2000/nginx 2021-11-30 21:16:09 +01:00
x11 gnome: update docs regarding nvidiaWayland 2021-11-30 15:59:30 -06:00