Kaynağa Gözat

chore: cleanup unused group creation

Nicolas Meienberger 1 yıl önce
ebeveyn
işleme
760097f492

+ 0 - 24
packages/cli/src/executors/system/system.executors.ts

@@ -61,30 +61,6 @@ export class SystemExecutors {
   private ensureFilePermissions = async (rootFolderHost: string) => {
     const logger = new TerminalSpinner('');
 
-    // Create group tipi if it does not exist
-    try {
-      await execAsync('getent group tipi');
-    } catch (e) {
-      try {
-        await execAsync('sudo groupadd tipi');
-        logger.done('Created group tipi');
-      } catch (e2) {
-        logger.fail('Failed to create group tipi');
-        fileLogger.error(e2);
-      }
-    }
-
-    // Add current user to group tipi
-    if (!(await execAsync(`groups ${process.env.USER}`)).stdout.includes('tipi')) {
-      try {
-        await execAsync(`sudo usermod -aG tipi ${process.env.USER}`);
-        // Reload permissions
-        await execAsync('newgrp tipi');
-      } catch (e) {
-        logger.fail('Failed to add current user to group tipi');
-      }
-    }
-
     const filesAndFolders = [
       path.join(rootFolderHost, 'apps'),
       path.join(rootFolderHost, 'app-data'),

+ 1 - 2
packages/cli/src/executors/system/system.helpers.ts

@@ -181,9 +181,8 @@ export const generateSystemEnvFile = async () => {
 
   const currentUserGroup = process.getgid ? String(process.getgid()) : '1000';
   const currentUserId = process.getuid ? String(process.getuid()) : '1000';
-  const { stdout: tipiGroupId } = await execAsync('getent group tipi | cut -d: -f3');
 
-  envMap.set('TIPI_GID', tipiGroupId.trim() || currentUserGroup);
+  envMap.set('TIPI_GID', currentUserGroup);
   envMap.set('TIPI_UID', currentUserId);
 
   await fs.promises.writeFile(envFilePath, envMapToString(envMap));