first commit

This commit is contained in:
Mateusz Gruszczyński
2026-04-14 11:39:03 +02:00
parent 5a62e825a7
commit 1e752f110f
37 changed files with 6687 additions and 5453 deletions

View File

@@ -5,7 +5,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
app_name: str = 'RouterOS Backup Manager Next'
app_name: str = 'Mikrotik Backup System'
app_env: str = 'development'
secret_key: str = 'change-me'
jwt_algorithm: str = 'HS256'

View File

@@ -306,8 +306,12 @@ class BackupService:
routers = db.query(Router).filter(Router.owner_id == user.id).all()
result = []
for router in routers:
if router.device_type != 'routeros':
result.append({'router': router.name, 'status': 'skipped', 'message': 'SwitchOS devices do not support text export'})
if (router.device_type or 'routeros').lower() != 'routeros':
result.append({
'router': router.name,
'status': 'skipped',
'message': 'Text export is available only for RouterOS devices',
})
continue
try:
backup = self.export_router(db, user, router.id)

View File

@@ -53,7 +53,7 @@ class NotificationService:
return
if settings.smtp_notifications_enabled:
try:
self.send_email(settings, "RouterOS Backup notification", message)
self.send_email(settings, "Mikrotik Backup System notification", message)
except Exception:
pass
if settings.pushover_token and settings.pushover_userkey:
@@ -63,7 +63,7 @@ class NotificationService:
pass
def send_test_email(self, settings: GlobalSettings):
self.send_email(settings, "RouterOS Backup test", "This is a test email from RouterOS Backup Manager Next")
self.send_email(settings, "Mikrotik Backup System test", "This is a test email from Mikrotik Backup System")
def send_test_pushover(self, settings: GlobalSettings):
if not (settings.pushover_token and settings.pushover_userkey):
@@ -71,7 +71,7 @@ class NotificationService:
self.send_pushover(
settings.pushover_token,
settings.pushover_userkey,
"Test pushover from RouterOS Backup Manager Next",
"Test pushover from Mikrotik Backup System",
)