unRAID installs plugins from an HTTP server, so in order to install your locally-modified version you'll need some way to serve the files over HTTP. There is no HTTP server included with this distribution, but several popular development environments include an easy way to launch one.
- NodeJS. This is the one I use. Just run
npx http-server
in the top level of the plugin repo (the directory that contains this file). This will serve the files athttp://[your ip address]:8080/
. - Python (3+). This is untested, but it should work. Run
python -m http.server 8080
and the files will (should) be available athttp://[your ip address]:8080/
.
Open up gow.plg
and change the gitPkgURL
entity to point to http://[your ip address]:8080
. Be sure to use the IP address of the system you're doing the dev work on; this may not necessarily be your unRAID server. It should not end with a trailing slash. Also change the gitReleaseURL
entity to http://[your ip address]:8080/package-dist
. It should likewise have no trailing slash.
The majority of the functionality of this plugin is implemented in various "packages" (see the packages/
directory); this provides a convenient mechanism to break the work down into manageable chunks with a standardized way of installing, uninstalling, reloading after reboot, etc.
Installing and uninstalling packages is managed by the preinstall.sh
, install.sh
, and uninstall.sh
scripts. Any time you modify one of these, you'll need to update the MD5 and SHA256 hashes in gow.plg
. The SHA256 hash takes precedence if both exist, but the MD5 hash is left in for older versions of unRAID. (TODO: it's possible we don't need these anymore)
Now it's time to try installing your development version of the plugin. Open a terminal on your unRAID server and uninstall the old version of GoW (if you have one installed), then install the new version:
$ plugin remove gow.plg
$ plugin install http://[your ip address]:8080/gow.plg
- Create a new directory under
packages/
, let's saypackages/new-pkg
. - In
packages/new-pkg
, add a file calledroot/install/slack-desc
. It's easiest to copy an existing one and modify it. - Build any directory structure you like under
root/
. Any files you add will be automatically installed in their corresponding places under/
when the plugin is installed or reloaded after reboot. - If your new package needs to perform any actions on start or stop, add a shell script in
root/boot/config/plugins/gow/scripts/start/new-pkg.sh
orroot/boot/config/plugins/gow/scripts/stop/new-pkg.sh
.start
corresponds to when the plugin is installed or reloaded after reboot, whilestop
is when the plugin is uninstalled.
Packages are built using the utils/fmakepkg.sh
script. For the purposes of these steps, we'll assume the name of the package you're building is your-pkg
.
- Make a directory at the top level called
package-dist
to hold packages while you're working on them. cd
topackages/your-pkg/root
.- Run
../../../utils/fmakepkg.sh ../../../package-dist/your-pkg.txz
. cd
to../../../package-dist
.- Generate
your-pkg.txz.md5
andyour-pkg.txz.sha256
. - Uninstall and reinstall the plugin as above to pick up the new package.