Commit Graph

5 Commits

Author SHA1 Message Date
cc4ee09906 refactor: use local repository git config instead of global
- Skip problematic global .gitconfig in /var/www
- Use local repository config (.git/config) instead
- Avoids permission issues with /var/www directory
- Public repos don't need global config
- Simpler 4-step process with better error handling
2026-08-04 03:11:43 +05:30
b5950d48e3 fix: ensure .gitconfig created with www-data ownership from start
- Create .gitconfig as www-data user (not root)
- Ensures file has correct owner and permissions from creation
- Add fallback to use local repository git config if global fails
- Prevents 'could not lock config file' permission errors

This fixes the issue where www-data user cannot write to root-owned files
2026-08-04 03:10:06 +05:30
0e597b47da simplify: optimize setup script for public repositories
For public repos, only minimal git config needed:
- Fix corrupted .gitconfig file
- Set git user.name and user.email (required by git)
- Remove unnecessary SSL and SSH configuration
- Fix directory permissions for www-data user
- Test git status

Removed:
- SSH key setup (not needed for public repos)
- SSL verification config (not needed for public HTTPS)
- HTTPS remote URL configuration (already correct)

Updated from 8 steps to 5 simpler steps
2026-08-04 03:08:19 +05:30
a01771fa4d fix: handle corrupted .gitconfig file permissions
- Remove corrupted /var/www/.gitconfig file
- Create fresh .gitconfig with correct owner (www-data)
- Set proper permissions (600) before git config commands
- This prevents 'could not lock config file' permission errors
2026-08-04 03:06:41 +05:30
9156bb2ebd improve: comprehensive git diagnostics and automated setup script
Enhanced error reporting:
- Show detailed diagnostic information: git version, user config, email, remote, branch
- Check .git directory and config file existence
- Detect if repository has uncommitted changes
- Error categorization: PERMISSION, CONFIG, REPO, NETWORK, SSL, GIT errors
- Actionable error messages with command suggestions
- Report raw error output to log file for debugging

Added setup_git_config.sh script:
- Automated configuration for www-data user
- Creates .ssh directory with proper permissions
- Sets git user.name and user.email globally
- Disables SSL verification (for HTTPS repos)
- Configures git to use HTTPS remote URL
- Fixes directory ownership and permissions
- Tests git status to verify configuration

Usage on live server:
  sudo bash setup_git_config.sh

This script handles the common git configuration issues
that prevent 'Update HMS' button from working.
2026-08-04 03:04:53 +05:30