I have created a first nextcloud backend: GitHub - engsas/nextcloud-sfos-mdm: Nextcloud backend for Sailfish OS MDM app
The GUI is still broken, but the API is working for the MDM SysInfo scope. The endpoints are:
- GET index.php/apps/sailfishmdm/api/0.1/sysinfos: Getting all sysinfo datasets
- POST index.php/apps/sailfishmdm/api/0.1/sysinfos: Creating new sysinfo dataset
- PUT index.php/apps/sailfishmdm/api/0.1/sysinfos/{ID}: Update an existing sysinfo dataset
- DELETE index.php/apps/sailfishmdm/api/0.1/sysinfos/{ID}: Delete existing sysinfo dataset
For PUT and POST requests the sysinfo dataset needs to be the payload. It should look like this (just a copy of the MDM content):
{
"bluetoothMacAddress": "BluetoothMacAddress",
"deviceModel": "Test Model",
"deviceUid": "Test Device Uid",
"manufacturer": "Test Manufacturer",
"productName": "Test Product Name",
"softwareVersion": "Test Software Version",
"softwareVersionId": "Test Software Version ID",
"wlanMacAddress": "Test WLAN Mac Address"
}
With this curl commands you can test the API running in the standard nextcloud docker development environment (just copy the whole sailfishmdm folder from the git repo into workspace/server/apps-extra):
curl -i -X POST -H 'Content-Type: application/json' -d '{"bluetoothMacAddress": "BluetoothMacAddress", "deviceModel": "Test Model", "deviceUid": "Test Device Uid", "manufacturer": "Test Manufacturer", "productName": "Test Product Name", "softwareVersion": "Test Software Version", "softwareVersionId": "Test Software Version ID", "wlanMacAddress": "Test WLAN Mac Address" }' -u admin:admin http://nextcloud.local/index.php/apps/sailfishmdm/api/0.1/sysinfos
curl -u admin:admin http://nextcloud.local/index.php/apps/sailfishmdm/api/0.1/sysinfos
curl -i -X PUT -H 'Content-Type: application/json' -d '{"bluetoothMacAddress": "New BluetoothMacAddress", "deviceModel": "Test Model", "deviceUid": "Test Device Uid", "manufacturer": "Test Manufacturer", "productName": "Test Product Name", "softwareVersion": "Test Software Version", "softwareVersionId": "New Test Software Version ID", "wlanMacAddress": "Test WLAN Mac Address" }' -u admin:admin http://nextcloud.local/index.php/apps/sailfishmdm/api/0.1/sysinfos/1
curl -u admin:admin -X DELETE http://nextcloud.local/index.php/apps/sailfishmdm/api/0.1/sysinfos/1
Since Iām still waiting for SFOS on Xperia 10 V, I can not really develop the app part for Sailfish right now. But anyone who wants to start is warmly welcomed.
The idea is, to extend the nextcloud backend API step by step with a new set of endpoints for each MDM class.
Any suggestions and improvements are welcome!