Add username prefix requirement for plugin filenames

This commit is contained in:
2026-04-17 02:57:51 +10:00
parent c99a10e1c2
commit fc4c5fb1d1
3 changed files with 171 additions and 10 deletions

View File

@@ -14,7 +14,16 @@ All plugin submissions are automatically validated before being merged. PRs must
- ❌ Cannot modify `.gitea/` infrastructure files
- ⚠️ `plugins/index.json` is auto-generated - don't manually edit it
### 2. File Type
### 2. File Naming
- **Filename must be prefixed with your username**
- Format: `username-plugin-name.json`
- Example: `litruv-example-plugin.json`
- ❌ Invalid: `example-plugin.json` (missing username prefix)
- ❌ Invalid: `otheruser-plugin.json` (wrong username)
This prevents naming conflicts and makes ownership visible.
### 3. File Type
- ✅ Only `.json` files are allowed in `plugins/` directory
- ❌ No other file types (images, scripts, etc. must be in plugin repo)
@@ -38,7 +47,8 @@ Every plugin JSON must have these fields:
#### `id` (required)
- Must match the filename
- Example: `example-plugin.json``"id": "example-plugin"`
- Example: `litruv-example-plugin.json``"id": "litruv-example-plugin"`
- Must include username prefix matching filename
- Lowercase, hyphens allowed, no spaces
#### `name` (required)
@@ -134,9 +144,15 @@ node .gitea/scripts/validate-pr.js "your-username" "plugins/your-plugin.json"
**Fix**: Change `"author": "someone"` to `"author": "you"`
### ❌ ID doesn't match filename
```litruv-my-plugin.json: Plugin ID "different-name" doesn't match filename "litruv-my-plugin.json"
```
❌ plugins/my-plugin.json: Plugin ID "different-name" doesn't match filename "my-plugin.json"
**Fix**: Change `"id": "different-name"` to `"id": "litruv-my-plugin"`
### ❌ Filename missing username prefix
```
❌ plugins/my-plugin.json: Filename must start with your username "litruv-" (e.g., "litruv-my-plugin.json")
```
**Fix**: Rename file from `my-plugin.json` to `litruv-my-plugin.json` and update the `id` field
**Fix**: Change `"id": "different-name"` to `"id": "my-plugin"`
### ❌ Invalid version
@@ -155,13 +171,7 @@ node .gitea/scripts/validate-pr.js "your-username" "plugins/your-plugin.json"
```
❌ plugins/example-plugin.json: Thumbnail validation failed: Thumbnail dimensions 1024x768 exceed 512x512
```
**Fix**: Resize your thumbnail to 512×512 or smaller
## Example Valid Plugin JSON
```json
{
"id": "example-plugin",
**Fix**: litruv-example-plugin",
"name": "Example Plugin",
"version": "1.0.0",
"description": "An example plugin demonstrating the plugin system capabilities",
@@ -173,6 +183,14 @@ node .gitea/scripts/validate-pr.js "your-username" "plugins/your-plugin.json"
}
```
Filename: `litruv-example-plugin.json"author": "litruv",
"repository": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example.git",
"thumbnail": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example/raw/branch/main/thumbnail.png",
"homepage": "http://synbox.ruv.wtf:8418/litruv/Plugin-Example",
"tags": ["example", "demo"]
}
```
## Security Note
**Never include sensitive information in plugin JSON files.** These files are public and will be served to all plugin host users. Do not include: