Files
VPS-scripts_Web-V2/Docs/docs/Dev-Adding-Modules.md

60 lines
2.4 KiB
Markdown

# Module modes
A module can be external(in other/external git repo) or internal(SubModules/<ModuleName>).
In both cases the file structure is expected as shown below
# List of possible Files and expected Structure
* conf.sh
* preconf.sh
* generic.pkg.list
* apt.pkg.list
* dnf.pkg.list
* `<webserver>`-conf.sh
* `<webserver>`-preconf.sh
* `<Webserver>`-generic.pkg.list
* `<Webserver>`-apt.pkg.list
* `<Webserver>`-dnf.pkg.list
* config/*
## The internal module location
SubModules/`<ModuleName>`
# File Explanation
| File Name | Description |
| -------- | ------------ |
| preconf.sh | Pre config/apt install commands runs for all web servers |
| conf.sh| Configuration runs for all webservers |
| generic.pkg.list | packagelist for this webserver and php for all distro's |
| apt.pkg.list | packagelist for this webserver and php for distro's that use apt |
| dnf.pkg.list | packagelist for this webserver and php for distro's that use dnf/yum |
| `<Webserver>`-preconf.sh | Pre config/apt install commands runs for specified webserver |
| `<Webserver>`-conf.sh | Configuration runs for specified webserver |
| `<Webserver>`-generic.pkg.list | packagelist for specified webserver for all distro's|
| `<Webserver>`-apt.pkg.list | packagelist for specified webserver for distro's that use apt|
| `<Webserver>`-dnf.pkg.list | packagelist for specified webserver for distro's that use dnf/yum|
| config/* | Directory for config files |
# Defining in the menu
### Add the following to ModulesMenu.list
For each webserver a list define seperate.
### Rules for modulenames in menu for all modules
* a “:” needs to be appended
* the repo name must not contain capital leters
### Rules for modulenames in menu for external modules
* the name need a “/” pre and appended
Example internal module name: "mynicetest-module"
Example external module name: "/external-nice-module/"
### For Whiptail
add under the previous “<WebserverName>Options+”
make sure to add to all supported webservers
```
<WebserverName>Options+=("<ModuleName>:" "<Module Description>." OFF)
```
### For legacy
add to the “`<WebserverName>`Options” variable after the last entry
Make sure the the entry is quoted, otherwise the installer will break
### Extra step for external modules
For external modules the raw git url shoud be added to “extModules.list”
Example: https://git.ictmaatwerk.com/`<user>`/`<reponame>`/raw/branch/master/