diff options
author | EuAndreh <eu@euandre.org> | 2020-08-14 08:49:44 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-08-14 08:50:03 -0300 |
commit | 22289be1a2b36d83c45ed52ac03c097b246e74ee (patch) | |
tree | c8c3cc29f2deb1dfef293690ef4c043883b3f6e6 | |
parent | Don't make lighttpd the user owner of $GIT_ROOT (diff) | |
download | server-22289be1a2b36d83c45ed52ac03c097b246e74ee.tar.gz server-22289be1a2b36d83c45ed52ac03c097b246e74ee.tar.xz |
Stop hardcoding the user in favor of $USER_NAME
-rw-r--r-- | secrets/secret-envrc.sh | bin | 3237 -> 3242 bytes | |||
-rw-r--r-- | vps-configuration.env.nix | 5 |
2 files changed, 3 insertions, 2 deletions
diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh Binary files differindex f0eed7e..0076fab 100644 --- a/secrets/secret-envrc.sh +++ b/secrets/secret-envrc.sh diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix index 1c954c2..a7f19c7 100644 --- a/vps-configuration.env.nix +++ b/vps-configuration.env.nix @@ -9,6 +9,7 @@ let letsencryptEmail = "$LETSENCRYPT_EMAIL"; authorizedKey = "$AUTHORIZED_KEY"; userPassword = "$USER_PASSWORD"; + userName = "$USER_NAME"; nextcloudDatabaseUser = "$NEXTCLOUD_DATABASE_USER"; nextcloudDatabasePassword = "$NEXTCLOUD_DATABASE_PASSWORD"; nextcloudAdminUser = "$NEXTCLOUD_ADMIN_USER"; @@ -177,7 +178,7 @@ in { wantedBy = [ "multi-user.target" ]; script = '' mkdir -p ${envsubstConfiguration.gitRoot} - chown -R andreh:lighttpd ${envsubstConfiguration.gitRoot} + chown -R ${envsubstConfiguration.userName}:lighttpd ${envsubstConfiguration.gitRoot} chmod -R 770 ${envsubstConfiguration.gitRoot} ''; serviceConfig = { @@ -186,7 +187,7 @@ in { }; }; - users.extraUsers.andreh = { + users.extraUsers."${envsubstConfiguration.userName}" = { uid = 1000; isNormalUser = true; extraGroups = [ "wheel" ]; |