Programmatically enabling GoodCloud

Programmatically enabling GoodCloud

Prior to firmware version 4.7.0 it was possible to enable GoodCloud and then bind the device manually from GoodCloud.xyz as long as you have the appropriate details (ID, S/N, MAC)

You can also enable this programmatically, eg.

curl -s http://127.0.0.1/rpc -H 'glinet: 1' -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "call",
  "params": ["", "cloud", "set_config", { "cloud_enable": true, "url": "https://www.goodcloud.xyz" }]
}'

Upon enabling the config file would look like

config cloud
	option log 'INFO'
	option server 'gslb-eu.goodcloud.xyz'
	option token '<valid-token-here>'
	option enable '1'

However since updating to 4.7.0 when GoodCloud is enabled the config file looks like

config cloud
	option log 'INFO'
	option enable '1'
	option server 'gslb-eu.goodcloud.xyz'
	option token 'invalid'

Note that the token is never set, attempting to add the device via GoodCloud.xyz fails.

Interestingly if i use the new flow and login via the router the device is bound as expected, if i then unbind the token remains and I'm able to manually bind the device okay via GoodCloud.xyz

Is it possible i'm missing some extra config or service which will allow the local GoodCloud service to acquire a valid token as it did before?

If the router is bound before v4.7.0, and upgrade v4.7.0 and later new firmware without "keep settings", the token will appear illegal when the router logging into the cloud platform again, as the unique device certificate will be generated after the platform is bound, and the 4.7.0 certificate authentication are changes.

  1. You need to log in to the GL GUI and unbind before you can run the API command to enable the cloud platform function.

  2. Do not reset/upgrade firmware after binding.