ircu2/push_v1.5.0.py

112 lines
3.7 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import subprocess
import os
os.chdir(r'D:\pip\underchat-ircd')
print("=== PUSH v1.5.0 cu PSEUDO + SPOOFHOST ===\n")
# 1. Verificare fișier local
print("1. Verificare install.sh local:")
with open('install.sh', 'r', encoding='utf-8') as f:
content = f.read()
pseudo_count = content.count('EOFCONFIG_PSEUDO')
spoofhost_count = content.count('EOFCONFIG_SPOOFHOST')
config_pseudo_count = content.count('Configurare PSEUDO')
config_spoofhost_count = content.count('Configurare SPOOFHOST')
lines = len(content.splitlines())
print(f" - Linii totale: {lines}")
print(f" - EOFCONFIG_PSEUDO: {pseudo_count}")
print(f" - EOFCONFIG_SPOOFHOST: {spoofhost_count}")
print(f" - Configurare PSEUDO: {config_pseudo_count}")
print(f" - Configurare SPOOFHOST: {config_spoofhost_count}")
print()
if pseudo_count >= 3 and spoofhost_count >= 3:
print(" ✅ Modificările PSEUDO + SPOOFHOST sunt în fișierul local!\n")
else:
print(" ❌ Modificările NU sunt în fișierul local!\n")
exit(1)
# 2. Git add
print("2. Git add:")
result = subprocess.run(['git', 'add', '-A'], capture_output=True, text=True)
print(f" Done\n")
# 3. Git commit
print("3. Git commit:")
commit_msg = """FEATURE v1.5.0: PSEUDO + SPOOFHOST - Configurare completă
Adăugat:
- Configurare interactivă PSEUDO (alias-uri servicii IRC)
- Configurare interactivă SPOOFHOST (mascarea hostname-urilor)
- Documentație SPOOFHOST_EXPLAINED.md (650+ linii)
- ~200 linii noi în install.sh
Features:
✅ PSEUDO: /NICKSERV, /CHANSERV, /NS, /CS, etc.
✅ SPOOFHOST: staff.underchat.org, vip.underchat.org, users.underchat.org
✅ 4 opțiuni configurare (Staff auto, VIP manual, Protecție, Toate)
✅ Documentație completă cu exemple
Versiune: v1.5.0"""
result = subprocess.run(['git', 'commit', '-m', commit_msg], capture_output=True, text=True)
if result.returncode == 0:
print(f" ✅ Commit reușit")
elif 'nothing to commit' in result.stdout:
print(f" Nothing to commit (deja committed)")
else:
print(f" stdout: {result.stdout}")
print(f" stderr: {result.stderr}")
print()
# 4. Git push
print("4. Git push origin main:")
result = subprocess.run(['git', 'push', 'origin', 'main'], capture_output=True, text=True)
print(f" stdout: {result.stdout}")
print(f" stderr: {result.stderr}")
if result.returncode == 0 or 'Everything up-to-date' in result.stderr:
print(f" ✅ Push reușit\n")
else:
print(f" ⚠️ Cod return: {result.returncode}\n")
# 5. Tag v1.5.0
print("5. Tag v1.5.0:")
subprocess.run(['git', 'tag', '-d', 'v1.5.0'], capture_output=True)
tag_msg = """Release v1.5.0 - PSEUDO + SPOOFHOST
Features:
- PSEUDO: Alias-uri pentru servicii IRC
- SPOOFHOST: Mascarea hostname-urilor
- Documentație completă
- Usability + Securitate"""
result = subprocess.run(['git', 'tag', '-a', 'v1.5.0', '-m', tag_msg], capture_output=True, text=True)
print(f" Tag creat\n")
# 6. Push tag
print("6. Push tag v1.5.0:")
result = subprocess.run(['git', 'push', 'origin', 'v1.5.0', '--force'], capture_output=True, text=True)
print(f" stdout: {result.stdout}")
print(f" stderr: {result.stderr}")
if result.returncode == 0:
print(f" ✅ Tag push-uit\n")
else:
print(f" ⚠️ Cod return: {result.returncode}\n")
# 7. Verificare finală
print("7. Verificare log:")
result = subprocess.run(['git', 'log', '--oneline', '-3'], capture_output=True, text=True)
print(result.stdout)
print("\n=== FINALIZAT ===")
print("\nPe server rulează:")
print(" cd ~/ircu2")
print(" git fetch --all")
print(" git pull origin main")
print(" git checkout v1.5.0")
print(" grep -c 'EOFCONFIG_PSEUDO' install.sh # Ar trebui 3+")
print(" grep -c 'EOFCONFIG_SPOOFHOST' install.sh # Ar trebui 3+")