mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
[INFRA-192] fix: update file handling in airgapped mode to include app version in filenames #3439
This commit is contained in:
@@ -120,7 +120,7 @@ Downloads the workspace activation file from the server and returns the response
|
||||
*/
|
||||
func (a *AirgappedPrimeApi) SyncWorkspace(payload WorkspaceSyncPayload) (*WorkspaceActivationResponse, *APIError) {
|
||||
// Step 1: Read the file from the local system
|
||||
fileContent, err := os.ReadFile(payload.WorkspaceID + ".json")
|
||||
fileContent, err := os.ReadFile(fmt.Sprintf("%s_%s.json", payload.WorkspaceID, a.AppVersion()))
|
||||
if err != nil {
|
||||
return nil, &APIError{
|
||||
Error: fmt.Sprintf("Failed to read activation file: %v", err),
|
||||
@@ -281,7 +281,10 @@ if the deactivation is successfull, it will proceed to delete the license from t
|
||||
func (a *AirgappedPrimeApi) DeactivateLicense(payload LicenseDeactivatePayload) (*WorkspaceActivationResponse, *APIError) {
|
||||
|
||||
// Delete the license file from the local system
|
||||
os.Remove(payload.WorkspaceID + ".json")
|
||||
err := os.Remove(fmt.Sprintf("%s_%s.json", payload.WorkspaceID, a.AppVersion()))
|
||||
if err != nil {
|
||||
fmt.Println("Failed to delete license file", err)
|
||||
}
|
||||
|
||||
response := GetMockWorkspaceActivationResponse(payload, true)
|
||||
return response, nil
|
||||
|
||||
@@ -75,8 +75,8 @@ func GetAirgappedActivationHandler(api prime_api.IPrimeMonitorApi, key string) f
|
||||
})
|
||||
}
|
||||
|
||||
// Create filename using workspaceId
|
||||
filename := fmt.Sprintf("%s.json", workspaceId)
|
||||
// Create filename using workspaceId and app version
|
||||
filename := fmt.Sprintf("%s_%s.json", workspaceId, api.AppVersion())
|
||||
|
||||
// Write content to file
|
||||
err = os.WriteFile(filename, content, 0644)
|
||||
|
||||
Reference in New Issue
Block a user