Closed roperzh closed 1 year ago
Fleet version: 4.27.x
When a host is enrolled into MDM, we assign the correct server URL for Fleet's MDM solution.
The URL is incomplete, causing the app to think that there are two different MDM solutions.
Note that one is https://dogfood.fleetdm.com(wrong URL) and the other https://dogfood.fleetdm.com/apple/mdm (correct URL)
https://dogfood.fleetdm.com
https://dogfood.fleetdm.com/apple/mdm
When a new host is enrolled into MDM we call this function:
https://github.com/fleetdm/fleet/blob/ad5229ddfa30e498f179d75ddc6f3613e74fa9bd/server/datastore/mysql/apple_mdm.go#L643
However, all the callers use AppConfig.ServerSettings.ServerURL as the serverURL parameter, so we should be using this helper in upsertMDMAppleHostMDMInfoDB
AppConfig.ServerSettings.ServerURL
serverURL
upsertMDMAppleHostMDMInfoDB
https://github.com/fleetdm/fleet/blob/ad5229ddfa30e498f179d75ddc6f3613e74fa9bd/server/mdm/apple/apple_mdm.go#L43-L45
Clouds of ease, Fixing wrong URL bliss, Fleet's MDM smiles.
Fleet version: 4.27.x
🧑💻 Expected behavior
When a host is enrolled into MDM, we assign the correct server URL for Fleet's MDM solution.
💥 Actual behavior
The URL is incomplete, causing the app to think that there are two different MDM solutions.
Note that one is
https://dogfood.fleetdm.com
(wrong URL) and the otherhttps://dogfood.fleetdm.com/apple/mdm
(correct URL)More info
When a new host is enrolled into MDM we call this function:
https://github.com/fleetdm/fleet/blob/ad5229ddfa30e498f179d75ddc6f3613e74fa9bd/server/datastore/mysql/apple_mdm.go#L643
However, all the callers use
AppConfig.ServerSettings.ServerURL
as theserverURL
parameter, so we should be using this helper inupsertMDMAppleHostMDMInfoDB
https://github.com/fleetdm/fleet/blob/ad5229ddfa30e498f179d75ddc6f3613e74fa9bd/server/mdm/apple/apple_mdm.go#L43-L45