-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare_for_github.sh
More file actions
executable file
·100 lines (87 loc) · 2.94 KB
/
Copy pathprepare_for_github.sh
File metadata and controls
executable file
·100 lines (87 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
# GitHub Preparation Script
# Safely prepare the project for GitHub by removing sensitive data
echo "🚀 Preparing Data Visualization Website for GitHub..."
echo "===================================================="
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${YELLOW}🔍 Checking for sensitive files...${NC}"
# Check if sensitive files exist
SENSITIVE_FILES=(
"db.sqlite3"
"analytics/real_activity.db"
"analytics/linux_activity.db"
"analytics/linux_monitor.log"
)
FOUND_SENSITIVE=false
for file in "${SENSITIVE_FILES[@]}"; do
if [ -f "$file" ]; then
echo -e "${RED}⚠️ Found sensitive file: $file${NC}"
FOUND_SENSITIVE=true
fi
done
if [ "$FOUND_SENSITIVE" = true ]; then
echo
echo -e "${YELLOW}📋 These files contain your personal data and will be excluded by .gitignore${NC}"
echo -e "${GREEN}✅ .gitignore is configured to protect these files${NC}"
else
echo -e "${GREEN}✅ No sensitive files found${NC}"
fi
echo
echo -e "${YELLOW}🔧 Checking project structure...${NC}"
# Check essential files exist
ESSENTIAL_FILES=(
"manage.py"
".gitignore"
"linux_setup.sh"
"analytics/models.py"
"analytics/views.py"
"analytics/linux_system_monitor.py"
)
for file in "${ESSENTIAL_FILES[@]}"; do
if [ -f "$file" ]; then
echo -e "${GREEN}✅ $file${NC}"
else
echo -e "${RED}❌ Missing: $file${NC}"
fi
done
echo
echo -e "${YELLOW}📊 Project statistics:${NC}"
echo "Python files: $(find . -name "*.py" | wc -l)"
echo "HTML templates: $(find . -name "*.html" | wc -l)"
echo "JavaScript files: $(find . -name "*.js" | wc -l)"
echo "Documentation: $(find . -name "*.md" | wc -l)"
echo
echo -e "${GREEN}🎯 Ready for GitHub! Here's what will happen:${NC}"
echo
echo -e "${GREEN}✅ INCLUDED in repository:${NC}"
echo " • Source code (Python, HTML, CSS, JS)"
echo " • Documentation (README files)"
echo " • Setup scripts (linux_setup.sh)"
echo " • Configuration files"
echo " • Django project structure"
echo
echo -e "${RED}❌ EXCLUDED from repository:${NC}"
echo " • Database files (*.db, *.sqlite3)"
echo " • Log files (*.log)"
echo " • Virtual environments (venv/, env/)"
echo " • Personal data and cache files"
echo " • System-specific files (.DS_Store, etc.)"
echo
echo -e "${YELLOW}📝 Next steps:${NC}"
echo "1. git init"
echo "2. git add ."
echo "3. git commit -m 'Initial commit: Linux system monitoring'"
echo "4. git remote add origin https://github.com/yourusername/repo-name.git"
echo "5. git push -u origin main"
echo
echo -e "${GREEN}🔒 Privacy Protection:${NC}"
echo "✅ All personal data will stay on your local machine"
echo "✅ Database files are protected by .gitignore"
echo "✅ Log files with sensitive info are excluded"
echo "✅ Virtual environments are not uploaded"
echo
echo -e "${GREEN}🚀 Your project is ready for safe GitHub deployment!${NC}"