Skip to content

Commit 55bfdc4

Browse files
committed
feat: add customization tool
1 parent 572b02d commit 55bfdc4

4 files changed

Lines changed: 88 additions & 67 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
._.DS_Store
33
.php-cs-fixer.cache
4-
vendor
4+
vendor
5+
unraid-plugin-customizer

README.md

Lines changed: 71 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -24,76 +24,22 @@ A simple template to help you create your own Unraid plugin, even if you're new
2424

2525
### ✏️ Step 2: Customize Your Plugin
2626

27-
Follow the customization guide below to make this template your own.
27+
2. Customize the template:
28+
- **Option A: Automated**
29+
- Run the `customize.sh` script to download and run the customization tool:
30+
```sh
31+
./customize.sh
32+
```
33+
- **Option B: Manual**
34+
- Follow the customization guide below to customize the template files yourself.
2835

29-
### 🚀 Step 3: Test and Release
36+
### ⚙️ Step 3: Enable GitHub Actions
3037

31-
Once you've made your changes, you can test your plugin and release it for others to use.
32-
33-
---
34-
35-
## Customizing Your Plugin
36-
37-
🛠️ **Customization Steps**
38-
39-
Now that you have your own copy of the template, you need to customize it for your specific plugin. Here are the essential files to modify:
40-
41-
### 1. Basic Plugin Information
42-
43-
📄 **File: `plugin/plugin.json`**
44-
This file contains your plugin's basic information that Unraid uses. You must update these fields:
45-
46-
- **name**: This becomes the filename for your .plg file. It's not the name users see, but the internal name for your plugin.
47-
- **package_name**: The internal package name. This is used by Slackware to identify your plugin. Recommendation: use `unraid-pluginname` (replace `pluginname` with your plugin's name) to avoid conflicts with upstream packages.
48-
- **author**: Your name or organization
49-
- **support**: URL where users can get help (typically a thread on the Unraid forums)
50-
- **launch**: Either update with your plugin's page path or remove if your plugin doesn't have a web interface
51-
- **icon**: Either use a Font Awesome 4.7.0 icon name, or remove this field and provide your own icon at `src/usr/local/emhttp/plugins/plugin-name/name.png` (where "name" matches the name field)
52-
53-
📄 **File: `README.md` (this file)**
54-
Replace this template content with information about your plugin. This appears on your GitHub page and helps users understand what your plugin does.
55-
56-
### 2. Plugin Description (What Users See During Installation)
57-
58-
📝 **File: `src/install/slack-desc`**
59-
This is what users see when your plugin is being installed. Think of it as a brief advertisement for your plugin.
60-
61-
**Important rules:**
62-
63-
- Keep exactly 11 lines of description (plus the ruler line at the top)
64-
- Replace `my-plugin` with your package name (from `plugin.json`)
65-
- Adjust the handy ruler line (the line of dashes) so it lines up with the colon after your package name - this shows the maximum length for each description line
66-
67-
### 3. Plugin Interface Files
68-
69-
📁 **Folder: `src/usr/local/emhttp/plugins/plugin-name`**
70-
71-
- Rename this folder to match your plugin's name from `plugin.json`
72-
- This folder contains the web interface files that appear in Unraid's web UI
73-
74-
📄 **File: `src/usr/local/emhttp/plugins/plugin-name/README.md`**
75-
Update this with your plugin's name and what it does. This appears on Unraid's Plugins page.
76-
77-
### 4. Optional: Diagnostic Information
78-
79-
🩺 **File: `src/usr/local/emhttp/plugins/plugin-name/diagnostics.json.example`**
80-
This helps with troubleshooting your plugin. You can:
81-
82-
- Rename it to `diagnostics.json` to enable custom diagnostic checks
83-
- Update the content to include your plugin's name and specific diagnostic checks
84-
- For detailed information on the diagnostics format, see: https://github.com/dkaser/unraid-plugin-diagnostics
85-
- Leave it as `.example` if you don't need custom diagnostics
86-
87-
### 5. Legal Stuff
88-
89-
⚖️ **File: `LICENSE`**
90-
The template uses "Unlicense" (public domain) so you can choose any license you want for your project. You can change this to any license you prefer. You should always include a license file in your repository to clarify how others can use your code.
91-
92-
### 6. Enable GitHub Actions (Required)
38+
In your GitHub repository settings, make sure "Actions" are enabled. This is **required** for the release workflow to automatically build your plugin packages when you create releases. Without this, users won't be able to install your plugin.
9339
94-
⚙️ **GitHub Actions**
40+
### 🚀 Step 4: Test and Release
9541
96-
In your GitHub repository settings, make sure "Actions" are enabled. This is **required** for the release workflow to automatically build your plugin packages when you create releases. Without this, users won't be able to install your plugin.
42+
Once you've made your changes, you can test your plugin and release it for others to use.
9743

9844
---
9945

@@ -180,3 +126,62 @@ While it is recommended to keep these tools enabled:
180126
- `phpstan.neon`: Bug detection settings
181127
- `.php-cs-fixer.dist.php`: Code formatting rules
182128
- `commitlint.config.js`: Commit message rules
129+
130+
---
131+
132+
## Customization Guide (Manual Method)
133+
134+
🛠️ **Customization Steps**
135+
136+
Now that you have your own copy of the template, you need to customize it for your specific plugin. Here are the essential files to modify:
137+
138+
### 1. Basic Plugin Information
139+
140+
📄 **File: `plugin/plugin.json`**
141+
This file contains your plugin's basic information that Unraid uses. You must update these fields:
142+
143+
- **name**: This becomes the filename for your .plg file. It's not the name users see, but the internal name for your plugin.
144+
- **package_name**: The internal package name. This is used by Slackware to identify your plugin. Recommendation: use `unraid-pluginname` (replace `pluginname` with your plugin's name) to avoid conflicts with upstream packages.
145+
- **author**: Your name or organization
146+
- **support**: URL where users can get help (typically a thread on the Unraid forums)
147+
- **launch**: Either update with your plugin's page path or remove if your plugin doesn't have a web interface
148+
- **icon**: Either use a Font Awesome 4.7.0 icon name, or remove this field and provide your own icon at `src/usr/local/emhttp/plugins/plugin-name/name.png` (where "name" matches the name field)
149+
150+
📄 **File: `README.md` (this file)**
151+
Replace this template content with information about your plugin. This appears on your GitHub page and helps users understand what your plugin does.
152+
153+
### 2. Plugin Description (What Users See During Installation)
154+
155+
📝 **File: `src/install/slack-desc`**
156+
This is what users see when your plugin is being installed. Think of it as a brief advertisement for your plugin.
157+
158+
**Important rules:**
159+
160+
- Keep exactly 11 lines of description (plus the ruler line at the top)
161+
- Replace `my-plugin` with your package name (from `plugin.json`)
162+
- Adjust the handy ruler line (the line of dashes) so it lines up with the colon after your package name - this shows the maximum length for each description line
163+
164+
### 3. Plugin Interface Files
165+
166+
📁 **Folder: `src/usr/local/emhttp/plugins/plugin-name`**
167+
168+
- Rename this folder to match your plugin's name from `plugin.json`
169+
- This folder contains the web interface files that appear in Unraid's web UI
170+
171+
📄 **File: `src/usr/local/emhttp/plugins/plugin-name/README.md`**
172+
Update this with your plugin's name and what it does. This appears on Unraid's Plugins page.
173+
174+
### 4. Optional: Diagnostic Information
175+
176+
🩺 **File: `src/usr/local/emhttp/plugins/plugin-name/diagnostics.json.example`**
177+
This helps with troubleshooting your plugin. You can:
178+
179+
- Rename it to `diagnostics.json` to enable custom diagnostic checks
180+
- Update the content to include your plugin's name and specific diagnostic checks
181+
- For detailed information on the diagnostics format, see: https://github.com/dkaser/unraid-plugin-diagnostics
182+
- Leave it as `.example` if you don't need custom diagnostics
183+
184+
### 5. Legal Stuff
185+
186+
⚖️ **File: `LICENSE`**
187+
The template uses "Unlicense" (public domain) so you can choose any license you want for your project. You can change this to any license you prefer. You should always include a license file in your repository to clarify how others can use your code.

composer.json

100755100644
File mode changed.

customize.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CUSTOMIZER_URL="https://github.com/dkaser/unraid-plugin-template-customizer/releases/download/v1.0.0/unraid-plugin-customizer"
6+
CUSTOMIZER_BIN="unraid-plugin-customizer"
7+
8+
# Download the customizer binary
9+
curl -L -o "$CUSTOMIZER_BIN" "$CUSTOMIZER_URL"
10+
11+
# Make it executable
12+
chmod +x "$CUSTOMIZER_BIN"
13+
14+
# Run the customizer
15+
./"$CUSTOMIZER_BIN"

0 commit comments

Comments
 (0)