Skip to content

Commit

Permalink
ユーザ・グループ名の変更 (debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
momeemt committed Apr 2, 2023
1 parent 893d384 commit 77b7722
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions nix/deployment/sos21-api-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ in

config = mkIf cfg.enable {

users.users.sos21 = {
name = "sos21";
group = "sos21";
users.users.sos23 = {
name = "sos23";
group = "sos23";
};
users.groups.sos21 = {
name = "sos21";
name = "sos23";
};

systemd.services.sos21-run-migrations =
let
envFile = "/var/tmp/sos21-run-migrations-keys";
preStart = makeKeyLoadScript {
name = "sos21-run-migrations-pre-start";
user = config.users.users.sos21.name;
group = config.users.users.sos21.group;
user = config.users.users.sos23.name;
group = config.users.users.sos23.group;
inherit envFile;
keys = {
DB_USERNAME = cfg.databaseUsernameFile;
Expand All @@ -122,8 +122,8 @@ in
serviceConfig = {
Type = "oneshot";
ExecStartPre = "+${preStart}";
User = config.users.users.sos21.name;
Group = config.users.users.sos21.group;
User = config.users.users.sos23.name;
Group = config.users.users.sos23.group;
};
postStart = "rm -f '${envFile}'";
script = ''
Expand All @@ -148,8 +148,8 @@ in
envFile = "/var/tmp/sos21-create-bucket-keys";
preStart = makeKeyLoadScript {
name = "sos21-create-bucket-pre-start";
user = config.users.users.sos21.name;
group = config.users.users.sos21.group;
user = config.users.users.sos23.name;
group = config.users.users.sos23.group;
inherit envFile;
keys = {
ACCESS_KEY = cfg.s3AccessKeyFile;
Expand All @@ -163,8 +163,8 @@ in
serviceConfig = {
Type = "oneshot";
ExecStartPre = "+${preStart}";
User = config.users.users.sos21.name;
Group = config.users.users.sos21.group;
User = config.users.users.sos23.name;
Group = config.users.users.sos23.group;
};
postStart = "rm -f '${envFile}'";
script = ''
Expand All @@ -184,8 +184,8 @@ in
envFile = "/var/tmp/sos21-api-server-keys";
preStart = makeKeyLoadScript {
name = "sos21-api-server-pre-start";
user = config.users.users.sos21.name;
group = config.users.users.sos21.group;
user = config.users.users.sos23.name;
group = config.users.users.sos23.group;
inherit envFile;
keys = {
DB_USERNAME = cfg.databaseUsernameFile;
Expand All @@ -204,8 +204,8 @@ in
];
serviceConfig = {
ExecStartPre = "+${preStart}";
User = config.users.users.sos21.name;
Group = config.users.users.sos21.group;
User = config.users.users.sos23.name;
Group = config.users.users.sos23.group;
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
};
postStop = "rm -f '${envFile}'";
Expand Down

0 comments on commit 77b7722

Please sign in to comment.