Custom App Trains

Please support adding custom app trains to TrueNAS apps on 24.10+, like how custom trains for helm charts was supported before.

You mean 3rd party catalogues? With 24.10, you can just use your own custom compose yaml for pretty much any linux docker project that’s out there. Most, if not all, have compose or at least docker-run examples that you can use as well.

Yes, I am aware that I can run any compose yaml. I’d pike to have all of my apps git controlled, and effectively have the same user experience as the enterprise or the community train. Effectively a custom version of the community train that is pointed to a different repo.

Great timing, I just registered to ask this exact question. I also really want to deploy custom apps that are not based on just a compose yaml file, mostly because I want to run apps from the official catalog but with some small changes to allow me to use more of the features that Docker/compose have available.

In my stubborness to do this I found out that it’s possible to use the Websocket API to use a custom catalog, but this completely replaces the usage of the official app catalog. Also it is not permanent and gets overridden if you refresh the catalog from the UI, I think.

Having dug around in the TrueNAS code, it appears that the official catalog is hardcoded in and the backend doesn’t currently support multiple catalogs at all, which I hope they will address in a future version

What’s stopping you from running a custom app pulling from your own docker repository, managed by git?

Souce control the configs (GitOps), not the container images.

Could you link/document the places you saw it hardcoded and the WebSocket API you used please?

After Truecharts, I doubt iX is going to be willing to add extra catalogues.

Just put your compose into github, copy/paste into custom yaml app and done?

1 Like

Sure, internally TrueNAS does this with the catalog.sync endpoint in middlewared middlewared/plugins/catalog/sync.py

There you can see that it calls a bunch of other API endpoints in sequence, with catalog.update_git_repository being the most interesting one. It uses variables OFFICIAL_CATALOG_REPO and OFFICIAL_CATALOG_BRANCH that are defined in middlewared/plugins/catalog/utils.py

After some trial and error I’m currently using these midclt commands to make it use my own catalog (run from the system shell. I’m running these as root but it’s probably wiser to use another account). These are what catalog.sync calls but now done with midclt instead:

midclt call catalog.update_git_repository "/mnt/.ix-apps/truenas_catalog" "https://git.example.com/repository" "master"
midclt call catalog.get_feature_map false
midclt call catalog.retrieve_recommended_apps false
midclt call catalog.apps '{"cache": false, "cache_only": false, "retrieve_all_trains": true, "trains": []}'
midclt call app.check_upgrade_alerts

Where the repository URL is a mirror of the official truenas/apps github repo and /mnt/.ix-apps/truenas_catalog is the location returned from calling catalog.config, ie.

# midclt call catalog.config
{"label": "TRUENAS", "preferred_trains": ["community", "stable"], "id": "TRUENAS", "location": "/mnt/.ix-apps/truenas_catalog"}

I’m not sure if all of these calls are necessary but I’m running them all anyway.

So far the only things I’ve seen or can think of that will most likely wreck this process are whatever Refresh Catalog does in the UI and app.available calls that in turn ensure catalog.synced returns true, and if not will call catalog.sync but it’s tied to the SYNCED boolean variable in sync.py which I’m not sure ever gets set to false once set to true byt the official catalog syncing process.

I couldn’t put any links in the post so I used file paths instead, all the reference files can be found in the official truenas/middleware github repository.

2 Likes

I’m doing that for some apps as well but I kinda want to stick to the official apps where possible. My use case for all of this is that I want to add labels to containers because pretty much every reverse proxy container uses labels to route traffic and none of the official apps allow setting those through the installation

Being able to add labels is something they have worked on, it’s coming in a future update:

1 Like

Thanks for all the great info!

Or clone into your stacks dataset and use Dockge.