mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 22:09:12 +02:00
Merge branch 'canary' of github.com:makeplane/plane-ee into preview
This commit is contained in:
@@ -86,9 +86,7 @@ class Command(BaseCommand):
|
||||
instance.latest_version = data.get(
|
||||
"latest_version", instance.latest_version
|
||||
)
|
||||
instance.current_version = data.get(
|
||||
"user_version", instance.current_version
|
||||
)
|
||||
instance.current_version = data.get("user_version", app_version)
|
||||
instance.edition = InstanceEdition.PLANE_COMMERCIAL.value
|
||||
instance.last_checked_at = timezone.now()
|
||||
instance.is_test = os.environ.get("IS_TEST", "0") == "1"
|
||||
|
||||
@@ -186,6 +186,10 @@ if [[ "$INSTALLATION_TYPE" == "Upgrade" ]] && [[ -f "$SETUP_DIR/plane.env.backup
|
||||
value=""
|
||||
fi
|
||||
|
||||
if [[ "$key" == "APP_RELEASE_VERSION" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# echo "$key=$value"
|
||||
update_env "$SETUP_DIR/plane.env" "$key" "$value"
|
||||
done < "$SETUP_DIR/plane.env.backup"
|
||||
|
||||
@@ -87,6 +87,63 @@ func RefreshLicense(ctx context.Context, api prime_api.IPrimeMonitorApi, license
|
||||
MembersList: workspaceMembers,
|
||||
})
|
||||
|
||||
if err != nil && api.IsAirgapped() {
|
||||
// If the license is airgapped, we need to create a new free license
|
||||
newLicense := &db.License{
|
||||
ID: license.ID,
|
||||
LicenseKey: license.LicenseKey,
|
||||
InstanceID: license.InstanceID,
|
||||
WorkspaceID: license.WorkspaceID,
|
||||
Product: "Plane Free",
|
||||
ProductType: "FREE",
|
||||
WorkspaceSlug: license.WorkspaceSlug,
|
||||
Seats: 0,
|
||||
FreeSeats: 12,
|
||||
Interval: "MONTHLY",
|
||||
IsOfflinePayment: false,
|
||||
IsCancelled: false,
|
||||
Subscription: "",
|
||||
CurrentPeriodEndDate: nil,
|
||||
TrialEndDate: nil,
|
||||
HasAddedPaymentMethod: false,
|
||||
HasActivatedFreeTrial: false,
|
||||
LastVerifiedAt: license.LastVerifiedAt,
|
||||
LastPaymentFailedDate: nil,
|
||||
LastPaymentFailedCount: 0,
|
||||
}
|
||||
|
||||
// Update the license in the database
|
||||
// Update the existing license with the new data present
|
||||
if err := tx.Delete(&license).Error; err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if err := tx.Create(newLicense).Error; err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
// Delete the existing members
|
||||
if err := tx.Where("license_id = ?", license.ID).Delete(&db.UserLicense{}).Error; err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// Delete the existing flags
|
||||
if err := tx.Where("license_id = ?", license.ID).Delete(&db.Flags{}).Error; err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return newLicense, &prime_api.WorkspaceActivationResponse{
|
||||
Product: "Plane Free",
|
||||
ProductType: "FREE",
|
||||
WorkspaceSlug: license.WorkspaceSlug,
|
||||
Seats: 0,
|
||||
FreeSeats: 12,
|
||||
Interval: "MONTHLY",
|
||||
IsOfflinePayment: false,
|
||||
IsCancelled: false,
|
||||
MemberList: []prime_api.WorkspaceMember{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
verificationThreshhold := LICENSE_VERIFICATION_FAILED_THRESHOLD
|
||||
|
||||
shouldDeactivate := false
|
||||
|
||||
Reference in New Issue
Block a user