خطا: listen tcp :3000: bind: address already in use
راهحل:
# یافتن فرآیند استفادهکننده از پورت 3000
lsof -i :3000 # Linux/macOS
netstat -ano | findstr :3000 # Windows
# کشتن فرآیند
kill -9 <PID> # Linux/macOS
taskkill /PID <PID> /F # Windows
# یا استفاده از پورت متفاوت
./gityar web -p 3001
خطا: Failed to connect to database
راهحلها:
SQLite:
# بررسی مجوزهای نوشتن
chmod 755 data/
MySQL:
[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306
NAME = gityar
USER = gityar
PASSWD = correct_password
PostgreSQL:
[database]
DB_TYPE = postgres
HOST = 127.0.0.1:5432
NAME = gityar
USER = gityar
PASSWD = correct_password
SSL_MODE = disable
علل احتمالی:
بازنشانی رمز عبور:
راهحلها:
در app.ini:
[auth]
ENABLE_LDAP = true
[ldap]
HOST = ldap.example.com:389
BASE_DN = dc=example,dc=com
خطا: Permission denied
راهحلها:
بررسی دسترسی مخزن:
بررسی احراز هویت:
# تست SSH
ssh -T git@localhost
# تست HTTP
curl -u username:password http://localhost:3000/user/repo.git/info/refs
بررسی محافظت branch:
HTTP:
# بررسی URL
git clone http://localhost:3000/user/repo.git
# با اعتبارنامه
git clone http://username:password@localhost:3000/user/repo.git
SSH:
# بررسی کلید SSH
ssh -T git@localhost
# با جزئیات
GIT_SSH_COMMAND="ssh -v" git clone git@localhost:user/repo.git
علل:
راهحل:
cd your-repo
git status
git log --all
git branch -a
# اگر خالی است، commit اولیه ایجاد کنید
echo "# پروژه من" > README.md
git add .
git commit -m "commit اولیه"
git push origin main
راهحلها:
فعالسازی caching:
[cache]
ADAPTER = memory
INTERVAL = 60
استفاده از reverse proxy:
بهینهسازی دیتابیس:
# MySQL
mysqlcheck -o gityar -u root -p
# PostgreSQL
vacuumdb -d gityar
افزایش منابع:
راهحلها:
فعالسازی Git garbage collection:
[repository]
ENABLE_AUTO_GIT_GC = true
GC_AUTO_THRESHOLD = 100
استفاده از clone کمعمق:
git clone --depth 50 http://localhost:3000/user/repo.git
فعالسازی LFS برای فایلهای بزرگ
بررسی پیکربندی:
[mailer]
ENABLED = true
HOST = smtp.example.com:587
FROM = gityar@example.com
USER = gityar@example.com
PASSWD = password
IS_TLS_ENABLED = true
تست اتصال:
telnet smtp.example.com 587
بررسی log ها:
tail -f log/gityar.log | grep mailer
چکلیست:
تست وبهوک:
بررسی log ها:
tail -f log/gityar.log | grep webhook
log/gityar.log
log/http.log
در app.ini:
[log]
MODE = file
LEVEL = Info # Trace, Debug, Info, Warn, Error, Critical
[log]
LEVEL = Debug
گیتییار را restart کنید و log ها را برای اطلاعات دقیق بررسی کنید.
Backup:
# SQLite
cp data/gityar.db gityar-backup.db
# MySQL
mysqldump -u root -p gityar > backup.sql
# PostgreSQL
pg_dump gityar > backup.sql
Restore:
# SQLite
cp gityar-backup.db data/gityar.db
# MySQL
mysql -u root -p gityar < backup.sql
# PostgreSQL
psql gityar < backup.sql
SQLite به MySQL:
app.iniراهحل:
# بررسی پوشه templates
ls templates/
# ساخت مجدد از سورس
go build -o gityar ./cmd/gityar
راهحل:
# بررسی پوشه public
ls public/
# ساخت مجدد یا restart
./gityar web
راهحل:
/docs/docs/faqشامل: