diff --git a/src/server/index.js b/src/server/index.js index 3ee3671a78..7bb01dd9c2 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -48,11 +48,11 @@ const getTimestamp = async () => { throw new Error('Invalid file path detected'); } - const MAX_FILE_SIZE = 10 * 1024; // 10 KB max file size - const stats = await promisify(fs.stat)(filePath); - if (stats.size > MAX_FILE_SIZE) { - throw new Error('File is too large and may cause DoS issues'); - } + // const MAX_FILE_SIZE = 10 * 1024; // 10 KB max file size + // const stats = await promisify(fs.stat)(filePath); + // if (stats.size > MAX_FILE_SIZE) { + // throw new Error('File is too large and may cause DoS issues'); + // } const fileContent = await promisify(fs.readFile)(filePath, 'utf-8'); diff --git a/src/server/services/communities.js b/src/server/services/communities.js index 745a7e4246..17e163d81a 100644 --- a/src/server/services/communities.js +++ b/src/server/services/communities.js @@ -44,13 +44,13 @@ const getValidIds = async (METADATA_PATH) => { // Check if the file exists await promisify(fs.access)(uri); - // Get file stats - const stats = await promisify(fs.stat)(uri); - const MAX_FILE_SIZE = 1 * 1024 * 1024; // 1 MB - if (stats.size > MAX_FILE_SIZE) { - console.warn(`Metadata file too large for ID: ${id}`); - return null; // Exclude invalid ID - } + // // Get file stats + // const stats = await promisify(fs.stat)(uri); + // const MAX_FILE_SIZE = 1 * 1024 * 1024; // 1 MB + // if (stats.size > MAX_FILE_SIZE) { + // console.warn(`Metadata file too large for ID: ${id}`); + // return null; // Exclude invalid ID + // } // Parse and validate JSON const meta = JSON.parse(await promisify(fs.readFile)(uri, 'utf8')); @@ -61,6 +61,7 @@ const getValidIds = async (METADATA_PATH) => { if (typeof subdomain === 'string') { SUBDOMAIN_COMMUNITY[subdomain] = id; } else { + // eslint-disable-next-line no-console console.warn(`Invalid subdomain entry for ID: ${id}`); } }); @@ -68,14 +69,16 @@ const getValidIds = async (METADATA_PATH) => { return id; } catch (e) { + // eslint-disable-next-line no-console console.error(`Error processing metadata for ID: ${id}`, e.message); - return null; + return []; } }); const results = await Promise.all(validationPromises); VALID_IDS = results.filter(id => id !== null); } catch (err) { + // eslint-disable-next-line no-console console.error(`Error reading metadata directory: ${METADATA_PATH}`, err.message); return []; } diff --git a/src/shared/components/Contentful/ArticleCard/ArticleCard.jsx b/src/shared/components/Contentful/ArticleCard/ArticleCard.jsx index b627dcab1c..27ccea70ca 100644 --- a/src/shared/components/Contentful/ArticleCard/ArticleCard.jsx +++ b/src/shared/components/Contentful/ArticleCard/ArticleCard.jsx @@ -64,6 +64,11 @@ class ArticleCard extends React.Component { themeName, } = this.props; + if (!theme) { + // eslint-disable-next-line no-console + console.log('ArticleCard: missing theme property'); + } + // determine if article cards will redirect to external link or article details page const articlePageUrl = article.externalArticle && article.contentUrl ? article.contentUrl