Removed unused license for OUs

This commit is contained in:
Kenneth Skovhede
2026-02-16 20:46:44 +01:00
parent 086aa28731
commit 4c04ff64bd
4 changed files with 2 additions and 35 deletions
@@ -123,10 +123,6 @@ internal class MetaRootSourceEntry(SourceProvider provider, string parentPath, s
}
else if (type == SourceItemType.MetaRootOrganizationalUnits)
{
// OrganizationalUnits is a single file containing all OUs, so we check license once
if (!provider.LicenseApprovedForEntry(Path, GoogleRootType.OrganizationalUnits, "organizational_units"))
yield break;
yield return new OrganizationalUnitsSourceEntry(provider, this.Path);
}
}
@@ -40,10 +40,6 @@ public sealed class SourceProvider : ISourceProviderModule, IDisposable
/// The current number of sites that has been enumerated.
/// </summary>
private int _siteCount = 0;
/// <summary>
/// The current number of organizational units that has been enumerated.
/// </summary>
private int _organizationalUnitCount = 0;
/// <summary>
/// Whether a license warning has been issued for users.
@@ -61,10 +57,6 @@ public sealed class SourceProvider : ISourceProviderModule, IDisposable
/// Whether a license warning has been issued for sites.
/// </summary>
private int _siteLicenseWarningIssued = 0;
/// <summary>
/// Whether a license warning has been issued for organizational units.
/// </summary>
private int _organizationalUnitLicenseWarningIssued = 0;
/// <summary>
/// Whether this provider is being used for a restore operation.
@@ -264,17 +256,6 @@ public sealed class SourceProvider : ISourceProviderModule, IDisposable
return false;
}
}
else if (type == GoogleRootType.OrganizationalUnits)
{
var approved = LicenseChecker.LicenseHelper.AvailableGoogleWorkspaceOrganizationalUnitSeats;
var current = _organizationalUnitCount;
if (current >= approved)
{
if (Interlocked.Exchange(ref _organizationalUnitLicenseWarningIssued, 1) == 0)
Log.WriteWarningMessage(LOGTAG, "LicenseWarning", null, $"Licensed Google Workspace feature seats exceeded for {type} ({approved}). Some items will not be backed up.");
return false;
}
}
else
{
// Unknown type, allow it
@@ -291,8 +272,6 @@ public sealed class SourceProvider : ISourceProviderModule, IDisposable
Interlocked.Increment(ref _sharedDriveCount);
else if (type == GoogleRootType.Sites)
Interlocked.Increment(ref _siteCount);
else if (type == GoogleRootType.OrganizationalUnits)
Interlocked.Increment(ref _organizationalUnitCount);
}
return true;
@@ -42,9 +42,4 @@ public static class DuplicatiLicenseFeatures
/// The feature indicating support for Google Workspace site backups
/// </summary>
public const string GoogleWorkspaceSites = "duplicati:googleworkspace:sites";
/// <summary>
/// The feature indicating support for Google Workspace organizational unit backups
/// </summary>
public const string GoogleWorkspaceOrganizationalUnits = "duplicati:googleworkspace:organizationalunits";
}
+2 -5
View File
@@ -17,7 +17,6 @@ public static class LicenseHelper
public static int AvailableGoogleWorkspaceGroupSeats => GetFeatureSeats(DuplicatiLicenseFeatures.GoogleWorkspaceGroups);
public static int AvailableGoogleWorkspaceSharedDriveSeats => GetFeatureSeats(DuplicatiLicenseFeatures.GoogleWorkspaceSharedDrives);
public static int AvailableGoogleWorkspaceSiteSeats => GetFeatureSeats(DuplicatiLicenseFeatures.GoogleWorkspaceSites);
public static int AvailableGoogleWorkspaceOrganizationalUnitSeats => GetFeatureSeats(DuplicatiLicenseFeatures.GoogleWorkspaceOrganizationalUnits);
public static bool IsOffice365Enabled =>
AvailableOffice365UserSeats > 0 ||
@@ -28,8 +27,7 @@ public static class LicenseHelper
AvailableGoogleWorkspaceUserSeats > 0 ||
AvailableGoogleWorkspaceGroupSeats > 0 ||
AvailableGoogleWorkspaceSharedDriveSeats > 0 ||
AvailableGoogleWorkspaceSiteSeats > 0 ||
AvailableGoogleWorkspaceOrganizationalUnitSeats > 0;
AvailableGoogleWorkspaceSiteSeats > 0;
private static Dictionary<string, int> UnlicensedSeats = new Dictionary<string, int>
{
@@ -39,8 +37,7 @@ public static class LicenseHelper
{ DuplicatiLicenseFeatures.GoogleWorkspaceUsers, 5 },
{ DuplicatiLicenseFeatures.GoogleWorkspaceGroups, 5 },
{ DuplicatiLicenseFeatures.GoogleWorkspaceSharedDrives, 5 },
{ DuplicatiLicenseFeatures.GoogleWorkspaceSites, 5 },
{ DuplicatiLicenseFeatures.GoogleWorkspaceOrganizationalUnits, 5 },
{ DuplicatiLicenseFeatures.GoogleWorkspaceSites, 5 }
};
private static int GetDefaultSeats(string feature)