danstis / read2burn

transport passwords more secure by email
0 stars 0 forks source link

feat: enhance encryption and update dependencies #182

Open danstis opened 3 weeks ago

danstis commented 3 weeks ago

PR Type

enhancement, dependencies, configuration changes


Description


Changes walkthrough πŸ“

Relevant files
Enhancement
3 files
index.js
Implement encryption refactoring and error handling           

routes/index.js
  • Introduced a new CryptorFactory class and Cryptor classes for
    encryption and decryption.
  • Replaced the deprecated key parameter with id for identifying entries.
  • Added error handling for invalid arguments and server errors.
  • Refactored encryption logic to support multiple versions.
  • +212/-44
    app.js
    Update database import and export configuration                   

    app.js
  • Updated nedb import to use @seald-io/nedb.
  • Reordered imports for better organization.
  • Exported nedb instance for external usage.
  • +5/-4     
    index.ejs
    Update form input field for entry identification                 

    views/index.ejs - Changed hidden input field from `key` to `id`.
    +1/-17   
    Configuration changes
    3 files
    docker-image.yml
    Add Docker image CI workflow                                                         

    .github/workflows/docker-image.yml
  • Added a new GitHub Actions workflow for Docker image CI.
  • Configured Docker build and push steps.
  • +56/-0   
    Dockerfile
    Update Git repository URL in Dockerfile                                   

    docker/Dockerfile - Updated Git repository URL for cloning.
    +1/-1     
    docker-compose.yml
    Update Docker Compose service configuration                           

    docker/docker-compose.yml
  • Updated Docker image reference to use wemove/read2burn:latest.
  • Removed unused environment variable configuration.
  • +1/-3     
    Dependencies
    1 files
    package.json
    Update project dependencies                                                           

    package.json
  • Updated several dependencies including express, body-parser, and i18n.
  • Added new dependencies @seald-io/nedb and base-x.
  • +10/-9   
    Documentation
    1 files
    readme.md
    Simplify Docker usage instructions                                             

    docker/readme.md
  • Simplified Docker run instructions.
  • Removed outdated build and push instructions.
  • +3/-16   
    Additional files (token-limit)
    1 files
    package-lock.json
    ...                                                                                                           

    package-lock.json ...
    +1552/-429

    πŸ’‘ PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    sophie-syntax[bot] commented 3 weeks ago

    PR Reviewer Guide πŸ”

    ⏱️ Estimated effort to review: 4 πŸ”΅πŸ”΅πŸ”΅πŸ”΅βšͺ
    πŸ§ͺ No relevant tests
    πŸ”’ No security concerns identified
    ⚑ Key issues to review

    Possible Bug
    The loop for checking if a generated key already exists in the database does not wait for the database query to complete due to JavaScript's non-blocking nature. This might result in an infinite loop or incorrect data being inserted into the database. Security Concern
    The method `decrypt` in `CryptorV1` uses `crypto.createDecipher`, which is deprecated and considered insecure. It should be replaced with `crypto.createDecipheriv` for better security. Error Handling
    The error handling in the encryption and decryption process does not differentiate between different types of errors (e.g., database errors, encryption errors), which might lead to misleading error messages being shown to the user.