\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/yedekledb24/DatabaseBackupMasterv5/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/yedekledb24/DatabaseBackupMasterv5/basit_kurulum.py |
import os
import psycopg2
from werkzeug.security import generate_password_hash
# Veritabanı bağlantı bilgileri - kendi bilgilerinizi doldurun
# Aşağıdaki bilgileri kendi veritabanı bilgilerinize göre güncelleyin
DB_HOST = "localhost"
DB_PORT = "5432"
DB_NAME = "yedekle24_db"
DB_USER = "yedekle_user"
DB_PASS = "OoGh7iechee" # Kendi şifrenizi girin
# SMTP ayarları - kendi bilgilerinizi doldurun
MAIL_SERVER = "mail.hepsibulutta.com"
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = "yedekle24@hepsibulutta.com"
MAIL_PASSWORD = "mail_sifrenizi_buraya_yazin" # Kendi şifrenizi girin
MAIL_SENDER = "yedekle24@hepsibulutta.com"
NOTIFICATION_EMAILS = "gokhana@ofisbulutta.com" # Bildirim alacak e-posta adresleri
# Admin kullanıcı bilgileri
ADMIN_USERNAME = "admin"
ADMIN_EMAIL = "admin@example.com" # Kendi e-posta adresinizi girin
ADMIN_PASSWORD = "password123" # Güvenli bir şifre belirleyin
# Veritabanına bağlan
try:
# Bağlantı oluştur
conn_string = f"host={DB_HOST} port={DB_PORT} dbname={DB_NAME} user={DB_USER} password={DB_PASS}"
conn = psycopg2.connect(conn_string)
conn.autocommit = True
cursor = conn.cursor()
print("Veritabanına başarıyla bağlandı.")
# Ayrıntılı tabloları ekle
with open('database_backups/clean_schema.sql', 'r') as schema_file:
schema_sql = schema_file.read()
cursor.execute(schema_sql)
print("Veritabanı şeması başarıyla oluşturuldu.")
# Admin kullanıcısı ekle
password_hash = generate_password_hash(ADMIN_PASSWORD)
cursor.execute("""
INSERT INTO users (username, email, password_hash, is_admin, created_at)
VALUES (%s, %s, %s, %s, NOW())
ON CONFLICT (username) DO NOTHING
""", (ADMIN_USERNAME, ADMIN_EMAIL, password_hash, True))
print(f"Admin kullanıcısı oluşturuldu: {ADMIN_USERNAME}")
# SMTP ayarları ekle
cursor.execute("""
INSERT INTO smtp_settings (
mail_server, mail_port, mail_use_tls, mail_use_ssl,
mail_username, mail_password, mail_default_sender,
notification_emails, created_at, updated_at
)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, NOW(), NOW())
ON CONFLICT DO NOTHING
""", (
MAIL_SERVER, MAIL_PORT, MAIL_USE_TLS, MAIL_USE_SSL,
MAIL_USERNAME, MAIL_PASSWORD, MAIL_SENDER,
NOTIFICATION_EMAILS
))
print("SMTP ayarları eklendi.")
# Bağlantıyı kapat
cursor.close()
conn.close()
print("\nKurulum başarıyla tamamlandı!")
print(f"Kullanıcı adı: {ADMIN_USERNAME}")
print(f"Şifre: {ADMIN_PASSWORD}")
print("\nÖnemli: Uygulamayı kullanmaya başladığınızda güvenlik nedeniyle şifrenizi değiştirin.")
except Exception as e:
print(f"Hata: {e}")