Skip to content

Configure Secure CDN Root Directory for File Storage#7

Open
ItsHugoo wants to merge 5 commits intosouravg77:ac1b4def-e6b6-46ff-b94c-6aa773429112from
ItsHugoo:configure-cdn-file-storage-1749669742
Open

Configure Secure CDN Root Directory for File Storage#7
ItsHugoo wants to merge 5 commits intosouravg77:ac1b4def-e6b6-46ff-b94c-6aa773429112from
ItsHugoo:configure-cdn-file-storage-1749669742

Conversation

@ItsHugoo
Copy link
Copy Markdown

@ItsHugoo ItsHugoo commented Jun 11, 2025

Configure Secure CDN Root Directory for File Storage

Description

Task

Configure CDN root directory for file storage

Acceptance Criteria

  • CDN root directory is configurable
  • Directory is created automatically if not present
  • Proper read/write permissions are enforced
  • Platform-independent path resolution
  • Comprehensive error handling

Summary of Work

This pull request implements a robust configuration for the CDN root directory, ensuring secure and reliable file storage for our content delivery network.

Changes Made

  • Created CdnConfig class in src/config/cdn.config.ts
  • Implemented static method to get CDN root directory path
  • Added directory creation and permission validation logic
  • Used path.resolve() to create a platform-independent absolute path
  • Configured default CDN directory as 'cdn-files' in the project root

Implementation Details

  • Uses process.cwd() to dynamically determine the project root
  • Creates 'cdn-files' directory if it doesn't exist
  • Checks read and write permissions for the directory
  • Throws descriptive errors if directory cannot be created or accessed

Security Considerations

  • Uses recursive directory creation to handle nested paths
  • Validates directory permissions before allowing operations
  • Provides clear error messages without exposing system details

Testing

  • Validated directory creation mechanism
  • Verified permission checking logic
  • Ensured error handling for various scenarios

Notes

  • Default CDN directory is 'cdn-files' in project root
  • Can be easily modified or made configurable in future iterations

Changes Made

  • Created CdnConfig class in src/config/cdn.config.ts
  • Implemented CDN root directory path resolution
  • Added directory creation and permission validation
  • Configured default 'cdn-files' directory

Tests

  • Verify CDN directory is created
  • Check read and write permissions
  • Validate error handling for directory access
  • Confirm path resolution works correctly

Signatures

Staking Key

HtDSDViFnKSD9X2TD1kTZAtkF7xHJrjBLntr8z4BZpfb: 7LEi3NneF8Hai3FRv9kny3JKRvFpSmZm4HDUVuY7mcc2HgTSpvQPXvr8RZp8kVnv1ANSKsX4TevpM7gmAWmDyT2W4HMFhPeJwpysCyLmtxHkaFWmcCvwRmNGUjhqiWb5USW9LSDP8qK5aBUfz6P96Mb26YcMFcxbG5ALuiwv5UoFyiGBtYD9J9kjm5JbsRXNWC7UC5ATp68HzyheSGk8QvUHXUGHUj8WYm1NLKhGaNCwkJwATr7wRvwtSgr6PhfikMrbesBDoxL11P3CcVfqyFreWpoPNicQhRgow863qb9e7EsfE9BRaQ8PfZBN24PQGM1tCCfVZCYCqb3etFNYBDwpsYuaPJmXUH2ZHWgQyHyMk9mbH9EkiHivT98yJE4TQpNuDYwFgPCqv14EaGoj3hH4PnS8Y1dLG

Public Key

4g6jT7dSFNEy2NafTaQb6oe2M73jZjfznuz9WTfvKvyg: 2TLPe41N1LBhRe51TeUL7DkMiwsqtQwvf5wuoDH94e824FTVP1AAkBz7BgWsnWj6z6rfHQGjgiT6sxz5FxDxXEWdXP9zPy1neWff59DHzwoVTvpyA587GvHME1mX4vTWyNtWSqczAwa2HUXTxUxP2yhp8yFsVTQDwkguH2MWJ8waLFiS3dUcVVYrULR27NdVxzSd8FiDXbykfDi9f9hMwPV15mEmYUVyRynFze5BucwKPqaiFVXo2QtCFQ9nVdT6qNmy1xbFZn2sQwZjDk5i3MxaRTMrCfAJohauEcuyxLboQ28XvAsS92Zxi4KPk2vk1EhN5DKkMCutYYjSM9bN6ogbzGntJiST3tbwAPFsBVBKXVQbSNsybZy9cEyQnE1DC786M8ij9tNGiTUKqD1ECpvuAQ4oDYw6k

@ItsHugoo ItsHugoo changed the title [WIP] Setup CDN File Storage Directory with Secure Permissions Configure Secure CDN Root Directory for File Storage Jun 11, 2025
@ItsHugoo ItsHugoo marked this pull request as ready for review June 11, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant