Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - linucksrox

#1
Thanks for that! Your script is very similar to my script, which essentially does the curl command with the same options, except I'm using port 443 and not 8443. I tried with a new API key/secret from the root account to rule out permission issues, but still I get "Endpoint not found" when trying that curl command.
/usr/bin/curl -s -k -u $KEY:$SECRET https://192.168.0.1:443/api/backup/backup/download                                   
{"errorMessage":"Endpoint not found"}

Is there a configuration somewhere (or a plugin) that is required for this to work? I'm starting to get the impression my instance might be misconfigured, but I'm not sure how.
#2
I have a backup script which was running `curl -s -k -u $KEY:$SECRET https://$HOST/api/backup/backup -o opnsense-config-$(/bin/date +%Y%m%d).xml` and now since I upgraded to 25.1 it returns Endpoint not found. According to the current docs, I see that the API endpoint should now be `https://$HOST/api/core/backup/download` but that still returns Endpoint not found. Digging a bit deeper, it appears that `host` might be a required parameter but it's unclear whether that is true, or what the value should be set to. I just use the IP 192.168.0.1 to access OPNSense. Trying a few guess and check options such as `https://$HOST/api/core/backup/download/192.168.0.1` returns nothing. So does `https://$HOST/api/core/backup/download/nonsense` so I don't know how to determine what the value of host should be if it's even needed.

I tried dev tools and clicked download in the UI to see what the network request looks like, but it appears to be calling diag_backup.php instead of the API, so I'm at a loss. Any suggestions?