diff --git a/docs/docs.yaml b/docs/docs.yaml deleted file mode 100644 index e28399d..0000000 --- a/docs/docs.yaml +++ /dev/null @@ -1,140 +0,0 @@ -newsletterService: - purpose: "Manage newsletter subscription/unsubscription by validating, sanitizing, and persisting emails." - lifecycleRole: "Handles subscription HTTP requests; persists email data asynchronously." - dependencies: - upstream: - - emailValidator - downstream: - - newsletter route handlers/controllers - - user-facing newsletter API controllers - dataFlow: - inputs: "Raw email string from HTTP request." - outputs: "Promise resolving on save/remove success or rejecting on errors." - sideEffects: "Asynchronous JSON file read/write for email storage." - performanceAndScalability: - bottlenecks: - - "Serialized writeLock causing concurrency bottleneck." - - "Disk IO latency and potential blocking." - concurrency: "Write serialization to prevent race conditions." - securityAndStability: - validation: "Email validation applied." - vulnerabilities: - - "No rate limiting/throttling." - - "Plaintext JSON storage risks data exposure." - - "No input sanitation beyond email format." - - "Single-file storage is single point of failure." - architectureAssessment: - coupling: "Tightly coupled to filesystem persistence." - abstraction: "No database or caching layer." - recommendations: - - "Migrate persistence to database or key-value store." - - "Add rate limiting on endpoints." - - "Encrypt stored emails or restrict file access." - - "Use write queues or batch processing." - - "Add structured logging for audit/debug." - -postsMenuService: - purpose: "Generate hierarchical blog post menu grouped by year and month." - lifecycleRole: "Used in route handlers or middleware to prepare navigation data." - dependencies: - upstream: - - getAllPosts utility - - qualifyLink utility - downstream: - - blog listing route handlers - - UI rendering templates or API endpoints - dataFlow: - inputs: "Base directory path of posts." - outputs: "Nested array representing menu structure." - sideEffects: "None." - performanceAndScalability: - bottlenecks: - - "File system scans expensive with many posts." - - "No caching leading to repeated expensive IO." - concurrency: "No explicit concurrency concerns." - securityAndStability: - validation: "No input validation on base directory." - vulnerabilities: "Potential malformed post metadata." - architectureAssessment: - coupling: "Depends heavily on file IO utilities." - abstraction: "No caching or memoization abstraction." - recommendations: - - "Add caching or memoization." - - "Validate input parameters." - - "Consider background processing for large data." - -rssFeedService: - purpose: "Generate RSS feed XML for all published blog posts." - lifecycleRole: "Triggered on `/rss.xml` requests." - dependencies: - upstream: - - getAllPosts utility - - rss XML builder library - downstream: - - RSS feed route handlers - dataFlow: - inputs: "Post base directory and site URL." - outputs: "RSS XML string." - sideEffects: "None." - performanceAndScalability: - bottlenecks: - - "File IO delays and XML generation cost proportional to post count." - - "No caching causes redundant regeneration." - concurrency: "Potential performance degradation under high load." - securityAndStability: - validation: "No sanitization of post content for XML compliance." - vulnerabilities: "Malformed XML risk if post data is invalid." - architectureAssessment: - coupling: "Tied to file IO and external XML library." - abstraction: "No caching or streaming implementation." - recommendations: - - "Implement caching and regenerate on content changes." - - "Sanitize post content for XML." - - "Stream RSS output for large feeds." - -sitemapService: - purpose: "Build comprehensive sitemap combining static pages, posts, and tags." - lifecycleRole: "Handles `/sitemap.xml` or sitemap API requests." - dependencies: - upstream: - - getAllPosts utility - - gray-matter markdown parser - - fast-glob file locator - - internal aggregation methods - downstream: - - sitemap route handlers - - SEO utilities or build scripts - dataFlow: - inputs: "Content directories and static sitemap JSON." - outputs: "Structured sitemap tree and flattened arrays." - sideEffects: "Filesystem reads; console warnings on errors." - performanceAndScalability: - bottlenecks: - - "Multiple async file reads and JSON parsing." - - "No caching causes repeated heavy IO." - concurrency: "High IO load under concurrent requests." - securityAndStability: - validation: "No validation of frontmatter; risk of sensitive metadata exposure." - vulnerabilities: "File read scope risks." - architectureAssessment: - coupling: "Heavy dependency on multiple IO and parsing utilities." - abstraction: "No persistent caching or pre-generation." - recommendations: - - "Add persistent caching refreshed on content changes." - - "Validate and sanitize frontmatter." - - "Restrict file reads to safe directories." - - "Pre-generate sitemap at build/deploy time." - -crossCuttingSummary: - themes: - - "Excessive file IO and parsing affecting performance." - - "Lack of caching across all services." - - "Minimal error handling and validation." - - "Single points of failure in persistence methods." - - "Security gaps in input sanitization and data storage." - systemRecommendations: - - "Migrate persistent data from flat files to databases or cache layers." - - "Implement caching mechanisms to reduce IO overhead." - - "Add robust validation, sanitization, and error handling." - - "Decouple expensive computations from request lifecycle." - - "Secure storage and access to sensitive data." diff --git a/docs/routes.yaml b/docs/routes.yaml index 91d3adc..0ffeb1c 100644 --- a/docs/routes.yaml +++ b/docs/routes.yaml @@ -213,23 +213,6 @@ - Modularize routing by feature domain. - Consider lazy loading routes if feasible. -crossCuttingSummary: - commonThemes: - - Heavy reliance on synchronous or blocking IO (filesystem, SQLite). - - Security concerns centralized in route handlers rather than middleware. - - Lack of deterministic or background scheduling for maintenance tasks (token cleanup). - - Insufficient input validation and sanitization in analytics and admin modules. - - Risk of performance bottlenecks in DB writes and file reads without caching. - - Coupling varies; some modules isolated, others tightly coupled with utilities. - - Potential vulnerabilities from silent failure modes and open redirect vectors. - overallRecommendations: - - Shift heavy logic to middleware or background jobs. - - Implement robust input validation and sanitization universally. - - Use caching layers for static or infrequently changing data. - - Schedule cleanup and maintenance outside request lifecycle. - - Modularize and decouple routing for maintainability. - - Add rate limiting and monitoring for analytics and critical paths. - indexRoot: purpose: Handles root (/) route rendering home page with recent blog posts. lifecycleRole: First route executed on base URL GET requests. @@ -381,11 +364,28 @@ - Enforce token rotation and revocation policies - Ensure concurrency-safe token cleanup crossCuttingSummary: - - Most modules serve as HTTP route handlers with minimal state or side effects. - - Static content modules have negligible security or performance concerns. - - Modules reading from filesystem or generating dynamic content face potential I/O bottlenecks. - - Validation is inconsistent; dynamic data modules require stronger input sanitization and output filtering. - - Token management critical for security; requires robust concurrency and storage protections. - - Caching and rate limiting absent, presenting performance and DoS risk. - - Architectural coupling mostly loose except for token manager tightly coupled to admin routes. - - Recommendations converge on improved caching, validation, security hardening, and concurrency control. + themes: + - Most modules serve as HTTP route handlers with minimal state or side effects. + - Static content modules have negligible security or performance concerns. + - Modules reading from filesystem or generating dynamic content face potential I/O bottlenecks. + - Validation is inconsistent; dynamic data modules require stronger input sanitization and output filtering. + - Token management critical for security; requires robust concurrency and storage protections. + - Caching and rate limiting absent, presenting performance and DoS risk. + - Architectural coupling mostly loose except for token manager tightly coupled to admin routes. + - Recommendations converge on improved caching, validation, security hardening, and concurrency control. + + commonThemes: + - Heavy reliance on synchronous or blocking IO (filesystem, SQLite). + - Security concerns centralized in route handlers rather than middleware. + - Lack of deterministic or background scheduling for maintenance tasks (token cleanup). + - Insufficient input validation and sanitization in analytics and admin modules. + - Risk of performance bottlenecks in DB writes and file reads without caching. + - Coupling varies; some modules isolated, others tightly coupled with utilities. + - Potential vulnerabilities from silent failure modes and open redirect vectors. + overallRecommendations: + - Shift heavy logic to middleware or background jobs. + - Implement robust input validation and sanitization universally. + - Use caching layers for static or infrequently changing data. + - Schedule cleanup and maintenance outside request lifecycle. + - Modularize and decouple routing for maintainability. + - Add rate limiting and monitoring for analytics and critical paths. diff --git a/docs/services.yaml b/docs/services.yaml new file mode 100644 index 0000000..e28399d --- /dev/null +++ b/docs/services.yaml @@ -0,0 +1,140 @@ +newsletterService: + purpose: "Manage newsletter subscription/unsubscription by validating, sanitizing, and persisting emails." + lifecycleRole: "Handles subscription HTTP requests; persists email data asynchronously." + dependencies: + upstream: + - emailValidator + downstream: + - newsletter route handlers/controllers + - user-facing newsletter API controllers + dataFlow: + inputs: "Raw email string from HTTP request." + outputs: "Promise resolving on save/remove success or rejecting on errors." + sideEffects: "Asynchronous JSON file read/write for email storage." + performanceAndScalability: + bottlenecks: + - "Serialized writeLock causing concurrency bottleneck." + - "Disk IO latency and potential blocking." + concurrency: "Write serialization to prevent race conditions." + securityAndStability: + validation: "Email validation applied." + vulnerabilities: + - "No rate limiting/throttling." + - "Plaintext JSON storage risks data exposure." + - "No input sanitation beyond email format." + - "Single-file storage is single point of failure." + architectureAssessment: + coupling: "Tightly coupled to filesystem persistence." + abstraction: "No database or caching layer." + recommendations: + - "Migrate persistence to database or key-value store." + - "Add rate limiting on endpoints." + - "Encrypt stored emails or restrict file access." + - "Use write queues or batch processing." + - "Add structured logging for audit/debug." + +postsMenuService: + purpose: "Generate hierarchical blog post menu grouped by year and month." + lifecycleRole: "Used in route handlers or middleware to prepare navigation data." + dependencies: + upstream: + - getAllPosts utility + - qualifyLink utility + downstream: + - blog listing route handlers + - UI rendering templates or API endpoints + dataFlow: + inputs: "Base directory path of posts." + outputs: "Nested array representing menu structure." + sideEffects: "None." + performanceAndScalability: + bottlenecks: + - "File system scans expensive with many posts." + - "No caching leading to repeated expensive IO." + concurrency: "No explicit concurrency concerns." + securityAndStability: + validation: "No input validation on base directory." + vulnerabilities: "Potential malformed post metadata." + architectureAssessment: + coupling: "Depends heavily on file IO utilities." + abstraction: "No caching or memoization abstraction." + recommendations: + - "Add caching or memoization." + - "Validate input parameters." + - "Consider background processing for large data." + +rssFeedService: + purpose: "Generate RSS feed XML for all published blog posts." + lifecycleRole: "Triggered on `/rss.xml` requests." + dependencies: + upstream: + - getAllPosts utility + - rss XML builder library + downstream: + - RSS feed route handlers + dataFlow: + inputs: "Post base directory and site URL." + outputs: "RSS XML string." + sideEffects: "None." + performanceAndScalability: + bottlenecks: + - "File IO delays and XML generation cost proportional to post count." + - "No caching causes redundant regeneration." + concurrency: "Potential performance degradation under high load." + securityAndStability: + validation: "No sanitization of post content for XML compliance." + vulnerabilities: "Malformed XML risk if post data is invalid." + architectureAssessment: + coupling: "Tied to file IO and external XML library." + abstraction: "No caching or streaming implementation." + recommendations: + - "Implement caching and regenerate on content changes." + - "Sanitize post content for XML." + - "Stream RSS output for large feeds." + +sitemapService: + purpose: "Build comprehensive sitemap combining static pages, posts, and tags." + lifecycleRole: "Handles `/sitemap.xml` or sitemap API requests." + dependencies: + upstream: + - getAllPosts utility + - gray-matter markdown parser + - fast-glob file locator + - internal aggregation methods + downstream: + - sitemap route handlers + - SEO utilities or build scripts + dataFlow: + inputs: "Content directories and static sitemap JSON." + outputs: "Structured sitemap tree and flattened arrays." + sideEffects: "Filesystem reads; console warnings on errors." + performanceAndScalability: + bottlenecks: + - "Multiple async file reads and JSON parsing." + - "No caching causes repeated heavy IO." + concurrency: "High IO load under concurrent requests." + securityAndStability: + validation: "No validation of frontmatter; risk of sensitive metadata exposure." + vulnerabilities: "File read scope risks." + architectureAssessment: + coupling: "Heavy dependency on multiple IO and parsing utilities." + abstraction: "No persistent caching or pre-generation." + recommendations: + - "Add persistent caching refreshed on content changes." + - "Validate and sanitize frontmatter." + - "Restrict file reads to safe directories." + - "Pre-generate sitemap at build/deploy time." + +crossCuttingSummary: + themes: + - "Excessive file IO and parsing affecting performance." + - "Lack of caching across all services." + - "Minimal error handling and validation." + - "Single points of failure in persistence methods." + - "Security gaps in input sanitization and data storage." + systemRecommendations: + - "Migrate persistent data from flat files to databases or cache layers." + - "Implement caching mechanisms to reduce IO overhead." + - "Add robust validation, sanitization, and error handling." + - "Decouple expensive computations from request lifecycle." + - "Secure storage and access to sensitive data." diff --git a/docs/utils.yaml b/docs/utils.yaml index 105557e..55c809f 100644 --- a/docs/utils.yaml +++ b/docs/utils.yaml @@ -1,5 +1,7 @@ baseContext: - purpose: Asynchronously build base context object with site-wide data for rendering views. + purpose: + - Asynchronously build base context object with site-wide data for rendering views. + - Construct rendering context and helpers for templates. lifecycleRole: Prepare shared context before rendering templates. dependencies: upstream: @@ -7,30 +9,51 @@ - utilityFunctions (formatMonths, filterSecureLinks) - environmentVariables - jsonContentFiles + - getBaseContext + - qualifyLink + - generateToken downstream: - routeHandlers - controllers rendering pages with standard site context + - view renderers dataFlow: - inputs: isAuthenticated boolean, optional context overrides - outputs: context object with UI state, navigation, menus, environment-configured values - sideEffects: None beyond reading filesystem and environment variables + inputs: + - isAuthenticated boolean + - optional context overrides + - req.isAuthenticated + outputs: + - context object with UI state, navigation, menus, environment-configured values + - res.locals.baseContext + - custom render functions + sideEffects: + - Token generation + - async file reads performanceAndScalability: bottlenecks: - async file reads (getPostsMenu) delay on slow IO - reliance on correct environment variable settings - possible navLinks JSON file read failures or malformed data + - Token generation per request concurrency: None securityAndStability: - validation: Filters secure links based on authentication; requires validation of dynamic environment variables + validation: + - Filters secure links based on authentication + - Requires validation of dynamic environment variables + - Dynamic content used in views must be escaped vulnerabilities: - - risk of environment variable injection if unvalidated + - Risk of environment variable injection if unvalidated + - Token misuse via URLs architectureAssessment: - coupling: Moderate coupling to post menu service, utilities, environment - abstraction: Centralizes context building to promote DRY templates + coupling: Moderate coupling to post menu service, utilities, environment, token logic + abstraction: + - Centralizes context building to promote DRY templates + - Rendering context injection recommendations: - - cache menu and navLinks to reduce IO per request - - validate environment variables at startup - - memoize within request lifecycle to avoid repeated calls + - Cache menu and navLinks to reduce IO per request + - Validate environment variables at startup + - Memoize within request lifecycle to avoid repeated calls + - Cache static context + - Sanitize dynamic content BaseRoute: purpose: Define base class encapsulating Express Router instance for modular route classes. @@ -106,33 +129,36 @@ recommendations: - add error handling middleware for render failures - log access to construction pages for prioritization - createExcerpt: - purpose: Generate plain-text excerpt from markdown by stripping syntax and truncating with ellipsis. - lifecycleRole: Used during post content processing for previews or summaries. + purpose: Generate plain-text excerpt from markdown content by stripping syntax and truncating. + lifecycleRole: Used during post content processing and metadata creation for previews or summaries. dependencies: - upstream: [] + upstream: markdown content downstream: - post rendering logic - summary generation modules - UI components needing brief previews + - post metadata dataFlow: - inputs: markdown content string, optional character limit - outputs: truncated plain-text excerpt + inputs: markdown content string, optional character limit (default ~200 chars) + outputs: truncated plain-text excerpt substring sideEffects: None performanceAndScalability: bottlenecks: None; pure function concurrency: None securityAndStability: - validation: Basic regex stripping; no HTML sanitization needed due to plain text output + validation: + - Basic regex or parsing to strip markdown syntax vulnerabilities: - incomplete markdown parsing risks malformed excerpts + - truncation may cut mid-word architectureAssessment: - coupling: Low coupling; utility function - abstraction: Simplistic markdown to plain text conversion + coupling: Low; standalone utility + abstraction: Markdown to plain text excerpt converter recommendations: - - use dedicated markdown parser for accuracy if needed - - cache excerpts if content is static to reduce recomputation + - Use dedicated markdown parser for accuracy if precision required + - Truncate cleanly at word or sentence boundaries + - Cache excerpts for static content to reduce recomputation diskSpaceMonitor: purpose: Monitor disk space usage of log directory, auto-clean old logs/session data per thresholds. @@ -205,19 +231,6 @@ - maintain regex patterns to cover RFC edge cases - sanitize inputs to avoid injection -crossCuttingSummary: - commonThemes: - - Emphasis on caching to reduce repeated IO and improve performance. - - Need for improved error handling and logging across modules. - - Security focus on input validation, environment variable checks, and safe file operations. - - Architectural preference for modular, loosely coupled utilities and route abstractions. - - Performance concerns center on async file IO, recursive directory scanning, and potential event loop blocking. - recurrentIssues: - - Lack of concurrency controls in async cleanup or context building. - - Potential injection risks via unvalidated environment variables or input data. - - Incomplete validation risking malformed data or security exposures. - - Limited error handling that may cause silent failures or degraded UX. - - Absence of configuration management consistency for thresholds, paths, and operational parameters. logging: purpose: Implements a logging system combining Winston, file logs, SQLite transport, and console patching with a custom 'security' level. lifecycleRole: Global utility during request/response lifecycle and runtime. @@ -382,32 +395,51 @@ recommendations: - Validate inputs strictly - Handle email delivery errors - postFileUtils: - purpose: Reads blog post files and metadata. - lifecycleRole: Used by blog routes during page rendering. + purpose: + - Reads blog post files and metadata. + - Parses frontmatter, excerpts, and metadata from markdown files. + lifecycleRole: Used by blog routes and post retrieval during page rendering. dependencies: - upstream: Filesystem + upstream: + - Filesystem + - gray-matter + - createExcerpt + - hash util + - fs, path downstream: - blog route handlers + - blog services + - menu/rss/sitemap generators dataFlow: - inputs: Blog file paths. - outputs: Parsed content and metadata. - sideEffects: File reads. + inputs: + - Blog file paths + - directory and options tags/sort + outputs: + - Parsed content and metadata + - array of post metadata objects + sideEffects: + - File reads performanceAndScalability: bottlenecks: - - Disk I/O + - Disk I/O, including recursive reads + - in-memory sorting concurrency: None securityAndStability: - validation: File name sanitation required. + validation: + - File name sanitation required + - Validate slug/tags/title/date vulnerabilities: - Path traversal + - malformed frontmatter + - unsanitized metadata architectureAssessment: - coupling: Filepath tightly coupled. - abstraction: Content loader. + coupling: Moderate coupling; filepath handling tightly linked + abstraction: Content loader and parser utility recommendations: - Sanitize paths - - Cache parsed content + - Cache parsed content using LRU or indexed cache + - Implement indexing and depth limits for recursive reads forensics: purpose: Performs security analysis on form data to detect abuse. @@ -552,63 +584,6 @@ - Remove IP bypass - Consider JWT-based approach -baseContext: - purpose: Constructs rendering context and helpers for templates. - lifecycleRole: Before view rendering. - dependencies: - upstream: - - getBaseContext - - qualifyLink - - generateToken - downstream: - - view renderers - dataFlow: - inputs: req.isAuthenticated. - outputs: res.locals.baseContext, custom render functions. - sideEffects: Token generation. - performanceAndScalability: - bottlenecks: - - Token generation per request - concurrency: None - securityAndStability: - validation: Dynamic content used in views must be escaped. - vulnerabilities: - - Token misuse via URLs - architectureAssessment: - coupling: Moderate. - abstraction: Rendering context injection. - recommendations: - - Cache static context - - Sanitize dynamic content - -controllers: - purpose: Loads controller modules dynamically and attaches to request. - lifecycleRole: Early middleware before route handling. - dependencies: - upstream: - - loadControllers - - ../models - downstream: - - all route handlers - dataFlow: - inputs: None - outputs: req.controllers, req.models. - sideEffects: Dynamic module loading. - performanceAndScalability: - bottlenecks: - - Load time on startup - concurrency: None - securityAndStability: - validation: Loaded module safety. - vulnerabilities: - - Unsafe dynamic code loading - architectureAssessment: - coupling: Moderate. - abstraction: Dynamic loader. - recommendations: - - Cache controllers - - Validate loaded modules - csrfToken: purpose: Provides CSRF protection using cookie tokens. lifecycleRole: Before routes rendering or processing forms. @@ -716,28 +691,6 @@ - Use async logger - Add log level filtering -crossCuttingSummary: - commonThemes: - - Logging is synchronous in several modules, needs async or buffered approach. - - In-memory structures (adminToken, authCheck, CSRF) lack persistence for distributed deployment. - - Lack of input validation and sanitization (analytics, mail, hcaptcha). - - Middleware ordering and isolation are critical for performance and correctness. - - Token-based modules should add entropy and expiry control. - - Error and logging modules must sanitize output and handle I/O failures gracefully. - - Several modules depend on external services (auth, hcaptcha, SMTP) with no retry or fallback logic. - - sharedRisks: - - Exposure of sensitive data through logs or tokens. - - Performance bottlenecks from synchronous operations. - - Security risks from lack of validation, unsanitized inputs, weak tokens. - - Architectural fragility due to tight coupling in dynamic loaders and hardcoded configurations. - - generalRecommendations: - - Centralize validation and sanitization. - - Use distributed cache where persistence is needed. - - Refactor logging to be async and non-blocking. - - Harden security in token, cookie, and middleware interactions. - - Monitor and test all middleware under load. utils: purpose: Collection of support functions for middleware and app logic. lifecycleRole: Used across app lifecycle to abstract functionality. @@ -926,40 +879,6 @@ - Sanitize markdown output - Restrict source directories -postFileUtils: - purpose: Parse frontmatter, excerpts, and metadata from markdown files. - lifecycleRole: Used during post retrieval. - dependencies: - upstream: - - gray-matter - - createExcerpt - - hash util - - fs, path - downstream: - - blog services - - menu/rss/sitemap generators - dataFlow: - inputs: directory and options tags/sort - outputs: array of post metadata objects - sideEffects: file reads - performanceAndScalability: - bottlenecks: - - recursive disk I/O - - in-memory sorting - concurrency: None - securityAndStability: - validation: None - vulnerabilities: - - malformed frontmatter - - unsanitized metadata - architectureAssessment: - coupling: Moderate - abstraction: Content parser utility - recommendations: - - Implement caching/ indexing - - Validate slug/tags/title/date - - Use LRU or depth limits - parseMarkdownFile: purpose: Read and parse markdown file frontmatter and content. lifecycleRole: Called during post parsing. @@ -971,7 +890,7 @@ - postFileUtils dataFlow: inputs: file path - outputs: {data, content} + outputs: { data, content } sideEffects: None performanceAndScalability: bottlenecks: sync disk read @@ -987,30 +906,6 @@ - Add error handling - Validate data schema -createExcerpt: - purpose: Generate first 200-char excerpt from content. - lifecycleRole: Used in post metadata creation. - dependencies: - upstream: markdown content - downstream: post metadata - dataFlow: - inputs: markdown content string - outputs: excerpt substring - sideEffects: None - performanceAndScalability: - bottlenecks: None - concurrency: None - securityAndStability: - validation: None - vulnerabilities: - - may truncate mid-word - architectureAssessment: - coupling: None - abstraction: Simple utility - recommendations: - - Strip markdown syntax - - Truncate cleanly at word or sentence boundary - crossCuttingSummary: commonThemes: - Heavy synchronous file I/O across services; slows responses. @@ -1018,13 +913,45 @@ - Validation and sanitization missing for metadata, markdown, user input. - File‑based storage used where DB would scale better. - Utilities assume trusted environment; risk in public apps. + - Logging is synchronous in several modules, needs async or buffered approach. + - In-memory structures (adminToken, authCheck, CSRF) lack persistence for distributed deployment. + - Lack of input validation and sanitization (analytics, mail, hcaptcha). + - Middleware ordering and isolation are critical for performance and correctness. + - Token-based modules should add entropy and expiry control. + - Error and logging modules must sanitize output and handle I/O failures gracefully. + - Several modules depend on external services (auth, hcaptcha, SMTP) with no retry or fallback logic. + - Emphasis on caching to reduce repeated IO and improve performance. + - Need for improved error handling and logging across modules. + - Security focus on input validation, environment variable checks, and safe file operations. + - Architectural preference for modular, loosely coupled utilities and route abstractions. + - Performance concerns center on async file IO, recursive directory scanning, and potential event loop blocking. sharedRisks: + - Exposure of sensitive data through logs or tokens. + - Performance bottlenecks from synchronous operations. + - Security risks from lack of validation, unsanitized inputs, weak tokens. + - Architectural fragility due to tight coupling in dynamic loaders and hardcoded configurations. - Data corruption under concurrent writes (newsletter JSON). - Path traversal or content injection via markdown routes. - Performance degradation under load. generalRecommendations: + - Centralize validation and sanitization. + - Use distributed cache where persistence is needed. + - Refactor logging to be async and non-blocking. + - Harden security in token, cookie, and middleware interactions. + - Monitor and test all middleware under load. - Introduce caching for computed outputs. - Move persistent data to database. - Add validation/sanitization across all parsing and input. - Use async I/O. - Secure file paths and sanitize content before rendering. + recurrentIssues: + - Lack of concurrency controls in async cleanup or context building. + - Potential injection risks via unvalidated environment variables or input data. + - Incomplete validation risking malformed data or security exposures. + - Limited error handling that may cause silent failures or degraded UX. + - Absence of configuration management consistency for thresholds, paths, and operational parameters. + - Centralize validation and sanitization. + - Use distributed cache where persistence is needed. + - Refactor logging to be async and non-blocking. + - Harden security in token, cookie, and middleware interactions. + - Monitor and test all middleware under load. diff --git a/navLinks.json b/navLinks.json index 9e91ee3..1227743 100644 --- a/navLinks.json +++ b/navLinks.json @@ -53,6 +53,10 @@ "label": "Development" }, { + "href": "https://jenkins.jasonpoage.com", + "label": "Jenkins" + }, + { "href": "https://auth.jasonpoage.com/api/logout", "method": "post", "label": "Logout"