As I noted in another thread, I’m working on updating my deploy-freenas script to use the new websocket API. The current script performs the following operations:
- Import the specified cert using the API
- Set the UI to use the new cert
- Optionally, set other services to use that cert
- Optionally, set apps to use that cert
- Delete old certs
I’m having a little trouble figuring out the “set apps to use that cert” piece. I can, I think, iterate through the installed apps to determine which ones currently have a cert assigned. I’m assuming it’d take some sort of invocation of app.update
with the app name and the numeric cert ID–but I can’t find any indication in the API docs of what that would look like; I don’t see any mention in the docs for the app.update
endpoint of a certificate.
Here’s what I have to ascertain whether an installed app has a cert in the first place. Any suggestions on how to specify a new cert for the app?
if APPS_ENABLED==True:
apps = c.call("app.query")
for app in apps:
config = app.config(app["id"])
if config('ix_certificates') != None:
# Update config to use new cert
ChatGPT’s answer involved a chart.release.update
endpoint, which I’m 99% sure is unique to the Kubernetes-based app ecosystem.