autonomys / astral

Home of our Block Explorer
https://explorer.subspace.network
11 stars 9 forks source link

Improve docker config #922

Closed marc-aurele-besner closed 1 week ago

marc-aurele-besner commented 1 week ago

User description

Improve docker config


PR Type

enhancement, configuration changes


Description


Changes walkthrough πŸ“

Relevant files
Configuration changes
docker-compose.yml
Enhance service configuration and simplify healthchecks   

docker-compose.yml
  • Added --sync full to the command arguments.
  • Simplified healthcheck test syntax for multiple services.
  • +7/-24   
    Enhancement
    Caddyfile
    Improve WebSocket handling and reverse proxy configuration

    indexers/Caddyfile
  • Added WebSocket handling with specific headers.
  • Configured reverse proxy for WebSocket traffic over HTTP/1.1.
  • +16/-0   
    Dependencies
    dictionary
    Update subproject commit reference                                             

    indexers/dictionary - Updated subproject commit reference.
    +1/-1     

    πŸ’‘ PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    netlify[bot] commented 1 week ago

    Deploy Preview for dev-astral ready!

    Name Link
    Latest commit cd4ce4598e4a3b3def2024446c7f663fdc80cbed
    Latest deploy log https://app.netlify.com/sites/dev-astral/deploys/672cbeec6f55d900088805ef
    Deploy Preview https://deploy-preview-922--dev-astral.netlify.app
    Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    github-actions[bot] commented 1 week ago

    PR Reviewer Guide πŸ”

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 πŸ”΅πŸ”΅πŸ”΅βšͺβšͺ
    πŸ§ͺ No relevant tests
    πŸ”’ No security concerns identified
    ⚑ Recommended focus areas for review

    Configuration Change
    The addition of "--sync full" to the command arguments in the docker-compose.yml file could significantly affect the performance and behavior of the service. This change should be thoroughly tested to ensure it does not negatively impact the system's performance or stability. WebSocket Configuration
    The new WebSocket handling configuration in the Caddyfile introduces specific headers and forces HTTP/1.1 for WebSocket traffic. This setup requires careful review to ensure compatibility and security, especially in production environments.
    github-actions[bot] commented 1 week ago

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Improve error handling for WebSocket reverse proxy configurations ___ **Add error handling or logging for the reverse proxy configuration to aid in
    troubleshooting and monitoring the WebSocket connections.** [indexers/Caddyfile [18-25]](https://github.com/autonomys/astral/pull/922/files#diff-8c93321a56d0377d04ecc3800259cf3f6d0f3dc73681ea63f4b91ac0b46f5ed2R18-R25) ```diff reverse_proxy @websockets node:9944 { transport http { versions h1 # Force HTTP/1.1 only for WebSocket traffic } header_up Connection "Upgrade" header_up Upgrade "websocket" + handle_errors { + respond "WebSocket connection error" + } } ```
    Suggestion importance[1-10]: 7 Why: Adding error handling to the reverse proxy configuration for WebSocket connections is a significant improvement for monitoring and troubleshooting.
    7
    Enhance the reliability of health checks by providing a fallback mechanism ___ **Consider adding a retry mechanism or fallback URL for the healthcheck command to
    ensure service availability in case the primary URL fails.** [docker-compose.yml [162]](https://github.com/autonomys/astral/pull/922/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R162-R162) ```diff -test: ["CMD", "curl", "-f", "http://dictionary_subquery_node:3000/ready"] +test: ["CMD", "curl", "-f", "http://dictionary_subquery_node:3000/ready" || "curl", "-f", "http://fallback_url:3000/ready"] ```
    Suggestion importance[1-10]: 6 Why: Adding a fallback URL for health checks increases the robustness of the system. This suggestion is practical and enhances service reliability.
    6
    Security
    Assess the security implications of the --unsafe flag in service configurations ___ **Review the necessity of the --unsafe flag in various service configurations to
    ensure it is required and does not pose a security risk.** [docker-compose.yml [290]](https://github.com/autonomys/astral/pull/922/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R290-R290) ```diff -- --unsafe +- --unsafe # Confirm necessity and assess security implications ```
    Suggestion importance[1-10]: 5 Why: Reviewing the necessity and security implications of the `--unsafe` flag is important, but the suggestion lacks specific actionable advice beyond a comment for review.
    5
    Possible issue
    Verify compatibility of the --sync option with other settings ___ **Ensure that the --sync option is compatible with other command-line arguments to
    prevent conflicts or unexpected behavior.** [docker-compose.yml [68-69]](https://github.com/autonomys/astral/pull/922/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R68-R69) ```diff "--sync", -"full", +"full", # Ensure compatibility with other options ```
    Suggestion importance[1-10]: 3 Why: The suggestion to verify compatibility is valid but low impact as it only advises checking without specific actionable changes.
    3
    socket-security[bot] commented 1 week ago

    New dependencies detected. Learn more about Socket for GitHub β†—οΈŽ

    Package New capabilities Transitives Size Publisher
    npm/axios@1.7.5 network 0 2.12 MB jasonsaayman
    npm/chalk-template@1.1.0 None 0 13.7 kB sindresorhus
    npm/chalk@5.3.0 None 0 43.7 kB sindresorhus
    npm/follow-redirects@1.15.6 network 0 29.4 kB rubenverborgh
    npm/form-data@4.0.0 filesystem, network 0 43.4 kB niftylettuce
    npm/hasura-cli@2.36.2 environment 0 25.4 kB jjangga0214

    View full reportβ†—οΈŽ