-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd1caa2
commit 9cd9832
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generating Modules with pfsensible-generate-module | ||
|
||
The process of writing basic pfsensible modules is hopefully greately simplified by using | ||
the pfsensible-generate-module script. The basic workflow is as follows: | ||
|
||
* Navigate in the pfSense web interface to the area you want to write a module for. This should be a page where you can edit | ||
settings or one where you are adding an item. | ||
* Copy the URL of the page - you will pass it to the --url option of the script. | ||
|
||
## Modules that manage multiple items | ||
|
||
If this is a module that will allow you to create multiple items (e.g. aliases, rules): | ||
* Save a minimal item with a name (often Name or Description) of "item_min" (or something else if that does not work). | ||
Simply try immediately saving an item with just that name, then fill out fields one at a time and re-save until pfSense | ||
stops complaining about missing items. | ||
* Save a "fully" configured item with a name of "item_full" (or something else if that will not work). It may be | ||
helpful to change as many options away from the default as possible. Focus on settings that would be useful to you. | ||
* Run the script: | ||
|
||
misc/pfsensible-generate-module --url URL | ||
|
||
if you needed to use different names for the items than "item_min" and "item_full" you can set them with the --item-min and | ||
--item-full options. | ||
|
||
## Modules that configure something | ||
|
||
If this is a module that will just configure something, add the --is-config option. | ||
|
||
## Other options | ||
|
||
* Pass the --author-name, --author-email, and --author-handle options. | ||
* You will need to add the --user and/or --password options if you have changed from the install defaults. | ||
* If the automatically determined module name does not seem correct, you can change it with the --module-name option. | ||
* It may make sense to create a module for different types of items if the parameters are wildly different (as is the case | ||
with the different types of authentication servers for example). If so, add the --type-suffix option to add the "type" | ||
of the item as a suffix to the module name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters