Files
VPS-scripts_Web-V2/Docs/docs/Dev-Adding-Modules.md
2020-04-29 11:03:05 +02:00

52 lines
1.9 KiB
Markdown

# Module modes
A module can be external(in other/external git repo) or internal(Modules/<ModuleName>).
In both cases the file structure is expected as shown below
# List of possible Files and expected Structure
* conf.sh
* preconf.sh
* apt.list
* `<webserver>`-conf.sh
* `<webserver>`-preconf.sh
* `<webserver>`-apt.list
* config/*
## The internal module location
Modules/`<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 |
| apt.list | packagelist for all webservers |
| `<Webserver>`-preconf.sh | Pre config/apt install commands runs for specified webserver |
| `<Webserver>`-conf.sh | Configuration runs for specified webserver |
| `<Webserver>`-apt.list | packagelist for specified webserver |
| 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/