!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

322 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena110 Servers

Load older messages


SenderMessageTime
27 Apr 2023
@eisfunke:eisfunke.comNicolas joined the room.15:21:46
28 Apr 2023
@sumner:nevarro.space@sumner:nevarro.space joined the room.17:20:19
@sumner:nevarro.space@sumner:nevarro.space I'm having trouble with running a systemd service that reads from a secret that I uploaded via colmena. I uploaded the secret and set the user and group to msclinkbot and I am using the same user and group for the systemd service. But I get permission denied whenever I try to access that file (even if just via cat /run/keys/mscbot_password. Does anyone have suggestions for what could be going wrong? 17:22:53
@hexa:lossy.networkhexaneeds more details17:44:39
@hexa:lossy.networkhexastat on the secret17:44:44
@hexa:lossy.networkhexaand ideally the systemd unit17:44:47
@hexa:lossy.networkhexaand you could try if the user used in the unit can stat the secret17:45:10
@hexa:lossy.networkhexa and if it cannot, try to ls the directory above 17:45:22
@sumner:nevarro.space@sumner:nevarro.space
deployment.keys = {
  mscbot_password = {
    keyCommand = [ <something> ];
    user = "msclinkbot";
    group = "msclinkbot";
  };

My config is:

   systemd.services.msclinkbot = {
      description = "MSC Link Bot";
      after = [
        "matrix-synapse.target"
        "mscbot_password-key.service"
      ];
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        ExecStart = ''
          ${pkgs.coreutils}/bin/cat /run/keys/mscbot_password
        '';
        Restart = "on-failure";
        User = "msclinkbot";
        Group = "msclinkbot";
      };
    };

    users = {
      users.msclinkbot = {
        group = "msclinkbot";
        isSystemUser = true;
        home = cfg.dataDir;
        createHome = true;
      };
      groups.msclinkbot = { };
    };

I can't get into the msclinkbot user because it says that it's currently unavailable

18:03:11
@hexa:lossy.networkhexa just run sudo -u msclinkbot <command> 18:13:16
@hexa:lossy.networkhexaRedacted or Malformed Event18:14:18
@sumner:nevarro.space@sumner:nevarro.space

Oh, I was trying to use su to shell in.

root@matrix:~/ > sudo -u msclinkbot cat /var/lib/msclinkbot
cat: /var/lib/msclinkbot: Is a directory
18:14:38
@hexa:lossy.networkhexacat expects a file ÖD18:14:52
@hexa:lossy.networkhexa * cat expects a file 😄18:14:54
@hexa:lossy.networkhexa * cat expects a file 🐱18:15:05
@sumner:nevarro.space@sumner:nevarro.spaceack, I copied the wrong output lol18:15:13
@sumner:nevarro.space@sumner:nevarro.space *

Oh, I was trying to use su to shell in.

root@matrix:~/ > sudo -u msclinkbot cat /run/keys/mscbot_password
cat: /run/keys/mscbot_password: Permission denied
18:15:35
@sumner:nevarro.space@sumner:nevarro.spacerunning the same command as root works just fine18:15:55
@hexa:lossy.networkhexa so try sudo -u msclinkbot ls /run/keys 18:16:25
@sumner:nevarro.space@sumner:nevarro.spacethat got permission denied as well... interesting18:16:49
@hexa:lossy.networkhexawill probably fail, so your user lacks the executable permission on that folder18:16:52
@hexa:lossy.networkhexa the unit likely needs SupplementaryGroups = [ "keys" ]; 18:17:17
@hexa:lossy.networkhexaor something similar18:17:20
@hexa:lossy.networkhexa
In reply to @sumner:nevarro.space
running the same command as root works just fine
root has CAP_DAC_READ_OVERRIDE fwiw
18:17:57
@sumner:nevarro.space@sumner:nevarro.space
In reply to @hexa:lossy.network
the unit likely needs SupplementaryGroups = [ "keys" ];
this seems to have worked. I should probably add this to to the documentation...
18:19:03
@sumner:nevarro.space@sumner:nevarro.spaceThanks for your help!18:19:09
29 Apr 2023
@zhaofeng:zhaofeng.liZhaofeng Li I kind of want to tag 0.4.0 now (it's long over due) and do some large refactoring for flake evaluation. The current way we evaluate flakes (emitting a wrapper flake in a temporary directory) is hacky and won't work when lazy-trees drops (which would be a while as it seems). To make a simple nix eval against the user's flake work, I think we will require the user to have Colmena evaluator as an input in their flake and only support colmena.lib.makeHive which is currently experimental. 16:52:30
30 Apr 2023
@obsidianical:matrix.org@obsidianical:matrix.org joined the room.16:00:51
@obsidianical:matrix.org@obsidianical:matrix.org

hello, i'm trying to deploy a system on a hetzner ARM vps. it worked well so far, until I tried to use arion for a docker compose app.

these are the resulting logs: https://s10e.de/p/bkjN5a

16:05:32
@shyim:matrix.orgShyimdid you tried to use buildOnTarget?16:07:00

Show newer messages


Back to Room ListRoom Version: 6