From 2c61c48ff15b9c967abe35730c215a11ab410add Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 14:49:27 +0530 Subject: [PATCH 01/27] talawa_admin.service file added --- examples/linux/Daemon_Service_Setup.md | 68 +++++++++++++++++++++ examples/linux/systemd/talawa_admin.service | 47 ++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 examples/linux/Daemon_Service_Setup.md create mode 100644 examples/linux/systemd/talawa_admin.service diff --git a/examples/linux/Daemon_Service_Setup.md b/examples/linux/Daemon_Service_Setup.md new file mode 100644 index 0000000000..51344be6b5 --- /dev/null +++ b/examples/linux/Daemon_Service_Setup.md @@ -0,0 +1,68 @@ + +# Talawa-Admin Service Setup Guide + +This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. + +### Prerequisites + +- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. +- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. + +--- + +### Service Configuration + +#### 1. **Copy the `talawa_admin.service` file** + - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: + - For most distributions: `/etc/systemd/system/` + - For systems using `systemd`, this will be the default directory. + +#### 2. **Verify the CODEROOT Path** + - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. + +#### 3. **Set the Correct Working Directory** + - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. + +#### 4. **Ensure the `.env` File Exists** + - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. + +#### 5. **Adjust User and Group** + - Modify the `User` and `Group` settings to match the user account intended to run the service. + +--- + +### Steps to Enable and Manage the Service + +1. **Reload the systemd daemon** to apply changes: + ```bash + sudo systemctl daemon-reload + ``` + +2. **Start the Talawa-Admin Service**: + ```bash + sudo systemctl start talawa_admin.service + ``` + +3. **Stop the Talawa-Admin Service**: + ```bash + sudo systemctl stop talawa_admin.service + ``` + +4. **Enable the Service to Start on Boot**: + ```bash + sudo systemctl enable talawa_admin.service + ``` + +--- + +### Troubleshooting + +- If you encounter any issues, you can check the status and logs of the service: + ```bash + sudo systemctl status talawa_admin.service + sudo journalctl -u talawa_admin.service + ``` + +--- + +By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file diff --git a/examples/linux/systemd/talawa_admin.service b/examples/linux/systemd/talawa_admin.service new file mode 100644 index 0000000000..e3c695943a --- /dev/null +++ b/examples/linux/systemd/talawa_admin.service @@ -0,0 +1,47 @@ + +################################################################################ +# +# READ ALL STEPS BEFORE PROCEEDING +# +# 0) Ensure that Node.js and npm are correctly installed and available for the +# specified user and group. +# Use nvm for better interaction with different node versions. +# 1) Place this file in the appropriate systemd directory based on your Linux +# distribution, e.g., /etc/systemd/system/. +# 2) Verify the CODEROOT path matches the Talawa-Admin code directory. +# 3) Always add the absolute path of talawa-admin directory to WorkingDirectory don't use $CODEROOT. +# 4) Ensure the EnvironmentFile path points to a valid .env file for the service. +# 5) Adjust the User and Group to match the user account intended to run the service. +# 6) Run the command "sudo systemctl daemon-reload" after saving changes. +# 7) Use "sudo systemctl start talawa_admin.service" to start the service. +# 8) Use "sudo systemctl stop talawa_admin.service" to stop the service. +# 9) Use "sudo systemctl enable talawa_admin.service" to start the service on boot. +# +################################################################################ + +[Unit] +Description=Talawa-Admin Service +After=network.target + +[Service] +User=talawa +Group=talawa +Environment=CODEROOT=path/to/your/talawa-admin + +# Absolute path is needed for working directory +WorkingDirectory=/path/to/your/talawa-admin + +EnvironmentFile=/path/to/your/talawa-admin/.env + +################################################################################ +# No need to edit anything below here +################################################################################ + +ExecStart=/bin/bash -c "source /path/to/your/.nvm/nvm.sh && nvm use default && npm run serve" +Restart=on-failure +RemainAfterExit=yes +Type=simple +RuntimeDirectory=talawa-admin + +[Install] +WantedBy=multi-user.target \ No newline at end of file From 325ec7de8b2b6490687751a6f764d69bbd0411cf Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 17:44:20 +0530 Subject: [PATCH 02/27] .eslintignore deleted and INSTALLATION.md updated --- .eslintignore | 8 --- .eslintrc.json | 10 ++-- INSTALLATION.md | 79 ++++++++++++++++++++++++++ examples/linux/Daemon_Service_Setup.md | 68 ---------------------- 4 files changed, 85 insertions(+), 80 deletions(-) delete mode 100644 .eslintignore delete mode 100644 examples/linux/Daemon_Service_Setup.md diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index ee98c5bdb0..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,8 +0,0 @@ -# Contains the PDF file of the Tag as JSON string, thus does not need to be linted -src/components/CheckIn/tagTemplate.ts -package.json -package-lock.json -tsconfig.json - -# Ignore the Docusaurus website subdirectory -docs/** \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index de93fb465f..242ea4f8dc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -149,9 +149,11 @@ "**/*.less", "**/*.json", "**/*.svg", - "docs/docusaurus.config.ts", - "docs/sidebars.ts", - "docs/src/**", - "docs/blog/**" + "src/components/CheckIn/tagTemplate.ts", + "package.json", + "package-lock.json", + "tsconfig.json", + "docs/**", + "examples/**" ] } diff --git a/INSTALLATION.md b/INSTALLATION.md index 3c09f69e33..3dc43f88cc 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -16,6 +16,16 @@ This document provides instructions on how to set up and start a running instanc - [Installation using Docker](#installation-using-docker) - [Prerequisites](#prerequisites-1) - [Development Setup](#development-setup) +- [Talawa-Admin Service Setup Guide](#talawa-admin-service-setup-guide) + - [Prerequisites](#prerequisites-2) + - [Service Configuration](#service-configuration) + - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) + - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) + - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) + - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) + - [5. **Adjust User and Group**](#5-adjust-user-and-group) + - [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) + - [Troubleshooting](#troubleshooting) @@ -380,3 +390,72 @@ If you don't want this hook to run, you can manually opt out of this using the `
``` + +# Talawa-Admin Service Setup Guide + +This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. + +### Prerequisites + +- Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](#setting-up-this-repository) +- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. +- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. + +--- + +### Service Configuration + +#### 1. **Copy the `talawa_admin.service` file** + - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: + - For most distributions: `/etc/systemd/system/` + - For systems using `systemd`, this will be the default directory. + +#### 2. **Verify the CODEROOT Path** + - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. + +#### 3. **Set the Correct Working Directory** + - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. + +#### 4. **Ensure the `.env` File Exists** + - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. + +#### 5. **Adjust User and Group** + - Modify the `User` and `Group` settings to match the user account intended to run the service. + +--- + +### Steps to Enable and Manage the Service + +1. **Reload the systemd daemon** to apply changes: + ```bash + sudo systemctl daemon-reload + ``` + +2. **Start the Talawa-Admin Service**: + ```bash + sudo systemctl start talawa_admin.service + ``` + +3. **Stop the Talawa-Admin Service**: + ```bash + sudo systemctl stop talawa_admin.service + ``` + +4. **Enable the Service to Start on Boot**: + ```bash + sudo systemctl enable talawa_admin.service + ``` + +--- + +### Troubleshooting + +- If you encounter any issues, you can check the status and logs of the service: + ```bash + sudo systemctl status talawa_admin.service + sudo journalctl -u talawa_admin.service + ``` + +--- + +By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file diff --git a/examples/linux/Daemon_Service_Setup.md b/examples/linux/Daemon_Service_Setup.md deleted file mode 100644 index 51344be6b5..0000000000 --- a/examples/linux/Daemon_Service_Setup.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Talawa-Admin Service Setup Guide - -This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. - -### Prerequisites - -- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. -- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. - ---- - -### Service Configuration - -#### 1. **Copy the `talawa_admin.service` file** - - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: - - For most distributions: `/etc/systemd/system/` - - For systems using `systemd`, this will be the default directory. - -#### 2. **Verify the CODEROOT Path** - - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. - -#### 3. **Set the Correct Working Directory** - - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. - -#### 4. **Ensure the `.env` File Exists** - - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. - -#### 5. **Adjust User and Group** - - Modify the `User` and `Group` settings to match the user account intended to run the service. - ---- - -### Steps to Enable and Manage the Service - -1. **Reload the systemd daemon** to apply changes: - ```bash - sudo systemctl daemon-reload - ``` - -2. **Start the Talawa-Admin Service**: - ```bash - sudo systemctl start talawa_admin.service - ``` - -3. **Stop the Talawa-Admin Service**: - ```bash - sudo systemctl stop talawa_admin.service - ``` - -4. **Enable the Service to Start on Boot**: - ```bash - sudo systemctl enable talawa_admin.service - ``` - ---- - -### Troubleshooting - -- If you encounter any issues, you can check the status and logs of the service: - ```bash - sudo systemctl status talawa_admin.service - sudo journalctl -u talawa_admin.service - ``` - ---- - -By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file From b001089b2481e45d343161654bf4c3ad51229ec3 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 18:48:52 +0530 Subject: [PATCH 03/27] INSTALLATION.md file updated --- INSTALLATION.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 3dc43f88cc..592f1ee1ad 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -23,7 +23,8 @@ This document provides instructions on how to set up and start a running instanc - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) - - [5. **Adjust User and Group**](#5-adjust-user-and-group) + - [5. **Critical Configuration Validation Steps**](#5-critical-configuration-validation-steps) + - [6. **Adjust User and Group**](#6-adjust-user-and-group) - [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) - [Troubleshooting](#troubleshooting) @@ -419,8 +420,35 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a #### 4. **Ensure the `.env` File Exists** - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. -#### 5. **Adjust User and Group** +#### 5. **Critical Configuration Validation Steps** + - The service configuration section should include steps to validate the configuration before starting the service. + 1. Verify file permissions: + ```bash + sudo chmod 644 /etc/systemd/system/talawa_admin.service + sudo chown root:root /etc/systemd/system/talawa_admin.service + ``` + + 2. Validate service file syntax: + ```bash + sudo systemd-analyze verify talawa_admin.service + ``` + + 3. Test environment file loading: + ```bash + sudo systemctl show-environment + ``` + +#### 6. **Adjust User and Group** - Modify the `User` and `Group` settings to match the user account intended to run the service. + 1. Create a dedicated service user: + ```bash + sudo useradd -r -s /bin/false talawa + ``` + + 2. Set proper directory permissions: + ```bash + sudo chown -R talawa:talawa /path/to/talawa-admin + ``` --- From 95a6a381bd3248e20f5bacccdaf7aaebd6793612 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 18:58:58 +0530 Subject: [PATCH 04/27] some refactor --- INSTALLATION.md | 38 ++++----------------- examples/linux/systemd/talawa_admin.service | 4 +-- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 592f1ee1ad..c81bcd44cb 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -23,8 +23,7 @@ This document provides instructions on how to set up and start a running instanc - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) - - [5. **Critical Configuration Validation Steps**](#5-critical-configuration-validation-steps) - - [6. **Adjust User and Group**](#6-adjust-user-and-group) + - [5. **Adjust User and Group**](#5-adjust-user-and-group) - [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) - [Troubleshooting](#troubleshooting) @@ -419,37 +418,14 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a #### 4. **Ensure the `.env` File Exists** - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. - -#### 5. **Critical Configuration Validation Steps** - - The service configuration section should include steps to validate the configuration before starting the service. - 1. Verify file permissions: - ```bash - sudo chmod 644 /etc/systemd/system/talawa_admin.service - sudo chown root:root /etc/systemd/system/talawa_admin.service - ``` - - 2. Validate service file syntax: - ```bash - sudo systemd-analyze verify talawa_admin.service - ``` - 3. Test environment file loading: - ```bash - sudo systemctl show-environment - ``` - -#### 6. **Adjust User and Group** +#### 5. **Adjust User and Group** - Modify the `User` and `Group` settings to match the user account intended to run the service. - 1. Create a dedicated service user: - ```bash - sudo useradd -r -s /bin/false talawa - ``` - - 2. Set proper directory permissions: - ```bash - sudo chown -R talawa:talawa /path/to/talawa-admin - ``` - + - Add your-linux-username in `talawa_admin.service` file here; + ``` + User= + Group= + ``` --- ### Steps to Enable and Manage the Service diff --git a/examples/linux/systemd/talawa_admin.service b/examples/linux/systemd/talawa_admin.service index e3c695943a..a2cce5507e 100644 --- a/examples/linux/systemd/talawa_admin.service +++ b/examples/linux/systemd/talawa_admin.service @@ -24,8 +24,8 @@ Description=Talawa-Admin Service After=network.target [Service] -User=talawa -Group=talawa +User= +Group= Environment=CODEROOT=path/to/your/talawa-admin # Absolute path is needed for working directory From 84389ba1052510f3bf6c16ea2cfc9f043f88f471 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 19:22:50 +0530 Subject: [PATCH 05/27] coderabbit refactor added --- INSTALLATION.md | 8 ++++++++ examples/linux/systemd/talawa_admin.service | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index c81bcd44cb..73e74b9897 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -400,6 +400,13 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a - Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](#setting-up-this-repository) - Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. - It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. +- Ensure you have root or sudo access to configure systemd services. +- Create a dedicated service user: + ```bash + sudo useradd -r -s /bin/false talawa_admin + sudo groupadd -r talawa_admin + sudo usermod -a -G talawa_admin talawa_admin + ``` --- @@ -426,6 +433,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a User= Group= ``` + --- ### Steps to Enable and Manage the Service diff --git a/examples/linux/systemd/talawa_admin.service b/examples/linux/systemd/talawa_admin.service index a2cce5507e..1d9f776ba1 100644 --- a/examples/linux/systemd/talawa_admin.service +++ b/examples/linux/systemd/talawa_admin.service @@ -24,9 +24,10 @@ Description=Talawa-Admin Service After=network.target [Service] -User= -Group= +User=talawa_admin +Group=talawa_admin Environment=CODEROOT=path/to/your/talawa-admin +Environment=NODE_ENV=production # Absolute path is needed for working directory WorkingDirectory=/path/to/your/talawa-admin @@ -40,8 +41,13 @@ EnvironmentFile=/path/to/your/talawa-admin/.env ExecStart=/bin/bash -c "source /path/to/your/.nvm/nvm.sh && nvm use default && npm run serve" Restart=on-failure RemainAfterExit=yes +ProtectSystem=full +NoNewPrivileges=true +PrivateTmp=true Type=simple RuntimeDirectory=talawa-admin + [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target + From ead061cbf9261c5efb8da523064b311d8194c483 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 19:28:49 +0530 Subject: [PATCH 06/27] docs refactor --- INSTALLATION.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 73e74b9897..b7440e7dff 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -428,11 +428,6 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a #### 5. **Adjust User and Group** - Modify the `User` and `Group` settings to match the user account intended to run the service. - - Add your-linux-username in `talawa_admin.service` file here; - ``` - User= - Group= - ``` --- From 1032f49a1a085c15f38ce8084feb361ac88faf73 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 19:34:25 +0530 Subject: [PATCH 07/27] directory permission docs updated --- INSTALLATION.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index b7440e7dff..72d39def5a 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -17,7 +17,7 @@ This document provides instructions on how to set up and start a running instanc - [Prerequisites](#prerequisites-1) - [Development Setup](#development-setup) - [Talawa-Admin Service Setup Guide](#talawa-admin-service-setup-guide) - - [Prerequisites](#prerequisites-2) + - [Prerequisites](#prerequisites-2) - [Service Configuration](#service-configuration) - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) @@ -395,7 +395,7 @@ If you don't want this hook to run, you can manually opt out of this using the ` This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. -### Prerequisites +## Prerequisites - Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](#setting-up-this-repository) - Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. @@ -406,6 +406,11 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a sudo useradd -r -s /bin/false talawa_admin sudo groupadd -r talawa_admin sudo usermod -a -G talawa_admin talawa_admin + # Set proper directory permissions + sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin + sudo chmod 750 /path/to/talawa-admin + sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ + sudo chmod 600 /path/to/talawa-admin/.env ``` --- From e91881b0f0cf9541bee81c31ad42d0f28ffa5e0c Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 17:47:38 +0530 Subject: [PATCH 08/27] lint fix --- INSTALLATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 72d39def5a..45bb01e98c 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -409,7 +409,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a # Set proper directory permissions sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin sudo chmod 750 /path/to/talawa-admin - sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ + sudo find /path/to/talawa-admin -type f -exec chmod 640 {} sudo chmod 600 /path/to/talawa-admin/.env ``` From 50a113f3a1e479fb5ecb5ad89b982ff76185069f Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 18:18:31 +0530 Subject: [PATCH 09/27] lint fix --- INSTALLATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 45bb01e98c..72d39def5a 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -409,7 +409,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a # Set proper directory permissions sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin sudo chmod 750 /path/to/talawa-admin - sudo find /path/to/talawa-admin -type f -exec chmod 640 {} + sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ sudo chmod 600 /path/to/talawa-admin/.env ``` From 2afb1064e75335a47712bcf11946727bc851d5fa Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 19:16:15 +0530 Subject: [PATCH 10/27] CODEROOT added --- examples/linux/systemd/talawa_admin.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/linux/systemd/talawa_admin.service b/examples/linux/systemd/talawa_admin.service index 1d9f776ba1..6dc84b8723 100644 --- a/examples/linux/systemd/talawa_admin.service +++ b/examples/linux/systemd/talawa_admin.service @@ -32,12 +32,11 @@ Environment=NODE_ENV=production # Absolute path is needed for working directory WorkingDirectory=/path/to/your/talawa-admin -EnvironmentFile=/path/to/your/talawa-admin/.env - ################################################################################ # No need to edit anything below here ################################################################################ +EnvironmentFile=$CODEROOT/.env ExecStart=/bin/bash -c "source /path/to/your/.nvm/nvm.sh && nvm use default && npm run serve" Restart=on-failure RemainAfterExit=yes From 8519aad69107f73a9fb714441cc9d04dc5d9143e Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 20:12:38 +0530 Subject: [PATCH 11/27] CODEROOT suggestion added --- examples/linux/systemd/talawa_admin.service | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/linux/systemd/talawa_admin.service b/examples/linux/systemd/talawa_admin.service index 6dc84b8723..87a2bf9082 100644 --- a/examples/linux/systemd/talawa_admin.service +++ b/examples/linux/systemd/talawa_admin.service @@ -37,7 +37,20 @@ WorkingDirectory=/path/to/your/talawa-admin ################################################################################ EnvironmentFile=$CODEROOT/.env -ExecStart=/bin/bash -c "source /path/to/your/.nvm/nvm.sh && nvm use default && npm run serve" +ExecStart=/bin/bash -c '\ + if [ -f "$HOME/.nvm/nvm.sh" ]; then \ + . "$HOME/.nvm/nvm.sh" && \ + if nvm use default; then \ + exec npm run serve \ + else \ + echo "Failed to set Node.js version" >&2; \ + exit 1; \ + fi \ + else \ + echo "NVM not found" >&2; \ + exit 1; \ + fi' + Restart=on-failure RemainAfterExit=yes ProtectSystem=full From e388e892f02b92007a6b45a56f907f54527d9f59 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 23:03:49 +0530 Subject: [PATCH 12/27] Daemon service setup markdown file added --- INSTALLATION.md | 93 +------------------- examples/linux/Talawa-Admin-Service-Setup.md | 93 ++++++++++++++++++++ 2 files changed, 94 insertions(+), 92 deletions(-) create mode 100644 examples/linux/Talawa-Admin-Service-Setup.md diff --git a/INSTALLATION.md b/INSTALLATION.md index 72d39def5a..b5039fb282 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -16,16 +16,6 @@ This document provides instructions on how to set up and start a running instanc - [Installation using Docker](#installation-using-docker) - [Prerequisites](#prerequisites-1) - [Development Setup](#development-setup) -- [Talawa-Admin Service Setup Guide](#talawa-admin-service-setup-guide) - - [Prerequisites](#prerequisites-2) - - [Service Configuration](#service-configuration) - - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) - - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) - - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) - - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) - - [5. **Adjust User and Group**](#5-adjust-user-and-group) - - [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) - - [Troubleshooting](#troubleshooting) @@ -389,85 +379,4 @@ If you don't want this hook to run, you can manually opt out of this using the ` git pull --no-verify
-``` - -# Talawa-Admin Service Setup Guide - -This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. - -## Prerequisites - -- Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](#setting-up-this-repository) -- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. -- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. -- Ensure you have root or sudo access to configure systemd services. -- Create a dedicated service user: - ```bash - sudo useradd -r -s /bin/false talawa_admin - sudo groupadd -r talawa_admin - sudo usermod -a -G talawa_admin talawa_admin - # Set proper directory permissions - sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin - sudo chmod 750 /path/to/talawa-admin - sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ - sudo chmod 600 /path/to/talawa-admin/.env - ``` - ---- - -### Service Configuration - -#### 1. **Copy the `talawa_admin.service` file** - - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: - - For most distributions: `/etc/systemd/system/` - - For systems using `systemd`, this will be the default directory. - -#### 2. **Verify the CODEROOT Path** - - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. - -#### 3. **Set the Correct Working Directory** - - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. - -#### 4. **Ensure the `.env` File Exists** - - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. - -#### 5. **Adjust User and Group** - - Modify the `User` and `Group` settings to match the user account intended to run the service. - ---- - -### Steps to Enable and Manage the Service - -1. **Reload the systemd daemon** to apply changes: - ```bash - sudo systemctl daemon-reload - ``` - -2. **Start the Talawa-Admin Service**: - ```bash - sudo systemctl start talawa_admin.service - ``` - -3. **Stop the Talawa-Admin Service**: - ```bash - sudo systemctl stop talawa_admin.service - ``` - -4. **Enable the Service to Start on Boot**: - ```bash - sudo systemctl enable talawa_admin.service - ``` - ---- - -### Troubleshooting - -- If you encounter any issues, you can check the status and logs of the service: - ```bash - sudo systemctl status talawa_admin.service - sudo journalctl -u talawa_admin.service - ``` - ---- - -By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file +``` \ No newline at end of file diff --git a/examples/linux/Talawa-Admin-Service-Setup.md b/examples/linux/Talawa-Admin-Service-Setup.md new file mode 100644 index 0000000000..426927b4c4 --- /dev/null +++ b/examples/linux/Talawa-Admin-Service-Setup.md @@ -0,0 +1,93 @@ +# Talawa-Admin Service Setup Guide + +## Table of Contents + +- [Prerequisites](#prerequisites-2) +- [Service Configuration](#service-configuration) + - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) + - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) + - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) + - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) + - [5. **Adjust User and Group**](#5-adjust-user-and-group) +- [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) +- [Troubleshooting](#troubleshooting) + + +This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. + +## Prerequisites + +- Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/INSTALLATION.md) +- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. +- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. +- Ensure you have root or sudo access to configure systemd services. +- Create a dedicated service user: + ```bash + sudo useradd -r -s /bin/false talawa_admin + sudo groupadd -r talawa_admin + sudo usermod -a -G talawa_admin talawa_admin + # Set proper directory permissions + sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin + sudo chmod 750 /path/to/talawa-admin + sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ + sudo chmod 600 /path/to/talawa-admin/.env + ``` + +--- + +### Service Configuration + +#### 1. **Copy the `talawa_admin.service` file** + - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: + - For most distributions: `/etc/systemd/system/` + - For systems using `systemd`, this will be the default directory. + +#### 2. **Verify the CODEROOT Path** + - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. + +#### 3. **Set the Correct Working Directory** + - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. + +#### 4. **Ensure the `.env` File Exists** + - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. + +#### 5. **Adjust User and Group** + - Modify the `User` and `Group` settings to match the user account intended to run the service. + +--- + +### Steps to Enable and Manage the Service + +1. **Reload the systemd daemon** to apply changes: + ```bash + sudo systemctl daemon-reload + ``` + +2. **Start the Talawa-Admin Service**: + ```bash + sudo systemctl start talawa_admin.service + ``` + +3. **Stop the Talawa-Admin Service**: + ```bash + sudo systemctl stop talawa_admin.service + ``` + +4. **Enable the Service to Start on Boot**: + ```bash + sudo systemctl enable talawa_admin.service + ``` + +--- + +### Troubleshooting + +- If you encounter any issues, you can check the status and logs of the service: + ```bash + sudo systemctl status talawa_admin.service + sudo journalctl -u talawa_admin.service + ``` + +--- + +By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file From c9d035d5172ecd1e87aeb7b1a375b731e6b3aa1f Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Sun, 5 Jan 2025 23:16:35 +0530 Subject: [PATCH 13/27] changes reset --- INSTALLATION.md | 93 +++++++++++++++++++- examples/linux/Talawa-Admin-Service-Setup.md | 93 -------------------- 2 files changed, 92 insertions(+), 94 deletions(-) delete mode 100644 examples/linux/Talawa-Admin-Service-Setup.md diff --git a/INSTALLATION.md b/INSTALLATION.md index b5039fb282..72d39def5a 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -16,6 +16,16 @@ This document provides instructions on how to set up and start a running instanc - [Installation using Docker](#installation-using-docker) - [Prerequisites](#prerequisites-1) - [Development Setup](#development-setup) +- [Talawa-Admin Service Setup Guide](#talawa-admin-service-setup-guide) + - [Prerequisites](#prerequisites-2) + - [Service Configuration](#service-configuration) + - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) + - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) + - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) + - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) + - [5. **Adjust User and Group**](#5-adjust-user-and-group) + - [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) + - [Troubleshooting](#troubleshooting) @@ -379,4 +389,85 @@ If you don't want this hook to run, you can manually opt out of this using the ` git pull --no-verify
-``` \ No newline at end of file +``` + +# Talawa-Admin Service Setup Guide + +This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. + +## Prerequisites + +- Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](#setting-up-this-repository) +- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. +- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. +- Ensure you have root or sudo access to configure systemd services. +- Create a dedicated service user: + ```bash + sudo useradd -r -s /bin/false talawa_admin + sudo groupadd -r talawa_admin + sudo usermod -a -G talawa_admin talawa_admin + # Set proper directory permissions + sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin + sudo chmod 750 /path/to/talawa-admin + sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ + sudo chmod 600 /path/to/talawa-admin/.env + ``` + +--- + +### Service Configuration + +#### 1. **Copy the `talawa_admin.service` file** + - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: + - For most distributions: `/etc/systemd/system/` + - For systems using `systemd`, this will be the default directory. + +#### 2. **Verify the CODEROOT Path** + - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. + +#### 3. **Set the Correct Working Directory** + - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. + +#### 4. **Ensure the `.env` File Exists** + - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. + +#### 5. **Adjust User and Group** + - Modify the `User` and `Group` settings to match the user account intended to run the service. + +--- + +### Steps to Enable and Manage the Service + +1. **Reload the systemd daemon** to apply changes: + ```bash + sudo systemctl daemon-reload + ``` + +2. **Start the Talawa-Admin Service**: + ```bash + sudo systemctl start talawa_admin.service + ``` + +3. **Stop the Talawa-Admin Service**: + ```bash + sudo systemctl stop talawa_admin.service + ``` + +4. **Enable the Service to Start on Boot**: + ```bash + sudo systemctl enable talawa_admin.service + ``` + +--- + +### Troubleshooting + +- If you encounter any issues, you can check the status and logs of the service: + ```bash + sudo systemctl status talawa_admin.service + sudo journalctl -u talawa_admin.service + ``` + +--- + +By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file diff --git a/examples/linux/Talawa-Admin-Service-Setup.md b/examples/linux/Talawa-Admin-Service-Setup.md deleted file mode 100644 index 426927b4c4..0000000000 --- a/examples/linux/Talawa-Admin-Service-Setup.md +++ /dev/null @@ -1,93 +0,0 @@ -# Talawa-Admin Service Setup Guide - -## Table of Contents - -- [Prerequisites](#prerequisites-2) -- [Service Configuration](#service-configuration) - - [1. **Copy the `talawa_admin.service` file**](#1-copy-the-talawa_adminservice-file) - - [2. **Verify the CODEROOT Path**](#2-verify-the-coderoot-path) - - [3. **Set the Correct Working Directory**](#3-set-the-correct-working-directory) - - [4. **Ensure the `.env` File Exists**](#4-ensure-the-env-file-exists) - - [5. **Adjust User and Group**](#5-adjust-user-and-group) -- [Steps to Enable and Manage the Service](#steps-to-enable-and-manage-the-service) -- [Troubleshooting](#troubleshooting) - - -This guide outlines the steps to set up and manage the Talawa-Admin service on a Linux server using `systemd`. - -## Prerequisites - -- Firstly, You should have locally setup the Talawa-Admin repo using [Setting up this repository](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/INSTALLATION.md) -- Ensure **Node.js** and **npm** are correctly installed and available for the specified user and group. -- It’s recommended to use **nvm** (Node Version Manager) for better management of different Node.js versions. -- Ensure you have root or sudo access to configure systemd services. -- Create a dedicated service user: - ```bash - sudo useradd -r -s /bin/false talawa_admin - sudo groupadd -r talawa_admin - sudo usermod -a -G talawa_admin talawa_admin - # Set proper directory permissions - sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin - sudo chmod 750 /path/to/talawa-admin - sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ - sudo chmod 600 /path/to/talawa-admin/.env - ``` - ---- - -### Service Configuration - -#### 1. **Copy the `talawa_admin.service` file** - - Place the `talawa_admin.service` file in the appropriate systemd directory based on your Linux distribution: - - For most distributions: `/etc/systemd/system/` - - For systems using `systemd`, this will be the default directory. - -#### 2. **Verify the CODEROOT Path** - - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. - -#### 3. **Set the Correct Working Directory** - - Always use the absolute path for the `WorkingDirectory`. Do **not** use `$CODEROOT` in the `WorkingDirectory` field. - -#### 4. **Ensure the `.env` File Exists** - - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. - -#### 5. **Adjust User and Group** - - Modify the `User` and `Group` settings to match the user account intended to run the service. - ---- - -### Steps to Enable and Manage the Service - -1. **Reload the systemd daemon** to apply changes: - ```bash - sudo systemctl daemon-reload - ``` - -2. **Start the Talawa-Admin Service**: - ```bash - sudo systemctl start talawa_admin.service - ``` - -3. **Stop the Talawa-Admin Service**: - ```bash - sudo systemctl stop talawa_admin.service - ``` - -4. **Enable the Service to Start on Boot**: - ```bash - sudo systemctl enable talawa_admin.service - ``` - ---- - -### Troubleshooting - -- If you encounter any issues, you can check the status and logs of the service: - ```bash - sudo systemctl status talawa_admin.service - sudo journalctl -u talawa_admin.service - ``` - ---- - -By following these steps, you can set up and manage the Talawa-Admin service efficiently on your Linux server. \ No newline at end of file From fc675f8eed6b2b8d75455d79c0aeeb1c2cf98f55 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Mon, 6 Jan 2025 20:13:25 +0530 Subject: [PATCH 14/27] added eslint for markdown files --- .eslintrc.json | 18 ++++- package-lock.json | 198 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 3 files changed, 217 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 242ea4f8dc..253591edde 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,8 +33,24 @@ "jest", "import", "eslint-plugin-tsdoc", - "prettier" + "prettier", + "markdown" ], + + "overrides": [ + { + "files": ["**/*.md"], + "processor": "markdown/markdown" + }, + { + "files": ["**/*.md/*.js"], + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } + } + ], + "rules": { "react/destructuring-assignment": "error", "@typescript-eslint/explicit-module-boundary-types": "error", diff --git a/package-lock.json b/package-lock.json index 3b7c816f00..3fcb2459df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,6 +107,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.10.0", + "eslint-plugin-markdown": "^5.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.1", "eslint-plugin-tsdoc": "^0.3.0", @@ -8511,6 +8512,17 @@ "node": ">=10" } }, + "node_modules/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/character-entities-html4": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", @@ -8529,6 +8541,17 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -10433,6 +10456,22 @@ } } }, + "node_modules/eslint-plugin-markdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-5.1.0.tgz", + "integrity": "sha512-SJeyKko1K6GwI0AN6xeCDToXDkfKZfXcexA6B+O2Wr2btUS9GrC+YgwSyVli5DJnctUHjFXcQ2cqTaAmVoLi2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^0.8.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", @@ -12359,6 +12398,32 @@ "loose-envify": "^1.0.0" } }, + "node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -12528,6 +12593,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -12616,6 +12692,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -15560,6 +15647,55 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/mdast-util-from-markdown": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", + "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-from-markdown/node_modules/@types/mdast": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/mdast-util-from-markdown/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-hast": { "version": "13.2.0", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", @@ -15580,6 +15716,17 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-to-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", @@ -15610,6 +15757,27 @@ "node": ">= 8" } }, + "node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, "node_modules/micromark-util-character": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", @@ -16468,6 +16636,36 @@ "node": ">= 0.10" } }, + "node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", diff --git a/package.json b/package.json index cd52ff6453..d20f620895 100644 --- a/package.json +++ b/package.json @@ -117,10 +117,10 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.25.7", "@babel/preset-typescript": "^7.26.0", + "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^12.1.10", - "@testing-library/dom": "^10.4.0", "@types/inquirer": "^9.0.7", "@types/jest": "^26.0.24", "@types/js-cookie": "^3.0.6", @@ -144,6 +144,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.10.0", + "eslint-plugin-markdown": "^5.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.1", "eslint-plugin-tsdoc": "^0.3.0", From 137d7312f0eadffbaa0d62523100e98518b7d7d3 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Mon, 6 Jan 2025 20:49:19 +0530 Subject: [PATCH 15/27] testing-library/react removed on coderabbit suggestion --- package-lock.json | 15 +++++++++++---- package.json | 1 - .../Volunteer/VolunteerManagement.spec.tsx | 3 +-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3fcb2459df..d30b4419a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,6 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.25.7", "@babel/preset-typescript": "^7.26.0", - "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^12.1.10", @@ -5888,6 +5887,7 @@ "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -5907,6 +5907,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5923,6 +5924,7 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -5937,6 +5939,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -5948,7 +5951,8 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@testing-library/jest-dom": { "version": "6.6.3", @@ -6033,7 +6037,8 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -9723,7 +9728,8 @@ "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/dom-align": { "version": "1.12.4", @@ -15522,6 +15528,7 @@ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, + "peer": true, "bin": { "lz-string": "bin/bin.js" } diff --git a/package.json b/package.json index d20f620895..64c063a918 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.25.7", "@babel/preset-typescript": "^7.26.0", - "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^12.1.10", diff --git a/src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx b/src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx index 6fb9c218f9..d5f1957923 100644 --- a/src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx +++ b/src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx @@ -1,7 +1,6 @@ import React from 'react'; import type { RenderResult } from '@testing-library/react'; -import { screen, waitFor } from '@testing-library/dom'; -import { render } from '@testing-library/react'; +import { screen, waitFor, render } from '@testing-library/react'; import { MockedProvider } from '@apollo/react-testing'; import { I18nextProvider } from 'react-i18next'; import i18n from 'utils/i18nForTest'; From bc11733e12048d973a5036b3403cac4f70261a6e Mon Sep 17 00:00:00 2001 From: Sahitya Chandra <167204896+sahitya-chandra@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:48:43 +0530 Subject: [PATCH 16/27] Updated .eslintrc.json --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index af9e921fff..492ba44785 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -170,7 +170,7 @@ "package-lock.json", "tsconfig.json", "docs/**", - "examples/**" + "examples/**", "docs/docusaurus.config.ts", "docs/sidebars.ts", "docs/src/**", From ae588d34a2eb4d95b645559abf849e97985b55e8 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Fri, 3 Jan 2025 17:44:20 +0530 Subject: [PATCH 17/27] .eslintignore deleted and INSTALLATION.md updated --- .eslintrc.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 492ba44785..cda1186619 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -183,5 +183,13 @@ "@typescript-eslint/explicit-function-return-type": "off" } } +======= + "src/components/CheckIn/tagTemplate.ts", + "package.json", + "package-lock.json", + "tsconfig.json", + "docs/**", + "examples/**" +>>>>>>> 325ec7de (.eslintignore deleted and INSTALLATION.md updated) ] } From f4dc91c33077c444db49bc264948eec5e3d9345e Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Thu, 9 Jan 2025 16:12:30 +0530 Subject: [PATCH 18/27] some fixes --- .eslintrc.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index cda1186619..492ba44785 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -183,13 +183,5 @@ "@typescript-eslint/explicit-function-return-type": "off" } } -======= - "src/components/CheckIn/tagTemplate.ts", - "package.json", - "package-lock.json", - "tsconfig.json", - "docs/**", - "examples/**" ->>>>>>> 325ec7de (.eslintignore deleted and INSTALLATION.md updated) ] } From 90b5ae288e79b0f8509be37d2067ec5905d09435 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Thu, 9 Jan 2025 16:21:58 +0530 Subject: [PATCH 19/27] refactor done --- .eslintrc.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 492ba44785..62c42dfca0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,6 +48,12 @@ "no-unused-vars": "off", "no-undef": "off" } + }, + { + "files": ["*.js"], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off" + } } ], @@ -175,13 +181,5 @@ "docs/sidebars.ts", "docs/src/**", "docs/blog/**" - ], - "overrides": [ - { - "files": ["*.js"], - "rules": { - "@typescript-eslint/explicit-function-return-type": "off" - } - } ] } From 8432fba11b5fb73d18edbd29c6b594ebf8a534f3 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Thu, 9 Jan 2025 16:29:53 +0530 Subject: [PATCH 20/27] merge conflict resolved --- .eslintrc.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 62c42dfca0..449398c074 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,12 +48,6 @@ "no-unused-vars": "off", "no-undef": "off" } - }, - { - "files": ["*.js"], - "rules": { - "@typescript-eslint/explicit-function-return-type": "off" - } } ], From e5443623ca5ea35184e4deb36506dbee98a26764 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Thu, 9 Jan 2025 16:56:20 +0530 Subject: [PATCH 21/27] fixes --- .eslintrc.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 449398c074..62c42dfca0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,6 +48,12 @@ "no-unused-vars": "off", "no-undef": "off" } + }, + { + "files": ["*.js"], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off" + } } ], From be029827520e608f782324bada875ce517ac36de Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 15:17:58 +0530 Subject: [PATCH 22/27] some code cleanup --- .eslintrc.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 62c42dfca0..253591edde 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,12 +48,6 @@ "no-unused-vars": "off", "no-undef": "off" } - }, - { - "files": ["*.js"], - "rules": { - "@typescript-eslint/explicit-function-return-type": "off" - } } ], @@ -176,10 +170,6 @@ "package-lock.json", "tsconfig.json", "docs/**", - "examples/**", - "docs/docusaurus.config.ts", - "docs/sidebars.ts", - "docs/src/**", - "docs/blog/**" + "examples/**" ] } From 3c6506a4dec6a9e2ca87d29118eba00c4011c222 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 15:40:40 +0530 Subject: [PATCH 23/27] docs update --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbe448c807..c9dd796f82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ The process of proposing a change to Talawa Admin can be summarized as: ``` npm install npm run test --watchAll=false --coverage - genhtml coverage/lcov.info -o coverage + genhtml coverage/jest/lcov.info -o coverage ``` 3. The output of the `npm run test` command will give you a tablular coverage report per file 4. The overall coverage rate will be visible on the penultimate line of the `genhtml` command's output. From 95697b8f76339a2274eb43b7b370fd56fbb37062 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 16:00:44 +0530 Subject: [PATCH 24/27] docs update --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9dd796f82..c6b1e0c7e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -162,7 +162,7 @@ The process of proposing a change to Talawa Admin can be summarized as: 1. After making changes you can add them to git locally using `git add `(to add changes only in a particular file) or `git add .` (to add all changes). 1. After adding the changes you need to commit them using `git commit -m ''`(look at the commit guidelines below for commit messages). -1. Once you have successfully commited your changes, you need to push the changes to the forked repo on github using: `git push origin `.(Here branch name must be name of the branch you want to push the changes to.) +1. Once you have successfully commited your changes, you need to push the changes to the forked repo on github using: `git push origin `.(Here branch name must be name of the branch you want to push the changes to). 1. Now create a pull request to the Talawa-admin repository from your forked repo. Open an issue regarding the same and link your PR to it. 1. Ensure the test suite passes, either locally or on CI once a PR has been created. 1. Review and address comments on your pull request if requested. From 117baa32f63efbcb835cbd994904f4653ffeb038 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 16:30:26 +0530 Subject: [PATCH 25/27] docs updated according to code rabbit --- INSTALLATION.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/INSTALLATION.md b/INSTALLATION.md index 72d39def5a..ab47af2de2 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -422,6 +422,14 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a - For most distributions: `/etc/systemd/system/` - For systems using `systemd`, this will be the default directory. + // Optional Steps... + - Verify service file permissions and ownership: + ```bash + sudo chmod 644 /etc/systemd/system/talawa_admin.service + sudo chown root:root /etc/systemd/system/talawa_admin.service + sudo systemd-analyze verify talawa_admin.service + ``` + #### 2. **Verify the CODEROOT Path** - Ensure that the `CODEROOT` environment variable matches the absolute path to the Talawa-Admin code directory. @@ -430,6 +438,15 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a #### 4. **Ensure the `.env` File Exists** - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. + + // Optional Steps... + - Validate environment file permissions and configuration: + ```bash + sudo chmod 600 /path/to/talawa-admin/.env + sudo chown talawa_admin:talawa_admin /path/to/talawa-admin/.env + # Verify environment variables are loaded + sudo systemctl show-environment + ``` #### 5. **Adjust User and Group** - Modify the `User` and `Group` settings to match the user account intended to run the service. From 5399d220c30520b14d0f7cfed64187b2c83f13aa Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 16:37:13 +0530 Subject: [PATCH 26/27] docs updated according to code rabbit --- INSTALLATION.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index ab47af2de2..63cc8c38dc 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -406,11 +406,13 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a sudo useradd -r -s /bin/false talawa_admin sudo groupadd -r talawa_admin sudo usermod -a -G talawa_admin talawa_admin - # Set proper directory permissions - sudo chown -R talawa_admin:talawa_admin /path/to/talawa-admin - sudo chmod 750 /path/to/talawa-admin - sudo find /path/to/talawa-admin -type f -exec chmod 640 {} \ - sudo chmod 600 /path/to/talawa-admin/.env + # Get the absolute path to your talawa-admin installation + INSTALL_PATH=$(pwd) + + sudo chown -R talawa_admin:talawa_admin $INSTALL_PATH + sudo chmod 750 $INSTALL_PATH + sudo find $INSTALL_PATH -type f -exec chmod 640 {} \; + sudo chmod 600 $INSTALL_PATH/.env ``` --- @@ -422,7 +424,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a - For most distributions: `/etc/systemd/system/` - For systems using `systemd`, this will be the default directory. - // Optional Steps... + - Verify service file permissions and ownership: ```bash sudo chmod 644 /etc/systemd/system/talawa_admin.service @@ -439,7 +441,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a #### 4. **Ensure the `.env` File Exists** - Verify that the path in the `EnvironmentFile` line points to a valid `.env` file located in the root directory of the Talawa-Admin repository. - // Optional Steps... + - Validate environment file permissions and configuration: ```bash sudo chmod 600 /path/to/talawa-admin/.env @@ -463,6 +465,8 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a 2. **Start the Talawa-Admin Service**: ```bash sudo systemctl start talawa_admin.service + # Verify service started successfully + sudo systemctl status talawa_admin.service ``` 3. **Stop the Talawa-Admin Service**: From 8d30102ebf9f07e0ca9817c4c13dd3a01b9ed602 Mon Sep 17 00:00:00 2001 From: Sahitya Chandra Date: Tue, 14 Jan 2025 16:55:10 +0530 Subject: [PATCH 27/27] docs updated --- INSTALLATION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INSTALLATION.md b/INSTALLATION.md index 63cc8c38dc..5bdd0f78c3 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -448,6 +448,7 @@ This guide outlines the steps to set up and manage the Talawa-Admin service on a sudo chown talawa_admin:talawa_admin /path/to/talawa-admin/.env # Verify environment variables are loaded sudo systemctl show-environment + ``` #### 5. **Adjust User and Group**