strapi-plugin-magic-link-v5 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYRIGHT_NOTICE.txt +9 -10
- package/LICENSE +27 -48
- package/README.md +18 -34
- package/package.json +2 -2
- package/LICENSE-DUAL.md +0 -37
- package/LICENSE_GUARD.md +0 -323
- package/SECURITY.md +0 -79
package/COPYRIGHT_NOTICE.txt
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Magic Link - Passwordless Authentication for Strapi
|
|
3
3
|
*
|
|
4
|
-
* Copyright (c) 2025
|
|
5
|
-
* All Rights Reserved.
|
|
4
|
+
* Copyright (c) 2025 Schero A. (begservice)
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* Licensed under the MIT License
|
|
8
7
|
*
|
|
9
|
-
* This
|
|
8
|
+
* This plugin is free to use for personal and commercial projects.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* IMPORTANT RESTRICTION:
|
|
11
|
+
* The license validation system (license-guard.js and related components)
|
|
12
|
+
* must remain intact and functional. Removing or bypassing this system
|
|
13
|
+
* is strictly prohibited.
|
|
13
14
|
*
|
|
14
|
-
* This software is licensed under a proprietary commercial license.
|
|
15
15
|
* See LICENSE file for full terms.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Repository: https://github.com/begservice/strapi-plugin-magic-link-v5
|
|
18
|
+
* Issues: https://github.com/begservice/strapi-plugin-magic-link-v5/issues
|
|
19
19
|
*/
|
|
20
|
-
|
package/LICENSE
CHANGED
|
@@ -1,48 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
and
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
4. TERMINATION
|
|
30
|
-
This license is effective until terminated. Your rights under this license
|
|
31
|
-
will terminate automatically without notice if you fail to comply with any
|
|
32
|
-
term of this license.
|
|
33
|
-
|
|
34
|
-
5. WARRANTY DISCLAIMER
|
|
35
|
-
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
36
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
37
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
38
|
-
|
|
39
|
-
6. LIMITATION OF LIABILITY
|
|
40
|
-
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
41
|
-
OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
|
42
|
-
|
|
43
|
-
7. LICENSE PURCHASE
|
|
44
|
-
To obtain a valid license, visit: [Deine Website]
|
|
45
|
-
Each license is subject to separate terms and pricing.
|
|
46
|
-
|
|
47
|
-
For licensing inquiries, contact: [Deine Email]
|
|
48
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Schero A. (begservice)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
**ADDITIONAL CONDITION:**
|
|
16
|
+
The license validation system (including but not limited to license-guard.js,
|
|
17
|
+
license controller, and related API endpoints) must remain intact and functional.
|
|
18
|
+
Removing, bypassing, or disabling the license validation system is strictly
|
|
19
|
+
prohibited.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,20 +4,25 @@ A secure passwordless authentication solution for Strapi, allowing users to log
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 📜 License
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This plugin is licensed under the **MIT License** - free for everyone to use!
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
- ✅
|
|
14
|
-
- ✅
|
|
11
|
+
### What you CAN do:
|
|
12
|
+
- ✅ Use the plugin freely (personal & commercial)
|
|
13
|
+
- ✅ View and study the source code
|
|
14
|
+
- ✅ Report issues and contribute improvements
|
|
15
|
+
- ✅ Deploy in production without fees
|
|
16
|
+
- ✅ Integrate in your commercial projects
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
### What you CANNOT do:
|
|
19
|
+
- ❌ Remove or bypass the license validation system
|
|
20
|
+
- ❌ Modify `license-guard.js` or license-related endpoints
|
|
21
|
+
- ❌ Disable license activation requirements
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
**Important:** The license validation system must remain intact and functional. This ensures quality, support, and continued development. Users must activate the plugin (free) through the admin interface.
|
|
24
|
+
|
|
25
|
+
📄 See [LICENSE](./LICENSE) for full terms
|
|
21
26
|
|
|
22
27
|
---
|
|
23
28
|
|
|
@@ -50,29 +55,6 @@ yarn add begservice/strapi-magic-link
|
|
|
50
55
|
|
|
51
56
|
After installation, restart your Strapi server and the plugin will be available in the admin panel.
|
|
52
57
|
|
|
53
|
-
## License Server
|
|
54
|
-
|
|
55
|
-
This plugin uses a **centralized license server** for validation and activation.
|
|
56
|
-
|
|
57
|
-
### How It Works
|
|
58
|
-
|
|
59
|
-
- The plugin connects to a fixed license server URL for all license operations
|
|
60
|
-
- License keys are validated against this server
|
|
61
|
-
- The server URL is hardcoded for security (cannot be changed by end users)
|
|
62
|
-
- Supports **24-hour grace period** for offline operation
|
|
63
|
-
|
|
64
|
-
### For Developers (Development Mode)
|
|
65
|
-
|
|
66
|
-
During development, you can override the license server URL:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# .env file
|
|
70
|
-
LICENSE_SERVER_URL=http://localhost:1337
|
|
71
|
-
NODE_ENV=development
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Note**: This override only works in development mode for testing purposes.
|
|
75
|
-
|
|
76
58
|
## How It Works
|
|
77
59
|
|
|
78
60
|
### Email User with Login Link
|
|
@@ -275,7 +257,9 @@ await axios.post("/api/magic-link/send", {
|
|
|
275
257
|
|
|
276
258
|
## License
|
|
277
259
|
|
|
278
|
-
[
|
|
260
|
+
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
|
|
261
|
+
|
|
262
|
+
**Important:** While the code is open source, the license validation system must remain intact. This ensures quality, security, and continued development of the plugin.
|
|
279
263
|
|
|
280
264
|
## Development & Contributing
|
|
281
265
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.4.0",
|
|
3
3
|
"keywords": [],
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"exports": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"name": "strapi-plugin-magic-link-v5",
|
|
62
62
|
"description": "This plugin provides passwordless authentication via magic links sent to email",
|
|
63
|
-
"license": "
|
|
63
|
+
"license": "MIT",
|
|
64
64
|
"private": false,
|
|
65
65
|
"author": "Schero A. <124470865+begservice@users.noreply.github.com>",
|
|
66
66
|
"repository": {
|
package/LICENSE-DUAL.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# DUAL LICENSE
|
|
2
|
-
|
|
3
|
-
This software is available under a dual licensing model.
|
|
4
|
-
|
|
5
|
-
## 1. GNU AFFERO GENERAL PUBLIC LICENSE (AGPL-3.0)
|
|
6
|
-
|
|
7
|
-
If you are creating an open-source application under a license compatible with
|
|
8
|
-
the GNU AGPL-3.0, you may use this software under those terms.
|
|
9
|
-
|
|
10
|
-
**Key Requirements:**
|
|
11
|
-
- You MUST make your complete source code available
|
|
12
|
-
- You MUST license your application under AGPL-3.0
|
|
13
|
-
- Network use counts as distribution (you must share code even for SaaS)
|
|
14
|
-
- You MUST provide prominent notice and attribution
|
|
15
|
-
|
|
16
|
-
See: https://www.gnu.org/licenses/agpl-3.0.html
|
|
17
|
-
|
|
18
|
-
## 2. COMMERCIAL LICENSE
|
|
19
|
-
|
|
20
|
-
If you want to use this software in a proprietary/commercial application
|
|
21
|
-
WITHOUT the obligations of AGPL-3.0, you must purchase a commercial license.
|
|
22
|
-
|
|
23
|
-
**Commercial License Benefits:**
|
|
24
|
-
- No obligation to open-source your code
|
|
25
|
-
- Can be used in proprietary/closed-source applications
|
|
26
|
-
- Can be used in SaaS without sharing code
|
|
27
|
-
- Priority support and updates
|
|
28
|
-
- No copyleft requirements
|
|
29
|
-
|
|
30
|
-
**Purchase:** [Deine Website]
|
|
31
|
-
**Contact:** [Deine Email]
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
**Note:** Using this software without a valid license (either AGPL-3.0 compliance
|
|
36
|
-
or commercial license) is copyright infringement and will be prosecuted.
|
|
37
|
-
|
package/LICENSE_GUARD.md
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
# Magic Link License Guard
|
|
2
|
-
|
|
3
|
-
Der License Guard schützt und verwaltet das Magic Link Plugin über das bestehende License API System.
|
|
4
|
-
|
|
5
|
-
## 🚀 Features
|
|
6
|
-
|
|
7
|
-
- ✅ **Automatische Lizenz-Initialisierung** beim Plugin-Start
|
|
8
|
-
- ✅ **Auto-Ping alle 15 Minuten** für Online-Tracking
|
|
9
|
-
- ✅ **Geräteerkennung** (DeviceID, DeviceName, IP, UserAgent)
|
|
10
|
-
- ✅ **Grace Period Support** (24h Offline-Nutzung)
|
|
11
|
-
- ✅ **Admin-Endpoints** für Lizenzverwaltung
|
|
12
|
-
- ✅ **Automatisches Cleanup** beim Plugin-Stop
|
|
13
|
-
|
|
14
|
-
## 📋 Wie es funktioniert
|
|
15
|
-
|
|
16
|
-
### 1. Beim Plugin-Start
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Plugin startet → License Guard initialisiert
|
|
20
|
-
↓
|
|
21
|
-
Lizenzschlüssel im Store?
|
|
22
|
-
↓ JA ↓ NEIN
|
|
23
|
-
Verifizieren Demo-Mode
|
|
24
|
-
↓ ↓
|
|
25
|
-
Gültig? Warnung anzeigen
|
|
26
|
-
↓ JA ↓ NEIN
|
|
27
|
-
Ping starten Demo-Mode
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### 2. Automatisches Pinging
|
|
31
|
-
|
|
32
|
-
Alle 15 Minuten sendet der Guard automatisch:
|
|
33
|
-
```json
|
|
34
|
-
POST /api/licenses/ping
|
|
35
|
-
{
|
|
36
|
-
"licenseKey": "A1B2-C3D4-E5F6-G7H8"
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Dies aktualisiert:
|
|
41
|
-
- `lastPingAt` - Aktueller Zeitstempel
|
|
42
|
-
- `lastActiveAt` - Aktivitäts-Tracker
|
|
43
|
-
- `isOnline` - Online-Status basierend auf Grace Period
|
|
44
|
-
|
|
45
|
-
## 🎯 Verwendung
|
|
46
|
-
|
|
47
|
-
### Option 1: Lizenz über API erstellen
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
curl -X POST http://localhost:1337/api/licenses/create \
|
|
51
|
-
-H "Content-Type: application/json" \
|
|
52
|
-
-d '{
|
|
53
|
-
"email": "admin@example.com",
|
|
54
|
-
"firstName": "Admin",
|
|
55
|
-
"lastName": "User",
|
|
56
|
-
"deviceName": "Server-01",
|
|
57
|
-
"deviceId": "device-abc-123",
|
|
58
|
-
"ipAddress": "192.168.1.100",
|
|
59
|
-
"userAgent": "Strapi/5.11.2"
|
|
60
|
-
}'
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Response:**
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"success": true,
|
|
67
|
-
"message": "License created successfully",
|
|
68
|
-
"data": {
|
|
69
|
-
"id": 1,
|
|
70
|
-
"licenseKey": "A1B2-C3D4-E5F6-G7H8",
|
|
71
|
-
"email": "admin@example.com",
|
|
72
|
-
"isActive": true,
|
|
73
|
-
...
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Der License Guard erkennt automatisch die neue Lizenz beim nächsten Start!
|
|
79
|
-
|
|
80
|
-
### Option 2: Auto-Create über Admin-Endpoint
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
curl -X POST http://localhost:1337/magic-link/license/auto-create
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Erstellt automatisch eine Lizenz mit Standard-Daten und aktiviert sie sofort.
|
|
87
|
-
|
|
88
|
-
### Option 3: Programmatisch erstellen
|
|
89
|
-
|
|
90
|
-
```javascript
|
|
91
|
-
// Im Strapi-Code oder Terminal
|
|
92
|
-
await strapi
|
|
93
|
-
.plugin('magic-link')
|
|
94
|
-
.service('license-guard')
|
|
95
|
-
.autoCreateLicense('your@email.com', 'First', 'Last');
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## 📡 Admin-Endpoints
|
|
99
|
-
|
|
100
|
-
Alle Endpoints sind unter `/magic-link/...` verfügbar:
|
|
101
|
-
|
|
102
|
-
| Endpoint | Methode | Beschreibung |
|
|
103
|
-
|----------|---------|--------------|
|
|
104
|
-
| `/license/status` | GET | Aktueller Lizenz-Status |
|
|
105
|
-
| `/license/create` | POST | Lizenz erstellen & aktivieren |
|
|
106
|
-
| `/license/auto-create` | POST | Auto-Lizenz mit Defaults |
|
|
107
|
-
| `/license/ping` | POST | Manueller Ping |
|
|
108
|
-
| `/license/stats` | GET | Online-Statistiken |
|
|
109
|
-
| `/license/deactivate` | POST | Lizenz deaktivieren |
|
|
110
|
-
|
|
111
|
-
### Beispiele
|
|
112
|
-
|
|
113
|
-
**Status abfragen:**
|
|
114
|
-
```bash
|
|
115
|
-
curl http://localhost:1337/magic-link/license/status
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Response:**
|
|
119
|
-
```json
|
|
120
|
-
{
|
|
121
|
-
"success": true,
|
|
122
|
-
"valid": true,
|
|
123
|
-
"data": {
|
|
124
|
-
"licenseKey": "A1B2-C3D4-E5F6-G7H8",
|
|
125
|
-
"isActive": true,
|
|
126
|
-
"isExpired": false,
|
|
127
|
-
"isOnline": true,
|
|
128
|
-
"expiresAt": "2026-10-13T10:00:00.000Z",
|
|
129
|
-
"lastPingAt": "2025-10-13T21:00:00.000Z",
|
|
130
|
-
"deviceName": "MacBook-Pro.local",
|
|
131
|
-
"features": {
|
|
132
|
-
"premium": true,
|
|
133
|
-
"advanced": false,
|
|
134
|
-
"enterprise": false,
|
|
135
|
-
"custom": false
|
|
136
|
-
},
|
|
137
|
-
"maxDevices": 1,
|
|
138
|
-
"currentDevices": 1
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Manuelle Ping:**
|
|
144
|
-
```bash
|
|
145
|
-
curl -X POST http://localhost:1337/magic-link/license/ping
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Online-Statistiken:**
|
|
149
|
-
```bash
|
|
150
|
-
curl http://localhost:1337/magic-link/license/stats
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## 🔧 Gesammelte Daten
|
|
154
|
-
|
|
155
|
-
Der License Guard sammelt automatisch:
|
|
156
|
-
|
|
157
|
-
### Device Information
|
|
158
|
-
- **DeviceID**: SHA256-Hash von MAC-Adressen + Hostname
|
|
159
|
-
- **DeviceName**: System-Hostname (z.B. "MacBook-Pro.local")
|
|
160
|
-
- **IP Address**: Server-IP (erste nicht-interne IPv4)
|
|
161
|
-
- **User Agent**: "Strapi/{version} Node/{version} {platform}/{release}"
|
|
162
|
-
|
|
163
|
-
### Beispiel gesammelte Daten:
|
|
164
|
-
```javascript
|
|
165
|
-
{
|
|
166
|
-
deviceId: "a3f8e92c1d4b5e6f7a8b9c0d1e2f3a4b",
|
|
167
|
-
deviceName: "MacBook-Pro.local",
|
|
168
|
-
ipAddress: "192.168.1.100",
|
|
169
|
-
userAgent: "Strapi/5.11.2 Node/v20.11.0 darwin/23.0.0"
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## 📊 Console Output
|
|
174
|
-
|
|
175
|
-
Beim Plugin-Start siehst du eine dieser Meldungen:
|
|
176
|
-
|
|
177
|
-
### ✅ Lizenz aktiv:
|
|
178
|
-
```
|
|
179
|
-
╔════════════════════════════════════════════════════════════════╗
|
|
180
|
-
║ ✅ MAGIC LINK PLUGIN LICENSE ACTIVE ║
|
|
181
|
-
║ ║
|
|
182
|
-
║ License: A1B2-C3D4-E5F6-G7H8 ║
|
|
183
|
-
║ User: Max Mustermann ║
|
|
184
|
-
║ Email: max@example.com ║
|
|
185
|
-
║ ║
|
|
186
|
-
║ 🔄 Auto-pinging every 15 minutes ║
|
|
187
|
-
╚════════════════════════════════════════════════════════════════╝
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### ⚠️ Demo-Mode:
|
|
191
|
-
```
|
|
192
|
-
╔════════════════════════════════════════════════════════════════╗
|
|
193
|
-
║ ⚠️ MAGIC LINK PLUGIN RUNNING IN DEMO MODE ║
|
|
194
|
-
║ ║
|
|
195
|
-
║ To activate, create a license: ║
|
|
196
|
-
║ POST http://localhost:1337/api/licenses/create ║
|
|
197
|
-
║ ║
|
|
198
|
-
║ Or auto-create with: ║
|
|
199
|
-
║ strapi.plugin("magic-link").service("license-guard") ║
|
|
200
|
-
║ .autoCreateLicense("your@email.com", "First", "Last") ║
|
|
201
|
-
╚════════════════════════════════════════════════════════════════╝
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## 🔄 Lifecycle
|
|
205
|
-
|
|
206
|
-
### Bootstrap (Plugin Start)
|
|
207
|
-
1. License Guard Service wird geladen
|
|
208
|
-
2. Nach 3 Sekunden: Initialize()
|
|
209
|
-
3. Prüfe auf gespeicherten Lizenzschlüssel
|
|
210
|
-
4. Verifiziere Lizenz
|
|
211
|
-
5. Starte Auto-Ping (alle 15 Min)
|
|
212
|
-
|
|
213
|
-
### Destroy (Plugin Stop)
|
|
214
|
-
1. Stoppe Ping-Interval
|
|
215
|
-
2. Cleanup-Log
|
|
216
|
-
|
|
217
|
-
## 💻 Integration in dein Plugin
|
|
218
|
-
|
|
219
|
-
### Lizenz-Status im Admin-Panel anzeigen
|
|
220
|
-
|
|
221
|
-
Erstelle eine Settings-Seite mit Lizenz-Info:
|
|
222
|
-
|
|
223
|
-
```javascript
|
|
224
|
-
// In deiner Settings-Component
|
|
225
|
-
const { data: licenseStatus } = await get('/magic-link/license/status');
|
|
226
|
-
|
|
227
|
-
if (licenseStatus.valid) {
|
|
228
|
-
console.log('✅ License active:', licenseStatus.data.licenseKey);
|
|
229
|
-
console.log('Features:', licenseStatus.data.features);
|
|
230
|
-
} else {
|
|
231
|
-
console.log('⚠️ Demo mode or invalid license');
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Lizenz erstellen aus dem Admin-Panel
|
|
236
|
-
|
|
237
|
-
```javascript
|
|
238
|
-
const createLicense = async () => {
|
|
239
|
-
const response = await post('/magic-link/license/create', {
|
|
240
|
-
email: 'user@example.com',
|
|
241
|
-
firstName: 'John',
|
|
242
|
-
lastName: 'Doe',
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
if (response.data.success) {
|
|
246
|
-
console.log('License created:', response.data.data.licenseKey);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
## 🔐 Sicherheit
|
|
252
|
-
|
|
253
|
-
- ✅ **DeviceID ist persistent** - Basiert auf Hardware
|
|
254
|
-
- ✅ **Eindeutige Identifikation** - SHA256-Hash
|
|
255
|
-
- ✅ **Keine Speicherung sensibler Daten** - Nur Hashes
|
|
256
|
-
- ✅ **GDPR-konform** - User-Daten anonymisiert
|
|
257
|
-
|
|
258
|
-
## 🛠 Troubleshooting
|
|
259
|
-
|
|
260
|
-
### Plugin startet im Demo-Mode
|
|
261
|
-
|
|
262
|
-
**Ursache:** Keine Lizenz gefunden oder Lizenz ungültig
|
|
263
|
-
|
|
264
|
-
**Lösung:**
|
|
265
|
-
```bash
|
|
266
|
-
# Option 1: Auto-Create
|
|
267
|
-
curl -X POST http://localhost:1337/magic-link/license/auto-create
|
|
268
|
-
|
|
269
|
-
# Option 2: Manuell über License API
|
|
270
|
-
curl -X POST http://localhost:1337/api/licenses/create \
|
|
271
|
-
-H "Content-Type: application/json" \
|
|
272
|
-
-d '{"email":"admin@localhost","firstName":"Admin","lastName":"User"}'
|
|
273
|
-
|
|
274
|
-
# Option 3: Im Strapi Terminal
|
|
275
|
-
await strapi.plugin('magic-link').service('license-guard')
|
|
276
|
-
.autoCreateLicense('admin@example.com', 'Admin', 'User');
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Pinging funktioniert nicht
|
|
280
|
-
|
|
281
|
-
**Prüfen:**
|
|
282
|
-
```bash
|
|
283
|
-
# Manueller Ping
|
|
284
|
-
curl -X POST http://localhost:1337/magic-link/license/ping
|
|
285
|
-
|
|
286
|
-
# Status prüfen
|
|
287
|
-
curl http://localhost:1337/magic-link/license/status
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### Lizenz als "offline" markiert
|
|
291
|
-
|
|
292
|
-
- Grace Period ist abgelaufen (>24h kein Ping)
|
|
293
|
-
- Pinging wurde gestoppt
|
|
294
|
-
- Netzwerk-Probleme
|
|
295
|
-
|
|
296
|
-
**Lösung:** Einmal pingen → `isOnline` wird wieder auf `true` gesetzt
|
|
297
|
-
|
|
298
|
-
## 📚 Logs
|
|
299
|
-
|
|
300
|
-
Der License Guard loggt:
|
|
301
|
-
|
|
302
|
-
```
|
|
303
|
-
[INFO] 🔐 Initializing License Guard...
|
|
304
|
-
[INFO] 📄 Found existing license key: A1B2-C3D4-E5F6-G7H8
|
|
305
|
-
[INFO] ✅ License is valid and active
|
|
306
|
-
[INFO] 📡 Started pinging license every 15 minutes
|
|
307
|
-
[DEBUG] 📡 License ping successful: A1B2-C3D4-E5F6-G7H8
|
|
308
|
-
[INFO] 🛑 License pinging stopped
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
## 🎉 Fertig!
|
|
312
|
-
|
|
313
|
-
Der License Guard läuft nun automatisch im Hintergrund:
|
|
314
|
-
- ✅ Verifiziert beim Start
|
|
315
|
-
- ✅ Pingt alle 15 Minuten
|
|
316
|
-
- ✅ Tracked Online-Status
|
|
317
|
-
- ✅ Bereit für Production
|
|
318
|
-
|
|
319
|
-
Für weitere Informationen siehe:
|
|
320
|
-
- `/src/api/license/README.md` - License API Dokumentation
|
|
321
|
-
- `/src/api/license/TRACKING.md` - Tracking-Details
|
|
322
|
-
- `/src/api/license/SUMMARY.md` - Zusammenfassung
|
|
323
|
-
|
package/SECURITY.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Security & License Protection
|
|
2
|
-
|
|
3
|
-
## License Enforcement
|
|
4
|
-
|
|
5
|
-
This software includes multiple layers of license protection:
|
|
6
|
-
|
|
7
|
-
### 1. Backend License Check
|
|
8
|
-
- API endpoints are protected by `license-check` policy
|
|
9
|
-
- All requests are validated against active license
|
|
10
|
-
- Invalid/expired licenses are rejected with 401 status
|
|
11
|
-
|
|
12
|
-
### 2. Frontend License Guard
|
|
13
|
-
- Admin UI displays activation modal without valid license
|
|
14
|
-
- Prevents unauthorized UI access
|
|
15
|
-
- Requires license activation before use
|
|
16
|
-
|
|
17
|
-
### 3. License Verification
|
|
18
|
-
- License keys are validated against central license database
|
|
19
|
-
- Regular "ping" mechanism ensures license is active
|
|
20
|
-
- Offline grace period for temporary network issues
|
|
21
|
-
|
|
22
|
-
## Anti-Piracy Measures
|
|
23
|
-
|
|
24
|
-
### Current Protection:
|
|
25
|
-
1. **License Key Validation**: Server-side verification
|
|
26
|
-
2. **Device Binding**: License tied to specific server instances
|
|
27
|
-
3. **Online Checks**: Regular validation against license server
|
|
28
|
-
4. **IP Tracking**: Monitor and limit license usage by IP
|
|
29
|
-
5. **Audit Logging**: All license operations are logged
|
|
30
|
-
|
|
31
|
-
### Additional Recommendations:
|
|
32
|
-
|
|
33
|
-
#### Code Obfuscation (Optional)
|
|
34
|
-
Consider obfuscating critical parts of the code:
|
|
35
|
-
```bash
|
|
36
|
-
npm install javascript-obfuscator --save-dev
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
#### API Key Protection
|
|
40
|
-
Never commit license server API credentials to git:
|
|
41
|
-
```bash
|
|
42
|
-
# Add to .env
|
|
43
|
-
LICENSE_SERVER_URL=https://your-license-server.com
|
|
44
|
-
LICENSE_API_KEY=your-secret-key
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
#### Monitoring
|
|
48
|
-
Set up monitoring for:
|
|
49
|
-
- Unusual license activation patterns
|
|
50
|
-
- Multiple IPs using same license
|
|
51
|
-
- Attempts to bypass license checks
|
|
52
|
-
|
|
53
|
-
## Reporting License Violations
|
|
54
|
-
|
|
55
|
-
If you discover unauthorized use of this software:
|
|
56
|
-
|
|
57
|
-
**Email:** [Your Email]
|
|
58
|
-
**Subject:** License Violation Report
|
|
59
|
-
|
|
60
|
-
Include:
|
|
61
|
-
- URL or location where unauthorized use was found
|
|
62
|
-
- Screenshots/evidence
|
|
63
|
-
- Any relevant information
|
|
64
|
-
|
|
65
|
-
We take license violations seriously and will pursue legal action when necessary.
|
|
66
|
-
|
|
67
|
-
## Legal Notice
|
|
68
|
-
|
|
69
|
-
Unauthorized use, copying, or distribution of this software constitutes:
|
|
70
|
-
- Copyright infringement
|
|
71
|
-
- Breach of software license agreement
|
|
72
|
-
- Potential criminal violation under applicable laws
|
|
73
|
-
|
|
74
|
-
Violators will be prosecuted to the fullest extent of the law.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
**Last Updated:** 2025-01-13
|
|
79
|
-
|