Skip to content

Commit ffeabb1

Browse files
authored
Merge pull request #29 from jhd3197/dev
Add email server, SSO, API platform, and agent Socket.IO migration
2 parents 6244452 + 2c55d76 commit ffeabb1

161 files changed

Lines changed: 18408 additions & 1499 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/audit-less/SKILL.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: audit-less
3+
description: Scan LESS stylesheets for variable errors — undefined variables, CSS custom properties passed to compile-time functions (fade, darken, lighten, etc.), and incorrect variable name patterns. Reports issues with file, line, and fix.
4+
argument-hint: "[file-or-directory]"
5+
---
6+
7+
Audit LESS stylesheets in ServerKit for recurring build-breaking patterns.
8+
Scope: **${ARGUMENTS:-frontend/src/styles/}**
9+
10+
## What to Scan For
11+
12+
### Pattern 1: CSS custom properties in LESS compile-time functions
13+
14+
LESS functions like `fade()`, `darken()`, `lighten()`, `saturate()`, `spin()`, `mix()` require **real color values** at compile time. Variables defined as `var(--something)` will fail.
15+
16+
Search for calls to these functions and check if any argument is a variable that resolves to a CSS custom property.
17+
18+
**Broken** — these variables use `var(--...)` and cannot be evaluated by LESS:
19+
- `@bg-body`, `@bg-sidebar`, `@bg-card`, `@bg-hover`, `@bg-elevated`, `@bg-secondary`, `@bg-tertiary`
20+
- `@border-default`, `@border-subtle`, `@border-active`, `@border-hover`
21+
- `@text-primary`, `@text-secondary`, `@text-tertiary`
22+
- `@accent-primary`, `@accent-hover`, `@accent-glow`, `@accent-shadow`
23+
- `@shadow-sm`, `@shadow-md`, `@shadow-lg`
24+
- `@color-primary`
25+
26+
**Fix**: Use the corresponding `*-raw` variant instead (e.g., `@bg-hover``@bg-hover-raw`, `@text-tertiary``@text-tertiary-raw`, `@accent-primary``@accent-primary-raw`).
27+
28+
### Pattern 2: Undefined or misspelled variables
29+
30+
Check for variables that don't exist in `_variables.less`. Common mistakes:
31+
- `@card-bg` → should be `@bg-card`
32+
- `@accent-success` → should be `@success`
33+
- `@accent-danger` → should be `@danger`
34+
- `@accent-info` → should be `@info`
35+
- `@accent-warning` → should be `@warning`
36+
- `@primary-color` → should be `@accent-primary` or `@accent-primary-raw`
37+
- `@spacing-*` → should be `@space-*`
38+
39+
### Pattern 3: Non-raw variables in theme-sensitive contexts
40+
41+
For any LESS function that manipulates color values (fade, darken, lighten, contrast, saturate, desaturate, spin, mix, tint, shade), the argument MUST be a raw hex/rgb value or a `*-raw` variable.
42+
43+
## Reference: Valid Variable Names
44+
45+
Read `frontend/src/styles/_variables.less` to get the authoritative list of defined variables. Any `@variable` used in a `.less` file that is not in `_variables.less` (and is not a local variable or LESS built-in) is a bug.
46+
47+
## Output Format
48+
49+
For each issue found, report:
50+
```
51+
[FILE]:[LINE] — [ISSUE]
52+
Found: [problematic code]
53+
Fix: [corrected code]
54+
```
55+
56+
At the end, provide a summary count: `X issues found across Y files`.
57+
If no issues are found, report: `No LESS variable issues found.`

.claude/skills/create-pr/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ Omit the Highlights section entirely for internal-only PRs — don't force it.
103103
- Bullets should describe the mechanism, not just the intent. "Race condition in `get_or_create_chat` fixed by moving creation inside the lookup session" is good. "Fix database issues" is not.
104104
- Group related changes together (all typing fixes, all security hardening, all API changes, etc.)
105105

