Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ changes.json
logs/
portable.flag

# لوحة الأم (Mother Panel): إعدادات الاتصال والجلسة — محلية ولا تُرفع أبدًا
panel.json
panel_session.json
mother_panel/dist/

# معاينات الواجهة (أداة المطور)
.preview/

Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@
الصيغة مبنية على [Keep a Changelog](https://keepachangelog.com/)، والإصدارات تتبع
[Semantic Versioning](https://semver.org/).

## [Unreleased] — الاندماج مع «لوحة الأم» (Mother Panel، app_id 13)

### أُضيف
- **حزمة `src/panel/`**: عميل بوابة `/api/v1` (JSON فقط، `X-App-Token` + `X-App-Id: 13` +
`X-Req-Id` لكل طلب + `Authorization: Bearer`) يغطي status · auth/register · auth/login ·
auth/session · auth/logout · sync · releases/check · licenses/verify · licenses/activate ·
telemetry · control — بلا أي وصول مباشر لقاعدة البيانات.
- **تسجيل دخول إلزامي عبر لوحة الأم** (`PanelLoginWindow`) بدل الحسابات المحلية: نفس الحساب يعمل
على أي جهاز، `is_admin` يأتي من `app_users.is_admin` فقط، الجلسة المحفوظة تُتحقق تلقائيًا،
وإنشاء حساب من الشاشة نفسها. عند أول تشغيل تُحفظ إعدادات الاتصال (الرابط + التوكن) في
`panel.json` محليًا ولا تدخل المستودع.
- **مزامنة الإعدادات بين الأجهزة** (sync push/pull مع `sync_version` وكشف التعارض؛ server-wins)
لتفضيلات المستخدم فقط — الحسابات والاختصارات لا تُزامَن.
- **فحص التحديثات** عبر `releases/check` (full/sub/min_version) مع تنبيه وتحديث إجباري.
- **تراخيص** (verify/activate) — تُفعَّل فقط إذا سمح بها خادم اللوحة (`licenses_enabled`).
- **تتبّع خفيف** (telemetry) بلا بيانات شخصية، يمكن إيقافه محليًا، ويتوقف إذا عطّله الخادم.
- **تبويب «لوحة التحكم»** للأدمن (نظرة عامة/مستخدمون/أجهزة/إصدارات/إعدادات/متطلبات من `control`)
وتبويب **«تطبيقات أخرى»** ببطاقات التطبيقات الشقيقة من `status`.
- **حزمة تثبيت للوحة الأم** `mother_panel/` (app.json، map.json بخطوة Verify، لوحة ويب ثابتة
JSON-only، requirements.json، MOTHER_PANEL_HANDOFF.md، build_zip.py).

### تغيّر
- تبويب «المستخدمون» المحلي أُزيل من الواجهة (إدارة الحسابات تتم في لوحة الأم)؛
`src/utils/auth.py` و`src/gui/login_window.py` بقيا ككود قديم غير مستخدم في مسار التشغيل.
- لم يعد يُنشأ حساب أدمن افتراضي محلي (`ensure_default_admin`) — الصلاحيات من اللوحة الأم.

### الأمان
- لا توكنات في الكود أو المستودع أو السجلات؛ `PanelConfig.__repr__` يعرض التوكن مقنّعًا.
- كل استدعاء API يحمل `X-Req-Id` فريدًا ليُسجَّل في `audit_log`/`sync_log` في اللوحة الأم.

## [2.1.0] — 2026-11-25

إصدار 2.1: دليل تطبيقات وخدمات بمستويات خطورة، تقارير PDF، حماية أوسع من الشاشة الزرقاء،
Expand Down
51 changes: 42 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
### أهم المزايا

**التثبيت والدخول**
- حساب مدير افتراضي يُنشأ تلقائيًا عند أول تشغيل: `yswef` / `yswef1234`، مع زر "إنشاء حساب
جديد" في شاشة الدخول.
- **تسجيل دخول إلزامي عبر «لوحة الأم»** (حساب واحد لكل تطبيق، `is_admin` من الخادم، نفس الحساب
يعمل على كل أجهزتك) مع زر "إنشاء حساب جديد" في شاشة الدخول — انظر قسم «الاتصال بلوحة الأم».
- مثبّت رسمي `Faster-PC-Setup.exe` (Inno Setup) يُبنى تلقائيًا مع كل إصدار، أو ملف تنفيذي
واحد `FasterPC.exe` يعمل مباشرة.
- التثبيت من داخل البرنامج (الإعدادات): اختصار سطح المكتب وقائمة ابدأ، تسجيل التشغيل مع
Expand Down Expand Up @@ -106,6 +106,8 @@
- تشغيل نسخة واحدة فقط، وينشط النافذة الموجودة عند إعادة الفتح.
- بقاء البرنامج في شريط المهام عند إغلاق النافذة (اختياري) مع أيقونة وقائمة سريعة.
- مركز تنبيهات داخل البرنامج + تنبيهات شريط المهام.
- تبويب «تطبيقات أخرى» ببطاقات التطبيقات الشقيقة من لوحة الأم، وتبويب «لوحة التحكم» للأدمن
(إحصاءات، مستخدمون، أجهزة، إصدارات، إعدادات، متطلبات).

### التشغيل

Expand All @@ -114,8 +116,8 @@ pip install -r requirements.txt
python main.py
```

- أول تشغيل: سجّل الدخول بحساب المدير الافتراضي `yswef` / `yswef1234` (أو أنشئ حسابًا من زر
"إنشاء حساب جديد" في شاشة الدخول).
- أول تشغيل: أدخل رابط لوحة الأم وتوكن التطبيق (X-App-Token) مرة واحدة في شاشة الدخول، ثم سجّل
الدخول بحسابك (أو أنشئ حسابًا من زر "إنشاء حساب جديد").
- يفضَّل تشغيل البرنامج كمسؤول (Administrator) لتفعيل كل الميزات (الخدمات، SFC/DISM،
نقطة الاستعادة، بعض تحسينات الريجستري). البرنامج يوضح دائمًا متى تكون الصلاحيات ناقصة.

Expand Down Expand Up @@ -168,7 +170,7 @@ pyinstaller --noconfirm --clean faster_pc.spec

```bash
pip install -r requirements-dev.txt
pytest # 55+ اختبارًا للوحدات الأساسية (إعدادات، حماية، تنظيف، سجل، مراقبة)
pytest # 89 اختبارًا للوحدات (إعدادات، حماية، تنظيف، سجل، مراقبة، ولوحة الأم)
ruff check . # فحص التنسيق والأخطاء الشائعة
```

Expand Down Expand Up @@ -223,6 +225,26 @@ docs/docs.html التوثيق الكامل (مستخدم + مطوّ
هذا خط ثابت في المشروع.
- كل عملية تلمس النظام تحترم الوضع التجريبي، ومعظمها قابل للتراجع.

### الاتصال بلوحة الأم (Mother Panel — app_id 13)

التطبيق يعمل **دائمًا أونلاين** عبر بوابة الـ API في لوحة الأم (`/api/v1`، JSON فقط):
تسجيل الدخول، الجلسات، المزامنة بين الأجهزة، فحص التحديثات، التراخيص، المقاييس، ولوحة الإدارة.

| الغرض | نقطة الـ API |
|---|---|
| حالة التطبيق + الإعدادات + التطبيقات الشقيقة | `status` |
| إنشاء حساب / دخول / جلسة / خروج | `auth/register` · `auth/login` · `auth/session` · `auth/logout` |
| مزامنة الإعدادات (دفع/سحب + كشف تعارض) | `sync` |
| تحديث كامل/فرعي + `min_version` | `releases/check` |
| الترخيص | `licenses/verify` · `licenses/activate` |
| مقاييس خفيفة بلا بيانات شخصية | `telemetry` |
| لوحة الإدارة (للأدمن فقط) | `control` |

- إعدادات الاتصال تُحفظ محليًا في `%LOCALAPPDATA%\FasterPC\panel.json` (أو من متغيري البيئة
`FASTERPC_PANEL_URL` / `FASTERPC_PANEL_TOKEN`) ولا تدخل المستودع أبدًا.
- عقد الـ API الكامل والجداول المستخدمة ومتطلبات التثبيت في
[`mother_panel/MOTHER_PANEL_HANDOFF.md`](mother_panel/MOTHER_PANEL_HANDOFF.md).

### الترخيص

هذا المشروع مملوك ومحمي بحقوق النشر — راجع ملف [LICENSE](LICENSE).
Expand All @@ -244,8 +266,8 @@ journal and protection layers that prevent closing important apps or destabilizi
### Highlights

**Setup & sign-in**
- A default admin account is created automatically on first launch: `yswef` / `yswef1234`; more
accounts can be created from the sign-in screen.
- **Mandatory sign-in through the Mother Panel** (one account per app, `is_admin` comes from the
server, the same account works on every device) with a "create account" button on the sign-in screen.
- An official `Faster-PC-Setup.exe` installer (Inno Setup) is built with every release, or run the
single-file `FasterPC.exe` directly.
- In-app install (Settings): desktop & Start Menu shortcuts, run with Windows, and optional
Expand Down Expand Up @@ -319,6 +341,8 @@ journal and protection layers that prevent closing important apps or destabilizi
- Single-instance: re-launching activates the existing window.
- Optional minimize-to-tray on close, with tray icon and quick actions.
- In-app notification center + Windows tray toasts.
- "Other apps" tab with sibling-app cards from the Mother Panel, and an admin-only "Control panel"
tab (overview, users, devices, releases, settings, requirements).

### Getting started

Expand All @@ -328,8 +352,8 @@ python main.py
```

Run as Administrator for full functionality (services, SFC/DISM, restore points, some
registry tweaks). The app always tells you when elevation is missing. Sign in with the default
admin `yswef` / `yswef1234`, or create a new account from the sign-in screen.
registry tweaks). The app always tells you when elevation is missing. On first launch enter the
Mother Panel URL and the app token (X-App-Token) once, then sign in (or create an account).

### Building

Expand All @@ -352,6 +376,15 @@ official icon. To also build the `dist\Faster-PC-Setup.exe` installer run
- This project contains no code that extracts, decrypts, or exports credentials stored by
browsers or other applications. That is a permanent project boundary.

### Mother Panel (app_id 13)

The app is always online through the Mother Panel API gateway (`/api/v1`, JSON only): sign-in,
sessions, cross-device settings sync, update checks, licenses, lightweight telemetry, and the admin
panel. Connection settings live locally in `%LOCALAPPDATA%\FasterPC\panel.json` (or the
`FASTERPC_PANEL_URL` / `FASTERPC_PANEL_TOKEN` environment variables) and never in the repository.
The full API contract, tables and install requirements are in
[`mother_panel/MOTHER_PANEL_HANDOFF.md`](mother_panel/MOTHER_PANEL_HANDOFF.md).

### License

Proprietary — see [LICENSE](LICENSE). © 2026 Yousef Alhamzy. All rights reserved.
82 changes: 82 additions & 0 deletions mother_panel/MOTHER_PANEL_HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!-- ============================================================
© Yousef Alhamzy (يوسف الحمزي) — Faster-PC — Mother Panel integration
file: mother_panel/MOTHER_PANEL_HANDOFF.md | app_id (boards.id): 13
============================================================ -->

# دليل تسليم اندماج Faster-PC مع «لوحة الأم» (Mother Panel)

- **معرّف التطبيق (`app_id` / `boards.id`)**: `13`
- **المفتاح (`app_key`)**: `faster_pc`
- **النوع**: تطبيق سطح مكتب (`desktop` / `windows`)
- **المطوّر**: يوسف الحمزي (Yousef Alhamzy) — `https://github.com/yswef`

---

## 1. الملفات المُنشأة والمعدّلة في المستودع

| المسار | الدور |
|---|---|
| `src/panel/identity.py` | ثوابت الهوية (`APP_ID=13`, `APP_KEY`, `APP_TYPE`, بيانات المطوّر) |
| `src/panel/config.py` | تحميل/حفظ إعدادات الاتصال (`panel.json` أو `FASTERPC_PANEL_URL` / `FASTERPC_PANEL_TOKEN`) مع إخفاء التوكن في السجلات |
| `src/panel/client.py` | عميل `/api/v1` (JSON فقط، `X-App-Token`, `X-App-Id: 13`, `X-Req-Id`, `Authorization: Bearer`) |
| `src/panel/session.py` | تخزين الجلسة وحالة الترخيص وذاكرة الحالة محليًا (`panel_session.json`) + بصمة الجهاز |
| `src/panel/auth.py` | تسجيل الدخول/إنشاء حساب/استعادة الجلسة/الخروج (`is_admin` من الخادم) |
| `src/panel/sync.py` | مزامنة الإعدادات (`SYNC_KEYS` فقط؛ `LOCAL_ONLY_KEYS` لا تغادر الجهاز) مع كشف التعارض (`server-wins`) |
| `src/panel/updates.py` | فحص التحديثات (`releases/check`: `full` / `sub` / `min_version` / `permissions_changed`) |
| `src/panel/licenses.py` | التحقق من الترخيص وتفعيله (تُستخدم فقط عند تفعيل `licenses_enabled`) |
| `src/panel/telemetry.py` | تجميع وإرسال أحداث Telemetry خفيفة بلا بيانات شخصية |
| `src/panel/control.py` | واجهة أقسام لوحة الإدارة للأدمن (`overview`, `users`, `devices`, `releases`, `settings`, `requirements`) |
| `src/panel/service.py` | طبقة الخدمة الموحّدة `PanelService` |
| `src/gui/panel_login_window.py` | شاشة الدخول الإلزامية وإعداد الاتصال أول مرة |
| `src/gui/admin_panel.py` | تبويب «لوحة التحكم» (يظهر للأدمن فقط عند `is_admin=1`) |
| `src/gui/other_apps.py` | تبويب «تطبيقات أخرى» لعرض التطبيقات الشقيقة من `status` |
| `src/core/app_context.py` | ربط `self.panel = PanelService(self.settings)` |
| `src/gui/app.py` | حلقة الدخول الإلزامي، فحص التحديثات، وإرسال Telemetry كل 10 دقائق |
| `src/gui/main_window.py` | استبدال تبويب المستخدمين المحلي بتبويبي «لوحة التحكم» و«تطبيقات أخرى» |
| `tests/test_panel.py` | 24 اختبار وحدة لتكامل لوحة الأم |

---

## 2. نقاط الـ API المستخدمة (`/api/v1`)

- `GET /api/v1/status` — حالة التطبيق، الإعدادات (`app_settings_kv`)، والتطبيقات الشقيقة (`siblings`).
- `POST /api/v1/auth/register` · `POST /api/v1/auth/login` · `GET /api/v1/auth/session` · `POST /api/v1/auth/logout` — الحسابات لكل تطبيق (`app_id=13`).
- `POST /api/v1/sync` (`op=push` / `op=pull`) — مزامنة الإعدادات مع `sync_version` وكشف التعارض.
- `GET /api/v1/releases/check` — فحص التحديثات (`full` / `sub` / `min_version` / `permissions_changed`).
- `POST /api/v1/licenses/verify` · `POST /api/v1/licenses/activate` — التراخيص.
- `POST /api/v1/telemetry` — إرسال المقاييس.
- `GET /api/v1/control` — أقسام الإدارة للأدمن فقط (`is_admin=1`).

> **ملاحظة حول `content_packs` (`content`)**: لم يُضف عميل لحزم المحتوى لأن Faster-PC تطبيق سطح مكتب لا يعتمد على حزم محتوى إضافية.
> **ملاحظة حول GitHub (`op=github_token`)**: خيار `github_enabled` معطّل (`false`) في `settings.json`، والتطبيق لا يطلب `op=github_token` أبدًا.

---

## 3. الجداول المشتركة ونطاق `app_id=13`

جميع العمليات محصورة في الجداول المشتركة للوحة الأم بنطاق `app_id = 13` (لا توجد جداول مخصصة للتطبيق ولا وصول مباشر لقاعدة البيانات من التطبيق):
- `boards` (`id = 13`)
- `app_users` (`app_id`, `email UNIQUE`, `is_admin 0/1`)
- `app_sessions`
- `devices` (`UNIQUE(app_id, device_uid)`)
- `releases`
- `app_settings_kv`
- `app_requirements`
- `sync_log` و `audit_log` (كل طلب يحمل `X-Req-Id` فريدًا)

---

## 4. الصلاحيات والمتطلبات الناقصة

- **الصلاحيات**: `is_admin` يُقرأ من الخادم فقط (`app_users.is_admin`)، وتبويب «لوحة التحكم» لا يظهر إلا للأدمن مع تحقق الخادم عند كل طلب `control`.
- **متطلب ناقص (`info` / `high`)**: البريد الإلكتروني للمطوّر (`DEVELOPER_EMAIL`) غير متاح حاليًا ومُسجّل في `requirements.json` بحالة `missing`؛ يُستكمل لاحقًا من المطوّر.

---

## 5. خطوات التحقق (Verify)

1. تطبيق `mother_panel/map.json` على لوحة الأم (أو استيراد `app.json`، `settings.json`، `requirements.json`، `min_version.json`).
2. استدعاء `GET /api/v1/status` بترويسات `X-App-Token` و`X-App-Id: 13` و`X-Req-Id` والتأكد من عودة `"ok": true` و`"requires_login": true` و`"github_enabled": false`.
3. تشغيل التطبيق محليًا وإدخال رابط لوحة الأم و`X-App-Token` في شاشة الدخول، ثم تجربة تسجيل الدخول والمزامنة.

<!-- ==== End of file — © Yousef Alhamzy (يوسف الحمزي) — Faster-PC ==== -->
31 changes: 31 additions & 0 deletions mother_panel/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_signature": "© Yousef Alhamzy (يوسف الحمزي) — Faster-PC — app_id 13",
"app_id": 13,
"app_key": "faster_pc",
"name": "Faster-PC",
"display_name": "Faster PC",
"version": "2.1.0",
"type": "desktop",
"platform": "windows",
"description": "أداة سطح مكتب لتحسين وتنظيف وإصلاح ومراقبة نظام ويندوز بواجهة عربية داكنة، متصلة بلوحة الأم لإدارة الحسابات والمزامنة والتحديثات.",
"tags": [
"windows",
"desktop",
"optimizer",
"cleaner",
"monitor",
"repair",
"pyside6",
"arabic"
],
"icon": "assets/icon.png",
"docs": "README.md",
"repo_url": "https://github.com/yswef/Faster-PC",
"developer": {
"name": "يوسف الحمزي",
"name_en": "Yousef Alhamzy",
"email": "",
"url": "https://github.com/yswef"
},
"_end_signature": "© Yousef Alhamzy (يوسف الحمزي) — Faster-PC"
}
Loading
Loading