skyl / corpora

Corpora is a self-building corpus that can help build other arbitrary corpora
GNU Affero General Public License v3.0
2 stars 0 forks source link

revise(devcontainer): new setup QoL - port 8877 #41

Closed skyl closed 1 week ago

skyl commented 1 week ago

PR Type

enhancement, configuration changes


Description


Changes walkthrough 📝

Relevant files
Configuration changes
setup.sh
Set default shell to zsh for vscode user                                 

.devcontainer/setup.sh - Added command to change default shell to zsh for user `vscode`.
+1/-0     
docker-compose.yaml
Update docker-compose for gitconfig and optimization notes

docker-compose.yaml
  • Commented out mounting of host .gitconfig.
  • Added comments for potential Dockerfile optimization.
  • +7/-1     
    Enhancement
    Dockerfile
    Optimize Dockerfile setup and permissions                               

    .devcontainer/Dockerfile
  • Removed redundant command to set zsh as default shell.
  • Installed OpenAPI Generator CLI globally.
  • Changed ownership of /workspace to vscode user.
  • +2/-3     
    Documentation
    docker-compose-celery.md
    Remove gitconfig mount in documentation                                   

    md/notes/docker-compose-celery.md - Removed mounting of host `.gitconfig`.
    +0/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    github-actions[bot] commented 1 week ago

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Smell
    The use of `sudo` in the `chsh` command to change the default shell for the `vscode` user might not be necessary if the script is already running with elevated privileges. This should be verified to ensure that `sudo` is required. Code Smell
    The `sudo` command is used in the `npm install` line, which might not be necessary if the script is executed with the appropriate permissions. Consider verifying if `sudo` is needed here. Configuration Comment
    The commented-out section for mounting `.gitconfig` suggests a potential configuration change. Ensure that the decision to comment this out aligns with the intended development workflow and does not hinder necessary git configurations.
    github-actions[bot] commented 1 week ago

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Verify the existence of the user before changing its default shell ___ **Ensure that the vscode user exists on the system before attempting to change its
    default shell to prevent potential errors.** [.devcontainer/setup.sh [7]](https://github.com/skyl/corpora/pull/41/files#diff-aaf9e7764a12876cbe70d492c719e21e8590390a38d0f037193a765df858fdbfR7-R7) ```diff -sudo chsh -s /bin/zsh vscode +id -u vscode &>/dev/null && sudo chsh -s /bin/zsh vscode ```
    Suggestion importance[1-10]: 8 Why: This suggestion prevents potential errors by ensuring the 'vscode' user exists before attempting to change its shell, which enhances robustness and prevents script failures.
    8
    Security
    Avoid using sudo for running commands that can be executed by a non-root user ___ **Consider using a non-root user for running the openapi-generator-cli to enhance
    security and avoid unnecessary use of sudo.** [.devcontainer/Dockerfile [19]](https://github.com/skyl/corpora/pull/41/files#diff-13bd9d7a30bf46656bc81f1ad5b908a627f9247be3f7d76df862b0578b534fc6R19-R19) ```diff -RUN npm install -g @openapitools/openapi-generator-cli && sudo openapi-generator-cli version +RUN npm install -g @openapitools/openapi-generator-cli && openapi-generator-cli version ```
    Suggestion importance[1-10]: 7 Why: The suggestion improves security by recommending the removal of unnecessary 'sudo' usage, which is a good practice for minimizing root privileges.
    7