Conversation
Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
… version, update README Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
Co-authored-by: cashpilotthrive-hue <245611892+cashpilotthrive-hue@users.noreply.github.com>
Merged pull request #35.
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive Personal Linux System Setup automation framework for configuring development environments across multiple Linux distributions (Ubuntu/Debian, Fedora, and Arch Linux). The setup provides automated package installation, development tool configuration, dotfile management, and system configuration with a modular script architecture.
Changes:
- Added automated setup scripts supporting multiple package managers (apt, dnf, pacman) with essential packages, development tools (Node.js, Python, Docker), and system configuration
- Implemented dotfile management system with backup functionality for bash, git, vim, and tmux configurations
- Created comprehensive documentation including installation guides, usage instructions, and CI/CD workflow integration with GitHub Actions for syntax validation
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.sh | Main orchestration script that detects the package manager and executes installation steps sequentially |
| install.sh | Quick one-line installer that clones the repository and prepares scripts for execution |
| scripts/install-packages.sh | Handles essential package installation across three package managers |
| scripts/install-devtools.sh | Installs development tools including Node.js, Python, Docker, and GitHub CLI |
| scripts/setup-dotfiles.sh | Manages dotfile backup and deployment to user's home directory |
| scripts/configure-system.sh | Configures git settings, bash aliases, and SSH directory permissions |
| dotfiles/.bashrc | Enhanced bash configuration with cross-distribution aliases and utility functions |
| dotfiles/.gitconfig | Git configuration template with aliases and sensible defaults |
| dotfiles/.vimrc | Vim editor configuration with modern settings and keybindings |
| dotfiles/.tmux.conf | Tmux multiplexer configuration with intuitive prefix and pane management |
| config/packages.txt | Package reference list for documentation purposes |
| README.md | Project overview with quick start guide and feature list |
| USAGE.md | Detailed usage instructions, customization guide, and troubleshooting |
| WORKFLOW_PREVIEW.md | Documentation of the GitHub Actions CI/CD workflow |
| PROJECT_SUMMARY.md | Comprehensive project completion summary with statistics |
| LICENSE | MIT License for the project |
| .gitignore | Git ignore patterns for temporary files and build artifacts |
| .github/workflows/test-setup.yml | GitHub Actions workflow for syntax validation and structure verification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
scripts/install-devtools.sh
Outdated
| # Install Docker Compose | ||
| if ! command -v docker-compose &> /dev/null; then | ||
| echo "Installing Docker Compose..." | ||
| DOCKER_COMPOSE_VERSION="v2.24.5" |
There was a problem hiding this comment.
The Docker Compose version v2.24.5 is hardcoded and may become outdated. Consider using a variable at the top of the script or fetching the latest version dynamically to ensure users get the most recent stable release with security patches and bug fixes.
dotfiles/.gitconfig
Outdated
| [user] | ||
| name = Your Name | ||
| email = your.email@example.com |
There was a problem hiding this comment.
The user's name and email are placeholder values that should be customized. Consider adding a comment or warning in the setup script to remind users to update these values before using git, or implement an interactive prompt to collect this information during setup.
| [user] | |
| name = Your Name | |
| email = your.email@example.com | |
| # NOTE: | |
| # Update the following user name and email before using git. | |
| # These are placeholders and should be replaced with your actual identity. | |
| [user] | |
| name = CHANGE_ME_NAME | |
| email = CHANGE_ME_EMAIL@example.com |
scripts/setup-dotfiles.sh
Outdated
| echo "Backing up existing $file to ${file}.backup" | ||
| cp "$HOME/$file" "$HOME/${file}.backup" |
There was a problem hiding this comment.
The backup function overwrites existing backup files without warning. If the setup script is run multiple times, the original backup will be lost. Consider checking for existing backups or using timestamped backup filenames to preserve all versions.
| echo "Backing up existing $file to ${file}.backup" | |
| cp "$HOME/$file" "$HOME/${file}.backup" | |
| local backup_path="$HOME/${file}.backup" | |
| if [ -f "$backup_path" ]; then | |
| local timestamp | |
| timestamp="$(date +%Y%m%d%H%M%S)" | |
| backup_path="$HOME/${file}.backup.${timestamp}" | |
| fi | |
| echo "Backing up existing $file to ${backup_path#$HOME/}" | |
| cp "$HOME/$file" "$backup_path" |
| # Create useful aliases | ||
| if ! grep -q "# Custom aliases" ~/.bashrc; then | ||
| echo "" >> ~/.bashrc | ||
| echo "# Custom aliases" >> ~/.bashrc | ||
| echo "alias ll='ls -alF'" >> ~/.bashrc | ||
| echo "alias la='ls -A'" >> ~/.bashrc | ||
| echo "alias l='ls -CF'" >> ~/.bashrc | ||
| echo "alias ..='cd ..'" >> ~/.bashrc | ||
| echo "alias ...='cd ../..'" >> ~/.bashrc | ||
| echo "alias gs='git status'" >> ~/.bashrc | ||
| echo "alias ga='git add'" >> ~/.bashrc | ||
| echo "alias gc='git commit'" >> ~/.bashrc | ||
| echo "alias gp='git push'" >> ~/.bashrc | ||
| echo "alias gl='git log --oneline --graph --decorate'" >> ~/.bashrc | ||
| fi | ||
|
|
There was a problem hiding this comment.
This script modifies the user's .bashrc file by appending aliases without checking if they might conflict with existing custom aliases. If the script is run multiple times, it could append duplicate alias definitions. Consider adding logic to check if aliases already exist before appending them.
| # Create useful aliases | |
| if ! grep -q "# Custom aliases" ~/.bashrc; then | |
| echo "" >> ~/.bashrc | |
| echo "# Custom aliases" >> ~/.bashrc | |
| echo "alias ll='ls -alF'" >> ~/.bashrc | |
| echo "alias la='ls -A'" >> ~/.bashrc | |
| echo "alias l='ls -CF'" >> ~/.bashrc | |
| echo "alias ..='cd ..'" >> ~/.bashrc | |
| echo "alias ...='cd ../..'" >> ~/.bashrc | |
| echo "alias gs='git status'" >> ~/.bashrc | |
| echo "alias ga='git add'" >> ~/.bashrc | |
| echo "alias gc='git commit'" >> ~/.bashrc | |
| echo "alias gp='git push'" >> ~/.bashrc | |
| echo "alias gl='git log --oneline --graph --decorate'" >> ~/.bashrc | |
| fi | |
| # Create useful aliases | |
| if ! grep -q "# Custom aliases" ~/.bashrc; then | |
| echo "" >> ~/.bashrc | |
| echo "# Custom aliases" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+ll=' ~/.bashrc; then | |
| echo "alias ll='ls -alF'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+la=' ~/.bashrc; then | |
| echo "alias la='ls -A'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+l=' ~/.bashrc; then | |
| echo "alias l='ls -CF'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+\.\.=' ~/.bashrc; then | |
| echo "alias ..='cd ..'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+\.\.\.=' ~/.bashrc; then | |
| echo "alias ...='cd ../..'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+gs=' ~/.bashrc; then | |
| echo "alias gs='git status'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+ga=' ~/.bashrc; then | |
| echo "alias ga='git add'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+gc=' ~/.bashrc; then | |
| echo "alias gc='git commit'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+gp=' ~/.bashrc; then | |
| echo "alias gp='git push'" >> ~/.bashrc | |
| fi | |
| if ! grep -qE '^[[:space:]]*alias[[:space:]]+gl=' ~/.bashrc; then | |
| echo "alias gl='git log --oneline --graph --decorate'" >> ~/.bashrc | |
| fi |
README.md
Outdated
| - GitHub CLI (gh) | ||
|
|
||
| ### Optional Tools | ||
| - GitHub CLI (gh) |
There was a problem hiding this comment.
GitHub CLI (gh) is listed under both 'Development Tools' (line 37) and 'Optional Tools' (line 40), creating an inconsistency in the documentation. It should only be listed once to avoid confusion about whether it's installed by default or optional.
| - GitHub CLI (gh) |
| fi | ||
|
|
||
| # Keep sudo alive | ||
| while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & |
There was a problem hiding this comment.
The background sudo keepalive process may continue running indefinitely if the script exits unexpectedly. Consider adding a trap to clean up the background process on script exit to prevent orphaned processes that could pose a security risk.
| while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
| while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
| SUDO_KEEPALIVE_PID=$! | |
| trap 'kill "$SUDO_KEEPALIVE_PID" 2>/dev/null || true' EXIT |
install.sh
Outdated
| if [ -d "$INSTALL_DIR" ]; then | ||
| echo "Directory $INSTALL_DIR already exists. Updating..." | ||
| cd "$INSTALL_DIR" | ||
| git pull |
There was a problem hiding this comment.
The git pull command on line 29 could fail if there are local changes or merge conflicts, but the script continues without error handling. This could lead to running setup.sh with outdated code. Consider adding error checking or using git pull --ff-only to fail safely if updates cannot be applied cleanly.
| sudo usermod -aG docker $USER | ||
| rm /tmp/get-docker.sh | ||
| ;; | ||
| dnf) | ||
| sudo dnf install -y docker | ||
| sudo systemctl start docker | ||
| sudo systemctl enable docker | ||
| sudo usermod -aG docker $USER | ||
| ;; | ||
| pacman) | ||
| sudo pacman -S --noconfirm docker | ||
| sudo systemctl start docker | ||
| sudo systemctl enable docker | ||
| sudo usermod -aG docker $USER | ||
| ;; |
There was a problem hiding this comment.
The script adds the user to the docker group but this change only takes effect after logout/login or using newgrp. The script should inform users about this requirement more prominently, or provide instructions to complete the Docker setup. Currently, users might try to use Docker immediately after setup and encounter permission errors.
dotfiles/.bashrc
Outdated
| export PATH="$HOME/bin:$HOME/.local/bin:$PATH" | ||
|
|
||
| # Load additional bash completion if available | ||
| if ! shopt -oq posix; then | ||
| if [ -f /usr/share/bash-completion/bash_completion ]; then | ||
| . /usr/share/bash-completion/bash_completion | ||
| elif [ -f /etc/bash_completion ]; then | ||
| . /etc/bash_completion | ||
| fi | ||
| fi | ||
|
|
||
| # Node.js and npm | ||
| export NPM_CONFIG_PREFIX="$HOME/.npm-global" | ||
| export PATH="$NPM_CONFIG_PREFIX/bin:$PATH" | ||
|
|
||
| # Python | ||
| export PATH="$HOME/.local/bin:$PATH" |
There was a problem hiding this comment.
The PATH is modified multiple times (lines 82, 95, 98) which could lead to duplicate entries if the bashrc is sourced multiple times. Consider using a conditional check before adding directories to PATH, or use a function that deduplicates PATH entries.
install.sh
Outdated
| chmod +x scripts/*.sh | ||
|
|
There was a problem hiding this comment.
The scripts are not made executable in the repository, and line 37-38 use chmod to make them executable after cloning. However, the main setup.sh is also made executable on line 37. If scripts directory doesn't exist or is empty when this runs, the chmod command could fail silently or produce an error. Consider adding error checking or making the scripts executable in the repository itself using git update-index --chmod=+x.
| chmod +x scripts/*.sh | |
| # Only attempt to chmod scripts if the directory exists and contains .sh files | |
| if [ -d "scripts" ]; then | |
| # Ensure unmatched globs expand to nothing instead of the literal pattern | |
| shopt -s nullglob | |
| script_files=(scripts/*.sh) | |
| if ((${#script_files[@]})); then | |
| chmod +x "${script_files[@]}" | |
| fi | |
| shopt -u nullglob | |
| fi |
…l-network-scanning
- Add warning comment to .gitconfig for placeholder values - Remove duplicate PATH entry in .bashrc - Remove duplicate GitHub CLI listing in README.md - Add idempotent checks for alias additions in configure-system.sh - Use timestamped backup filenames in setup-dotfiles.sh - Add safer script chmod handling in install.sh - Add trap to cleanup sudo keepalive process in setup.sh
approve all