106+
#### Contributors
107+
- If the PR includes commits from multiple authors (not just the repo owner), add a **Contributors** section after the summary and before Highlights.
108+
- Use `git log main..HEAD --format='%aN <%aE>' | sort -u` to find unique commit authors.
109+
- Exclude bot accounts (e.g., `github-actions[bot]`).
110+
- Format: `@username` if their GitHub handle is available (check the ARGUMENTS or commit metadata), otherwise use their name. Add a brief note about what they contributed if it's clear from the commits.
111+
- Keep it short — one line per contributor, no need for a full changelog.
112+
106113
#### General
107114
- **No test plan section.** Do not include "Test plan" or "Testing".
108115
- **No mention of tests.** Do not reference test files, test results, or testing.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6262
RUN groupadd -r serverkit && useradd -r -g serverkit serverkit
6363

6464
# Create necessary directories
65-
RUN mkdir -p /etc/serverkit /var/log/serverkit /var/quarantine \
66-
&& chown -R serverkit:serverkit /etc/serverkit /var/log/serverkit /var/quarantine
65+
RUN mkdir -p /etc/serverkit /var/log/serverkit /var/quarantine /var/backups/serverkit \
66+
&& chown -R serverkit:serverkit /etc/serverkit /var/log/serverkit /var/quarantine /var/backups/serverkit
6767

6868
# Set working directory
6969
WORKDIR /app

README.md

Lines changed: 89 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
1818
![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white)
1919
[![Discord](https://img.shields.io/discord/1470639209059455008?style=for-the-badge&logo=discord&logoColor=white&label=Discord&color=5865F2)](https://discord.gg/ZKk6tkCQfG)
2020

21+
[![GitHub Stars](https://img.shields.io/github/stars/jhd3197/ServerKit?style=flat-square&color=f5c542)](https://github.com/jhd3197/ServerKit/stargazers)
2122
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
2223
[![Python](https://img.shields.io/badge/python-3.11+-3776AB.svg?style=flat-square&logo=python&logoColor=white)](https://python.org)
2324
[![React](https://img.shields.io/badge/react-18-61DAFB.svg?style=flat-square&logo=react&logoColor=black)](https://reactjs.org)
@@ -41,55 +42,89 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
4142

4243
## 🎯 Features
4344

44-
### Apps & Containers
45+
### 🚀 Apps & Deployment
4546

46-
🐘 **PHP / WordPress** — PHP-FPM 8.x with one-click WordPress installation
47+
**PHP / WordPress** — PHP-FPM 8.x with one-click WordPress installation
4748

48-
🐍 **Python Apps** — Deploy Flask and Django with Gunicorn
49+
**Python Apps** — Deploy Flask and Django with Gunicorn
4950

50-
🟢 **Node.js** — PM2-managed applications with log streaming
51+
**Node.js** — PM2-managed applications with log streaming
5152

52-
🐳 **Docker** — Full container and Docker Compose management
53+
**Docker** — Full container and Docker Compose management
5354

54-
🔑 **Environment Variables** — Secure, encrypted per-app variable management
55+
**Environment Variables** — Secure, encrypted per-app variable management
5556

56-
### Infrastructure
57+
**Git Deployment** — GitHub/GitLab webhooks, auto-deploy on push, branch selection, rollback, zero-downtime deployments
5758

58-
🌐 **Domain Management** — Nginx virtual hosts with easy configuration
59+
### 🏗️ Infrastructure
5960

60-
🔒 **SSL Certificates**Automatic Let's Encrypt with auto-renewal
61+
**Domain Management**Nginx virtual hosts with easy configuration
6162

62-
🗄️ **Databases**MySQL/MariaDB and PostgreSQL support
63+
**SSL Certificates**Automatic Let's Encrypt with auto-renewal
6364

64-
🛡️ **Firewall (UFW)**Visual firewall rule management
65+
**Databases**MySQL/MariaDB and PostgreSQL with user management and query interface
6566

66-
**Cron Jobs**Schedule tasks with a visual editor
67+
**Firewall**UFW/firewalld with visual rule management and port presets
6768

68-
📁 **File Manager**Browse and edit files via web interface
69+
**Cron Jobs**Schedule tasks with a visual editor
6970

70-
📡 **FTP Server**Manage vsftpd users and access
71+
**File Manager**Browse, edit, upload, and download files via web interface
7172

72-
### Security
73+
**FTP Server** — Manage vsftpd users and access
7374

74-
🔐 **Two-Factor Auth**TOTP-based with backup codes
75+
**Backup & Restore**Automated backups to S3, Backblaze B2, or local storage with scheduling, retention policies, and one-click restore
7576

76-
🦠 **Malware Scanning**ClamAV integration with quarantine
77+
**Email Server**Postfix + Dovecot with DKIM/SPF/DMARC, SpamAssassin, Roundcube webmail, email forwarding rules
7778

78-
📋 **File Integrity Monitoring** — Detect unauthorized file changes
79+
### 🔒 Security
7980

80-
🚨 **Security Alerts**Real-time threat notifications
81+
**Two-Factor Auth**TOTP-based with backup codes
8182

82-
🧱 **Fail2ban & SSH**Brute force protection and SSH key management
83+
**Malware Scanning**ClamAV integration with quarantine
8384

84-
### Monitoring & Alerts
85+
**File Integrity Monitoring** — Detect unauthorized file changes
8586

86-
📊 **Real-time Metrics**CPU, RAM, disk, network monitoring via WebSocket
87+
**Fail2ban & SSH**Brute force protection, SSH key management, IP allowlist/blocklist
8788

88-
📈 **Uptime Tracking**Historical server uptime data
89+
**Vulnerability Scanning**Lynis security audits with reports and recommendations
8990

90-
🔔 **Notifications**Discord, Slack, Telegram, and generic webhooks
91+
**Automatic Updates**unattended-upgrades / dnf-automatic for OS-level patching
9192

92-
🖥️ **Multi-Server** — Agent-based remote server monitoring and management
93+
### 🖥️ Multi-Server Management
94+
95+
**Agent-Based Architecture** — Go agent with HMAC-SHA256 authentication and real-time WebSocket gateway
96+
97+
**Fleet Overview** — Centralized dashboard with server grouping, tagging, and health monitoring
98+
99+
**Remote Docker** — Manage containers, images, volumes, networks, and Compose projects across all servers
100+
101+
**API Key Rotation** — Secure credential rotation with acknowledgment handshake
102+
103+
**Cross-Server Metrics** — Historical metrics with comparison charts and retention policies
104+
105+
### 📊 Monitoring & Alerts
106+
107+
**Real-time Metrics** — CPU, RAM, disk, network monitoring via WebSocket
108+
109+
**Uptime Tracking** — Historical server uptime data and visualization
110+
111+
**Notifications** — Discord, Slack, Telegram, email (HTML templates), and generic webhooks
112+
113+
**Per-User Preferences** — Individual notification channels, severity filters, and quiet hours
114+
115+
### 👥 Team & Access Control
116+
117+
**Multi-User** — Admin, developer, and viewer roles with team invitations
118+
119+
**RBAC** — Granular per-feature permissions (read/write per module)
120+
121+
**SSO & OAuth** — Google, GitHub, OpenID Connect, and SAML 2.0 with account linking
122+
123+
**Audit Logging** — Track all user actions with detailed activity dashboard
124+
125+
**API Keys** — Tiered API keys (standard/elevated/unlimited) with rate limiting, usage analytics, and OpenAPI documentation
126+
127+
**Webhook Subscriptions** — Event-driven webhooks with HMAC signatures, retry logic, and custom headers
93128

94129
---
95130

@@ -215,15 +250,23 @@ See the [Installation Guide](docs/INSTALLATION.md) for step-by-step instructions
215250
- [x] Databases — MySQL, PostgreSQL
216251
- [x] File & FTP management
217252
- [x] Monitoring & alerts — Metrics, webhooks, uptime tracking
218-
- [x] Security — 2FA, ClamAV, file integrity, Fail2ban
219-
- [x] Firewall — UFW integration
253+
- [x] Security — 2FA, ClamAV, file integrity, Fail2ban, Lynis
254+
- [x] Firewall — UFW/firewalld integration
220255
- [x] Multi-server management — Go agent, centralized dashboard
221256
- [x] Git deployment — Webhooks, auto-deploy, rollback, zero-downtime
222-
- [ ] Backup & restore — S3, Backblaze B2, scheduled backups
223-
- [ ] Email server — Postfix, Dovecot, DKIM/SPF/DMARC
224-
- [ ] Team & permissions — RBAC, audit logging
225-
- [ ] Mobile app — React Native with push notifications
226-
- [ ] Plugin marketplace — Extensions, custom widgets, themes
257+
- [x] Backup & restore — S3, Backblaze B2, scheduled backups
258+
- [x] Email server — Postfix, Dovecot, DKIM/SPF/DMARC, Roundcube
259+
- [x] Team & permissions — RBAC, invitations, audit logging
260+
- [x] API enhancements — API keys, rate limiting, OpenAPI docs, webhook subscriptions
261+
- [x] SSO & OAuth — Google, GitHub, OIDC, SAML
262+
- [x] Database migrations — Flask-Migrate/Alembic, versioned schema
263+
- [ ] Agent fleet management — Auto-upgrade, bulk ops, offline command queue
264+
- [ ] Cross-server monitoring — Fleet dashboard, anomaly detection, alerting
265+
- [ ] Agent plugin system — Extensible agent with custom metrics, commands, health checks
266+
- [ ] Server templates & config sync — Drift detection, compliance dashboards
267+
- [ ] Multi-tenancy — Workspaces, team isolation, per-workspace settings
268+
- [ ] DNS zone management — Cloudflare, Route53, DigitalOcean integrations
269+
- [ ] Status pages — Public status page, health checks, incident management
227270

228271
Full details: [ROADMAP.md](ROADMAP.md)
229272

@@ -246,12 +289,15 @@ Full details: [ROADMAP.md](ROADMAP.md)
246289

247290
| Layer | Technology |
248291
|-------|------------|
249-
| Backend | Python 3.11, Flask, SQLAlchemy, Flask-SocketIO |
250-
| Frontend | React 18, Vite, LESS |
292+
| Backend | Python 3.11, Flask, SQLAlchemy, Flask-SocketIO, Flask-Migrate |
293+
| Frontend | React 18, Vite, LESS, Recharts |
251294
| Database | SQLite / PostgreSQL |
252-
| Web Server | Nginx, Gunicorn |
295+
| Web Server | Nginx, Gunicorn (GeventWebSocket) |
253296
| Containers | Docker, Docker Compose |
254-
| Security | ClamAV, TOTP (pyotp), Cryptography |
297+
| Security | ClamAV, Lynis, Fail2ban, TOTP (pyotp), Fernet encryption |
298+
| Auth | JWT, OAuth 2.0, OIDC, SAML 2.0 |
299+
| Email | Postfix, Dovecot, SpamAssassin, Roundcube |
300+
| Agent | Go (multi-server), HMAC-SHA256, WebSocket |
255301

256302
---
257303

@@ -263,7 +309,7 @@ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
263309
fork → feature branch → commit → push → pull request
264310
```
265311

266-
**Priority areas:** Backup implementations, additional notification channels, UI/UX improvements, documentation.
312+
**Priority areas:** Agent plugin system, fleet management, DNS integrations, status pages, UI/UX improvements, documentation.
267313

268314
---
269315

@@ -275,6 +321,12 @@ Join the Discord to ask questions, share feedback, or get help with your setup.
275321

276322
---
277323

324+
## ⭐ Star History
325+
326+
[![Star History Chart](https://api.star-history.com/svg?repos=jhd3197/ServerKit&type=Date)](https://star-history.com/#jhd3197/ServerKit&Date)
327+
328+
---
329+
278330
<div align="center">
279331

280332
**ServerKit** — Simple. Modern. Self-hosted.

0 commit comments

Comments
 (0)