# Using AutoPkgr with FileWave for Advanced macOS Software Deployment

## What this integration does

AutoPkg automates macOS software packaging from community or organization-maintained recipes. The FileWave importer can turn a successful recipe run into a Fileset for testing and deployment.

Use FileWave's **[Integrated AutoPkg](https://kb.filewave.com/books/integrations/page/autopkg-filewave-integrated-v155 "Integrated AutoPkg (v15.5+)")** workflow for the simpler built-in path. Use the standalone AutoPkg and AutoPkgr workflow below when you need its scheduling, recipe-repository, override, and trust-management controls.

## Ingredients

- FileWave Central and a dedicated FileWave administrator account for the importer
- Current AutoPkg and AutoPkgr installers
- A dedicated Mac that remains available for scheduled recipe runs

## Directions

Complementing the below setup, there is also a Foundry presentation about this and, additional configuration and typical stumbling blocks: [FileWave and AutoPkg](https://foundry.filewave.com/course/view.php?id=16#section-11)

### Setup FileWave

- Go to FileWave Admin -&gt; Assistants -&gt; Manage Administrators

![lG1mRWHlm9Fy4ugr-embedded-image-12xgqzjj.png](https://kb.filewave.com/uploads/images/gallery/2023-07/lG1mRWHlm9Fy4ugr-embedded-image-12xgqzjj.png)

- Click on the + button to add a new Administrator  
    Select **Local Account**, give the importer a dedicated username, and generate a unique password
- Go to Permissions tab and click on Select None
- Allow the autopkg user to 'Modify Filesets' and 'Set Permissions' as per the above screenshot.
- Click Apply
- Confirm with OK

### Setup AutoPkgr

- Go to [https://github.com/lindegroup/autopkgr/releases/latest](https://github.com/lindegroup/autopkgr/releases/latest)
- Download, install and launch AutoPkgr
- Launch AutoPkgr, Click on "Install AutoPkg" , and "Install Git"

![jhHpOGWDTVMnwE47-embedded-image-qxfa9ywm.png](https://kb.filewave.com/uploads/images/gallery/2023-07/jhHpOGWDTVMnwE47-embedded-image-qxfa9ywm.png)

- Go to Folders &amp; Integration and click on Install FileWaveImporter:

![iBhNoPaEA9UTjRTC-embedded-image-kgwixjud.png](https://kb.filewave.com/uploads/images/gallery/2023-07/iBhNoPaEA9UTjRTC-embedded-image-kgwixjud.png)

- Click on Configure FileWaveImporter:

![SpmbsEtfYVAZv6zT-embedded-image-m5jcx2pi.png](https://kb.filewave.com/uploads/images/gallery/2023-07/SpmbsEtfYVAZv6zT-embedded-image-m5jcx2pi.png)

- Enter your FileWave Server Hostname

![8ahAlVJpNt2ceIMu-embedded-image-ibkalvix.png](https://kb.filewave.com/uploads/images/gallery/2023-07/8ahAlVJpNt2ceIMu-embedded-image-ibkalvix.png)

- - FileWave Server Port is already set to 20016
    - Enter the dedicated importer username
    - Enter its unique password
    - Click on Verify to validate the setup
- Click on Save and Close
- Go to Repos &amp; Recipes and verify that [https://github.com/autopkg/recipes.git](https://github.com/autopkg/recipes.git) and [https://github.com/autopkg/filewave.git](https://github.com/autopkg/filewave.git) are checked  
    ![S2GxWdgSc712TnmN-embedded-image-dvigwnst.png](https://kb.filewave.com/uploads/images/gallery/2023-07/S2GxWdgSc712TnmN-embedded-image-dvigwnst.png)![FITABVICZE8o3Qy7-embedded-image-oadwcwql.png](https://kb.filewave.com/uploads/images/gallery/2023-07/FITABVICZE8o3Qy7-embedded-image-oadwcwql.png)
- Make sure that 'Active recipe list' has added com.github.autopkg.filewave:

![NkJyyyFr2Ex6JIZF-embedded-image-gtl8h4xv.png](https://kb.filewave.com/uploads/images/gallery/2023-07/NkJyyyFr2Ex6JIZF-embedded-image-gtl8h4xv.png)

- Select a current FileWave recipe that matches software you use. The screenshot uses the historical Java 8 recipe only to show where FileWave recipes appear in AutoPkgr.

![rrCfZfMeIAuPD6sx-embedded-image-namahxei.png](https://kb.filewave.com/uploads/images/gallery/2023-07/rrCfZfMeIAuPD6sx-embedded-image-namahxei.png)

<p class="callout danger">**Security and Trust Relationship** Running recipes directly from a cloned repo will bypass AutoPkg's security mechanism. As such an Override recipe should always be created and run. This builds a local recipe with a trust relationship between this and any linked 'parent' recipes, see below. For additional information on Override recipes and more, please view the Foundry video: [FileWave and AutoPkg](https://foundry.filewave.com/mod/scorm/view.php?id=304)</p>

- Congratulations ! Your AutoPkgr setup is now complete. Choose the recipes you would like to run on a regular basis , and then schedule AutoPkgr to run every 24 hours.

![OPDTTmHgYGSyMGly-embedded-image-hqxzerk5.png](https://kb.filewave.com/uploads/images/gallery/2023-07/OPDTTmHgYGSyMGly-embedded-image-hqxzerk5.png)

<p class="callout info">**Recipe Updates** On occasion recipes that were working will fail to run. Typically this is because something has changed regarding the 3rd party's website or download. This will require the author of the relevant recipe to update their recipe to implement this change. In this instance of failed recipes, check for recipe updates 'Update Recipes Now'. For any updated recipe, changes should be observed and then the trust relationship will need to be updated too; see below.  
Override recipes can additionally customise the Fileset, Fileset groups, etc.</p>

### Override Recipes &amp; Trust Relationship

For security, a trust relationship was added between recipes. The idea is the child recipe is made to trust it's parent recipes. If an updated version of a parent recipe is pulled from a repository, then this parent will no longer be trusted by that child, until the trust relationship is manually updated. AutoPkgr does not offer the ability to change trust and so this must be done via the command line.

With no trust, when a recipe is run that relies on parent recipes you will see an error similar when running the recipe from Terminal:

```shell
$ autopkg run -v OracleJava8.filewave.local
Processing OracleJava8.filewave.local...
Failed local trust verification.
Receipt written to /tmp/receipts/OracleJava8.filewave-receipt-20180409-141621.plist
 
The following recipes failed:
    OracleJava8.filewave.local
        No trust information present.
 
Nothing downloaded, packaged or imported.
```

In this example, Creating a Recipe Override will create a recipe that has trust added for us. Using the above Java8 example, first make an Override recipe. The Override recipe and initial trust can be created in either AutoPkgr or using the command line. The Java 8 override recipe will be called "Java8.filewave.override". The last entry is reference to the parent recipe to be overridden (this can be either be recipe name or it's identifier, recipe name used in this example):

```shell
$ autopkg make-override -n Java8.filewave.override Java8.filewave
```

By making the override file in this way, the trust relationship has been added automatically to the Override recipe. Now there is a trust relationship, the override file can be used to run the recipe (either through Terminal or AutoPkgr):

```shell
$ autopkg run -v OracleJava8.filewave.override
Processing OracleJava8.filewave.override...
 
 
[lines removed]
 
 
The following fileset was imported:
    Fw Fileset Id  Fw Fileset Group  Fw Fileset Name   
 
    -------------  ----------------  ---------------   
    194266         Root              Java - 1.8.161.12 
 
The following packages were copied:
    Pkg Path                                                                            
 
    --------                                                                            
    /Users/Shared/Autopkg/Cache/local.override.filewave.OracleJava8/Java-1.8.161.12.pkg 
 
The following new items were downloaded:
    Download Path                                                                      
 
    -------------                                                                      
    /Users/Shared/Autopkg/Cache/local.override.filewave.OracleJava8/downloads/Java.dmg
```

If after updating repos, the trust relationship error is flagged against any recipes, this indicates that a parent has been updated and trust is no longer in place. At this point, the parent should be reviewed to observe the changes made. Changes to a recipe can easily be viewed by navigating to the relevant recipe on GitHub and viewing the 'History'.

Once confirmation has been made that the changes are acceptable, a new trust relationship should be created. As an override file already exits, the trust will need to be updated for the Java 8 override recipe; as such re-trusting all parents:

```shell
$ autopkg update-trust-info Java8.filewave.override
```

Although it is possible to disable trust relationship, this should not be recommended for security reasons. Current status can be seen by running the following and checking the value of 'FAIL\_RECIPES\_WITHOUT\_TRUST\_INFO':

```shell
$ autopkg info
```

It is possible to temporarily override the trust relationship, such that it is ignored:

```shell
$ autopkg run --ignore-parent-trust-verification-errors [name of recipe]
```

### Important

<p class="callout danger">**Review before deployment.**  
Inspect recipe changes before allowing AutoPkg to import them into FileWave. Test every created Fileset on representative Macs before expanding the Deployment.</p>

## Related Content

- [Integrated AutoPkg (v15.5+)](https://kb.filewave.com/books/integrations/page/autopkg-filewave-integrated-v155 "Integrated AutoPkg (v15.5+)")
- [Autopkg(r) FAIL\_RECIPES\_WITHOUT\_TRUST\_INFO](https://kb.filewave.com/books/integrations/page/autopkgr-fail-recipes-without-trust-info "Autopkg(r) FAIL_RECIPES_WITHOUT_TRUST_INFO")
- FileWave &amp; AutoPkg Instructions - [https://github.com/autopkg/filewave](https://github.com/autopkg/filewave)
- The primary site for AutoPkg - [http://autopkg.github.io/autopkg](http://autopkg.github.io/autopkg)
- Github Site for AutoPkg - [https://github.com/autopkg/autopkg](https://github.com/autopkg/autopkg)
- AutoPkgr website - [http://www.lindegroup.com/autopkgr](http://www.lindegroup.com/autopkgr)
- AutoPkg Trust - [https://github.com/autopkg/autopkg/wiki/AutoPkg-and-recipe-parent-trust-info](https://github.com/autopkg/autopkg/wiki/AutoPkg-and-recipe-parent-trust-info)