THIS INFORMATION IS OUTDATED
This section explains the basics for creating a new functionality that will show up in nextcloudpi-config and
See also how to use the development environment.
Anatomy of a ncp-app
An ncp configuration option, such as
nc-datadir, is defined by a single bash .sh file in
In order to be launched from the web interface, it needs a permission mask 660 and ownership root:www-data
chown -R root:www-data /usr/local/etc/ncp-config.d chmod 660 /usr/local/etc/ncp-config.d/*
It needs to define two functions called
configure(), and optionally another one called
- The install() function is called during the build process and also during
ncp-updateif it hasn’t been installed before.
- The configure() function is called when
- The cleanup() function is only called at the end of the image building process, to leave the system as clean as possible after installation. Optional.
“Fields” that will show up in
ncp-web and nextcloudpi-config for the user to modify are only bash variables with a special name. If a variable ends in underscore
_, then it will be modifiable by the user. The original value will be left as a suggestion or default.
For instance, the top of the ‘nc-backup-auto’ option shows the following variables
ACTIVE_=yes DESTDIR_=/media/USBdrive INCLUDEDATA_=yes BACKUPDAYS_=7 BACKUPLIMIT_=4 DESCRIPTION="Periodic backups"
And looks like this
There’s some fields fields that have a special behavior
DESCRIPTIONis used to show a little explanation in the webUI or TUI and is a mandatory field.
ACTIVE_will show a ✓ next to the option when it has the value
INFOwill display the contents of this string in the interface. Used to provide some additional information such as warnings and instructions. Optional.
INFOTITLEheader for the
INFObox. Defaults to “Info” if it is not provided. Optional.
Also, any field that reads
no will be displayed as a checkbox in the web interface.
Please, check for style and common mistakes by running shellcheck on your script before submitting.
shellcheck -s bash myscript.sh