Merge pull request #1 from outis1one/claude/review-repo-docs-QFDqX

Claude/review repo docs qf dq x
This commit is contained in:
outis1one
2025-12-27 19:29:44 -05:00
committed by GitHub
2 changed files with 217 additions and 117 deletions
+5 -5
View File
@@ -56,12 +56,12 @@ Automated setup script for Ubuntu 24.04 Desktop that installs essential tools, c
### 1. Download the Script ### 1. Download the Script
```bash ```bash
# Download (replace URL with actual location) # Clone the repository
wget https://your-domain.com/post-install.sh git clone https://github.com/outis1one/post-ubuntu-install.git
cd post-ubuntu-install
# Or create manually # Or download the script directly
nano post-install.sh wget https://raw.githubusercontent.com/outis1one/post-ubuntu-install/main/ubuntu-post-install.sh -O post-install.sh
# Paste the script content and save (Ctrl+O, Enter, Ctrl+X)
``` ```
### 2. Make Executable ### 2. Make Executable
+147 -47
View File
@@ -243,6 +243,80 @@ echo "Verifying Docker installation..."
docker --version || echo "Warning: Docker verification failed" docker --version || echo "Warning: Docker verification failed"
docker compose version || echo "Warning: Docker Compose verification failed" docker compose version || echo "Warning: Docker Compose verification failed"
# Samba File Sharing (Optional)
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "SAMBA FILE SHARING (Optional)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Samba allows you to share folders over the network to Windows, Mac, and Linux."
echo "The script will share your primary drive at ~/drives/primary"
echo ""
read -p "Install and configure Samba file sharing? (y/n): " INSTALL_SAMBA
if [ "$INSTALL_SAMBA" = "y" ] || [ "$INSTALL_SAMBA" = "Y" ]; then
echo ""
echo "Installing Samba file sharing..."
echo " - Samba: SMB/CIFS file server for network file sharing"
echo ""
apt install -y samba || echo "Warning: Samba installation failed, continuing..."
# Configure Samba share for primary drive
if command -v smbd &> /dev/null; then
echo ""
echo "Configuring Samba share for primary drive..."
# Backup existing config
cp /etc/samba/smb.conf /etc/samba/smb.conf.backup-$(date +%Y%m%d-%H%M%S)
# Add Primary share configuration
if ! grep -q "\[Primary\]" /etc/samba/smb.conf; then
cat >> /etc/samba/smb.conf << SAMBA_CONFIG
# Primary drive share - added by post-install script
[Primary]
comment = Primary Drive
path = $ACTUAL_HOME/drives/primary
browseable = yes
read only = no
writable = yes
valid users = $ACTUAL_USER
create mask = 0775
directory mask = 0775
SAMBA_CONFIG
echo "✓ Added [Primary] share to Samba configuration"
else
echo "Samba [Primary] share already configured, skipping..."
fi
# Add Samba user
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "SAMBA PASSWORD SETUP"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Set a password for Samba file sharing access."
echo "Tip: Using the same password as your system login is convenient."
echo ""
smbpasswd -a "$ACTUAL_USER"
# Enable and restart Samba services
systemctl enable smbd nmbd || echo "Warning: Failed to enable Samba services"
systemctl restart smbd nmbd || echo "Warning: Failed to restart Samba services"
echo ""
echo "✓ Samba configured successfully"
echo " Share name: Primary"
echo " Path: $ACTUAL_HOME/drives/primary"
echo " Access: \\\\$(hostname)\\Primary (Windows) or smb://$(hostname)/Primary (Mac/Linux)"
else
echo "✗ Samba installation failed, skipping configuration"
fi
else
echo "Skipping Samba installation."
fi
# Install NetBird # Install NetBird
echo "" echo ""
echo "Installing NetBird..." echo "Installing NetBird..."
@@ -281,35 +355,50 @@ if [ -f /tmp/rustdesk.deb ]; then
rm /tmp/rustdesk.deb rm /tmp/rustdesk.deb
fi fi
# Create rclone backup script and instructions # Rclone Split Backup System (Optional)
echo ""
echo "Setting up rclone backup configuration..."
echo ""
# Create backup script directory
mkdir -p /usr/local/bin/backup-scripts
# Create mount point directories
echo ""
echo "Creating mount point directories in $ACTUAL_HOME/drives/..."
mkdir -p "$ACTUAL_HOME/drives/primary"
mkdir -p "$ACTUAL_HOME/drives/backup1"
mkdir -p "$ACTUAL_HOME/drives/backup2"
chown -R "$ACTUAL_USER:$ACTUAL_USER" "$ACTUAL_HOME/drives"
echo "" echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "DRIVE SETUP - Mount your drives" echo "RCLONE SPLIT BACKUP SYSTEM (Optional)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "" echo ""
echo "Available block devices:" echo "This sets up a split backup system using rclone:"
echo " - Creates mount points for primary + 2 backup drives"
echo " - Installs backup script that splits data across backup drives"
echo " - Optionally configures automatic daily backups"
echo "" echo ""
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,LABEL echo "Useful when: Primary drive (e.g., 4TB) > individual backup drives (e.g., 2TB each)"
echo "" echo ""
read -p "Set up rclone split backup system? (y/n): " SETUP_BACKUP
read -p "Do you want to mount drives now? (y/n): " MOUNT_NOW if [ "$SETUP_BACKUP" = "y" ] || [ "$SETUP_BACKUP" = "Y" ]; then
echo ""
echo "Setting up rclone backup configuration..."
echo ""
if [ "$MOUNT_NOW" = "y" ] || [ "$MOUNT_NOW" = "Y" ]; then # Create backup script directory
mkdir -p /usr/local/bin/backup-scripts
# Create mount point directories
echo ""
echo "Creating mount point directories in $ACTUAL_HOME/drives/..."
mkdir -p "$ACTUAL_HOME/drives/primary"
mkdir -p "$ACTUAL_HOME/drives/backup1"
mkdir -p "$ACTUAL_HOME/drives/backup2"
chown -R "$ACTUAL_USER:$ACTUAL_USER" "$ACTUAL_HOME/drives"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "DRIVE SETUP - Mount your drives"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Available block devices:"
echo ""
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,LABEL
echo ""
read -p "Do you want to mount drives now? (y/n): " MOUNT_NOW
if [ "$MOUNT_NOW" = "y" ] || [ "$MOUNT_NOW" = "Y" ]; then
echo "" echo ""
echo "Enter device paths (e.g., /dev/sdb1) or leave blank to skip" echo "Enter device paths (e.g., /dev/sdb1) or leave blank to skip"
echo "" echo ""
@@ -374,17 +463,17 @@ if [ "$MOUNT_NOW" = "y" ] || [ "$MOUNT_NOW" = "Y" ]; then
echo "✓ Backup of original fstab saved with timestamp" echo "✓ Backup of original fstab saved with timestamp"
fi fi
else else
echo "" echo ""
echo "Skipping drive mounting. You can mount manually later." echo "Skipping drive mounting. You can mount manually later."
echo "Mount points created at:" echo "Mount points created at:"
echo " $ACTUAL_HOME/drives/primary" echo " $ACTUAL_HOME/drives/primary"
echo " $ACTUAL_HOME/drives/backup1" echo " $ACTUAL_HOME/drives/backup1"
echo " $ACTUAL_HOME/drives/backup2" echo " $ACTUAL_HOME/drives/backup2"
fi fi
# Create example backup script with correct paths # Create example backup script with correct paths
cat > /usr/local/bin/backup-scripts/rclone-backup.sh << BACKUP_SCRIPT cat > /usr/local/bin/backup-scripts/rclone-backup.sh << BACKUP_SCRIPT
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
@@ -536,10 +625,10 @@ backup_to_drive "\$BACKUP2" "Backup Drive 2" "\${BACKUP2_DIRS[@]}"
echo "=== Backup Completed: \$(date) ===" | tee -a "\$LOG" echo "=== Backup Completed: \$(date) ===" | tee -a "\$LOG"
BACKUP_SCRIPT BACKUP_SCRIPT
chmod +x /usr/local/bin/backup-scripts/rclone-backup.sh chmod +x /usr/local/bin/backup-scripts/rclone-backup.sh
# Create systemd service for automatic backups (optional) # Create systemd service for automatic backups (optional)
cat > /etc/systemd/system/rclone-backup.service << 'SERVICE' cat > /etc/systemd/system/rclone-backup.service << 'SERVICE'
[Unit] [Unit]
Description=Rclone Backup Service Description=Rclone Backup Service
After=network.target After=network.target
@@ -550,8 +639,8 @@ ExecStart=/usr/local/bin/backup-scripts/rclone-backup.sh
User=root User=root
SERVICE SERVICE
# Create systemd timer for daily backups at 2 AM (optional) # Create systemd timer for daily backups at 2 AM (optional)
cat > /etc/systemd/system/rclone-backup.timer << 'TIMER' cat > /etc/systemd/system/rclone-backup.timer << 'TIMER'
[Unit] [Unit]
Description=Daily Rclone Backup Timer Description=Daily Rclone Backup Timer
Requires=rclone-backup.service Requires=rclone-backup.service
@@ -565,9 +654,11 @@ Persistent=true
WantedBy=timers.target WantedBy=timers.target
TIMER TIMER
echo "✓ Rclone backup script created at /usr/local/bin/backup-scripts/rclone-backup.sh" echo "✓ Rclone backup script created at /usr/local/bin/backup-scripts/rclone-backup.sh"
echo "✓ Systemd service/timer created (disabled by default)" echo "✓ Systemd service/timer created (disabled by default)"
else
echo "Skipping rclone backup system setup."
fi
# Full system upgrade # Full system upgrade
echo "" echo ""
@@ -584,13 +675,17 @@ echo ""
echo "=== Installation Complete! ===" echo "=== Installation Complete! ==="
echo "" echo ""
echo "Installed Software:" echo "Installed Software:"
echo " ✓ net-tools, ncdu, git, curl, wget, vim, htop, tree, zip/unzip" echo " ✓ net-tools, ncdu, git, curl, wget, vim, htop, tree, zip/unzip, rclone"
echo " ✓ rclone - Backup/sync tool"
echo " ✓ OpenSSH Server - SSH remote access" echo " ✓ OpenSSH Server - SSH remote access"
echo " ✓ Samba - File sharing (Primary drive shared)"
echo " ✓ Docker Engine + Docker Compose" echo " ✓ Docker Engine + Docker Compose"
if [ "$INSTALL_SAMBA" = "y" ] || [ "$INSTALL_SAMBA" = "Y" ]; then
echo " ✓ Samba - File sharing (Primary drive shared)"
fi
echo " ✓ NetBird - Mesh VPN" echo " ✓ NetBird - Mesh VPN"
echo " ✓ RustDesk - Remote desktop" echo " ✓ RustDesk - Remote desktop"
if [ "$SETUP_BACKUP" = "y" ] || [ "$SETUP_BACKUP" = "Y" ]; then
echo " ✓ Rclone split backup system configured"
fi
echo "" echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "SSH AUTHENTICATION SETUP" echo "SSH AUTHENTICATION SETUP"
@@ -642,6 +737,7 @@ echo " ✓ Just GitHub or just Launchpad"
echo " ✓ Just NetBird SSH" echo " ✓ Just NetBird SSH"
echo " ✓ None (password auth only - if no keys imported)" echo " ✓ None (password auth only - if no keys imported)"
echo "" echo ""
if [ "$SETUP_BACKUP" = "y" ] || [ "$SETUP_BACKUP" = "Y" ]; then
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "RCLONE BACKUP SETUP - Exact Drive Mirroring" echo "RCLONE BACKUP SETUP - Exact Drive Mirroring"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -852,21 +948,25 @@ echo " rclone check $ACTUAL_HOME/drives/primary/documents \\"
echo " $ACTUAL_HOME/drives/backup1/documents \\" echo " $ACTUAL_HOME/drives/backup1/documents \\"
echo " --checksum --one-way" echo " --checksum --one-way"
echo "" echo ""
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "OTHER IMPORTANT NOTES" echo "OTHER IMPORTANT NOTES"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "" echo ""
echo " Samba File Sharing:" if [ "$INSTALL_SAMBA" = "y" ] || [ "$INSTALL_SAMBA" = "Y" ]; then
if command -v smbd &> /dev/null && grep -q "\[Primary\]" /etc/samba/smb.conf 2>/dev/null; then echo " Samba File Sharing:"
echo " ✓ Share 'Primary' is accessible at:" if command -v smbd &> /dev/null && grep -q "\[Primary\]" /etc/samba/smb.conf 2>/dev/null; then
echo " Windows: \\\\$(hostname)\\Primary" echo " ✓ Share 'Primary' is accessible at:"
echo " Mac/Linux: smb://$(hostname)/Primary" echo " Windows: \\\\$(hostname)\\Primary"
echo " • Username: $ACTUAL_USER" echo " Mac/Linux: smb://$(hostname)/Primary"
echo " • Use the Samba password you just set" echo " • Username: $ACTUAL_USER"
echo "" echo " • Use the Samba password you just set"
else echo ""
echo " Not configured (Samba installation may have failed)" else
echo "" echo " ✗ Installation may have failed - check 'systemctl status smbd'"
echo ""
fi
fi fi
echo " Docker: Log out and back in for group membership to take effect" echo " Docker: Log out and back in for group membership to take effect"
echo "" echo ""