You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plg-file.md
+42-9Lines changed: 42 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,13 @@ nav_order: 3
12
12
13
13
The `.plg` file is the heart of every Unraid plugin. It's an XML document that tells the plugin system how to install, update, and remove your plugin.
14
14
15
+
{: .warning }
16
+
> Attribute case matters in practice. Use the documented attribute names exactly.
17
+
>
18
+
> - Top-level `<PLUGIN>` attributes such as `min` and `max` are lowercase.
19
+
> -`<FILE>` attributes are mixed-case in the current plugin manager implementation, for example `Name`, `Run`, `Method`, `Mode`, `Type`, `Min`, and `Max`.
20
+
> - In particular, `<FILE ... Max="6.12.99">` works, while lowercase `<FILE ... max="6.12.99">` may be ignored.
21
+
15
22
## Basic Structure
16
23
17
24
```xml
@@ -97,8 +104,8 @@ The `<PLUGIN>` tag supports these attributes:
97
104
|`support`| URL to support thread for the plugin (Unraid 6.6+; shown in Plugins page). |
98
105
|`project`| Project home page (usually GitHub). |
99
106
|`readme`| README URL or path for plugin details display. |
100
-
|`min`| Minimum Unraid version required (e.g., `"6.9.0"`). |
101
-
|`max`| Maximum Unraid version supported. |
107
+
|`min`| Minimum Unraid version required on the top-level `<PLUGIN>` tag (e.g., `"6.9.0"`). |
108
+
|`max`| Maximum Unraid version supported on the top-level `<PLUGIN>` tag. |
102
109
103
110
> ### Compatibility notes
104
111
>
@@ -131,6 +138,13 @@ This is displayed in the Plugin Manager when viewing plugin details.
131
138
132
139
`<FILE>` elements define files to download, create, or run scripts.
133
140
141
+
The plugin manager processes `<FILE>` elements in document order.
142
+
143
+
- A `<FILE>` block with `<URL>` downloads to the target `Name` path.
144
+
- A later `<FILE>` block with `<LOCAL>` copies from an already-existing local path.
145
+
-`<LOCAL>` is just a filesystem copy. It does not fetch a URL by itself.
146
+
- If the destination file already exists, the plugin manager skips recreating it unless a supplied checksum fails, in which case the old file is removed and the block is retried.
147
+
134
148
### Download a File
135
149
136
150
```xml
@@ -144,6 +158,17 @@ This is displayed in the Plugin Manager when viewing plugin details.
144
158
145
159
Unraid supports both SHA256 and MD5 for file verification:
146
160
161
+
Behavior in the current plugin manager implementation:
162
+
163
+
-`SHA256` takes precedence over `MD5` when both are present on the same `<FILE>` block.
164
+
- If the destination file already exists, the plugin manager checks `SHA256` or `MD5` before deciding whether to skip the block.
165
+
- If the existing file hash matches, the block is skipped.
166
+
- If the existing file hash does not match, the existing file is removed and the block is retried.
167
+
- For `<FILE>` blocks with `<URL>`, the downloaded file is verified again after download, and installation aborts if the checksum is wrong.
168
+
- For `<FILE>` blocks using `<LOCAL>` or `<INLINE>`, the checksum mainly controls whether an existing destination is reused or removed first. There is no second post-create checksum verification step for a newly created local or inline file.
169
+
170
+
Use `SHA256` and `MD5` exactly as shown here. These element names are case-sensitive in practice.
<!-- Only processed on Unraid 6.12.x and below -->
222
-
<FILERun="/bin/bash"max="6.12.99">
247
+
<FILERun="/bin/bash"Max="6.12.99">
223
248
<INLINE>
224
249
echo "Legacy compatibility step"
225
250
</INLINE>
@@ -244,6 +269,14 @@ The `<LOCAL>` element copies a previously downloaded file:
244
269
245
270
This caches files on the USB flash so they don't need to be re-downloaded on each boot.
246
271
272
+
Important details:
273
+
274
+
- The source path referenced by `<LOCAL>` must already exist when that `<FILE>` block runs.
275
+
- The destination file is skipped if it already exists, unless you supplied a checksum and the checksum mismatch causes the destination to be removed first.
276
+
- If you add `SHA256` or `MD5` to a `<LOCAL>` block, it helps invalidate a stale destination file, but it does not add a second post-copy verification pass.
277
+
- For simple static assets this pattern works well.
278
+
- For more complex fallback flows, an explicit shell script that checks for a cached file, downloads it if missing, and then copies or extracts it can be easier to reason about than chaining multiple `<FILE>` blocks.
279
+
247
280
### Embedding Base64 Content
248
281
249
282
For small files like icons, you can embed them directly in the PLG file using base64 encoding:
@@ -523,7 +556,7 @@ If your plugin installs shared dependencies like `perl`, `python`, or `java` pac
523
556
524
557
Define version, URLs, and paths as entities so you only update them in one place.
525
558
526
-
### 3. Always Include Integrity Checksums
559
+
### 5. Always Include Integrity Checksums
527
560
528
561
This ensures file integrity and helps with caching. Use SHA256 for new plugins:
0 commit comments