aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-14 08:49:44 -0300
committerEuAndreh <eu@euandre.org>2020-08-14 08:50:03 -0300
commit22289be1a2b36d83c45ed52ac03c097b246e74ee (patch)
treec8c3cc29f2deb1dfef293690ef4c043883b3f6e6
parentDon't make lighttpd the user owner of $GIT_ROOT (diff)
downloadserver-22289be1a2b36d83c45ed52ac03c097b246e74ee.tar.gz
server-22289be1a2b36d83c45ed52ac03c097b246e74ee.tar.xz
Stop hardcoding the user in favor of $USER_NAME
-rw-r--r--secrets/secret-envrc.shbin3237 -> 3242 bytes
-rw-r--r--vps-configuration.env.nix5
2 files changed, 3 insertions, 2 deletions
diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh
index f0eed7e..0076fab 100644
--- a/secrets/secret-envrc.sh
+++ b/secrets/secret-envrc.sh
Binary files differ
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" ];