From a88c3ed68d63f5939e82c38cc3afc3c84f909724 Mon Sep 17 00:00:00 2001 From: Lu Yang Date: Wed, 18 Dec 2024 21:57:24 +0000 Subject: [PATCH] make user folders 700 --- lapdev-dashboard/src/workspace.rs | 12 +++++------- lapdev-ws/src/server.rs | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/lapdev-dashboard/src/workspace.rs b/lapdev-dashboard/src/workspace.rs index 9166d4c..9684a2d 100644 --- a/lapdev-dashboard/src/workspace.rs +++ b/lapdev-dashboard/src/workspace.rs @@ -702,10 +702,10 @@ pub fn WorkspaceItem( let workspace_hostname = workspace_hostname.clone(); move |ws_service| { view! { -
-
+
+ -
+
{ws_service.name.clone()}
@@ -716,10 +716,8 @@ pub fn WorkspaceItem(
-
-
-
-
+
+
diff --git a/lapdev-ws/src/server.rs b/lapdev-ws/src/server.rs index 75d2c59..ce4c573 100644 --- a/lapdev-ws/src/server.rs +++ b/lapdev-ws/src/server.rs @@ -486,6 +486,12 @@ impl WorkspaceServer { return Err(anyhow!("can't do useradd {username}").into()); } + let _ = Command::new("chmod") + .arg("700") + .arg(format!("/home/{username}")) + .output() + .await; + let _ = tokio::process::Command::new("usermod") .arg("-a") .arg("-G") @@ -514,6 +520,11 @@ impl WorkspaceServer { .arg(&workspace_base_folder) .output() .await?; + let _ = Command::new("chmod") + .arg("700") + .arg(&workspace_base_folder) + .output() + .await; let prebuild_base_folder = self.osuser_prebuild_base_folder(username); Command::new("mkdir") @@ -522,6 +533,11 @@ impl WorkspaceServer { .spawn()? .wait() .await?; + let _ = Command::new("chmod") + .arg("700") + .arg(&prebuild_base_folder) + .output() + .await; let project_base_folder = self.osuser_project_base_folder(username); Command::new("mkdir") @@ -530,6 +546,11 @@ impl WorkspaceServer { .spawn()? .wait() .await?; + let _ = Command::new("chmod") + .arg("700") + .arg(&project_base_folder) + .output() + .await; let containers_config_folder = format!("/home/{username}/.config/containers"); Command::new("su")