Fixed: IP switch configuration made IPV6 aware
Fixed: Message raised when public shared ip address is not configured when creating or switching to a site with a shared ip adddres and dns enabled.
This commit is contained in:
parent
eef516fbd4
commit
343539c25e
4 changed files with 55 additions and 19 deletions
|
@ -115,6 +115,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608;
|
public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608;
|
||||||
public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609;
|
public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609;
|
||||||
public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610;
|
public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610;
|
||||||
|
public const int ERROR_PUBLICSHAREDIP_FOR_SHAREDIP = -611;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Mail
|
#region Mail
|
||||||
|
|
|
@ -172,15 +172,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true);
|
return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Regex regIP = new Regex(
|
|
||||||
@"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25"
|
private static bool IsValidIPAdddress(string addr)
|
||||||
+ @"[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?"
|
{
|
||||||
+ @"<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)",
|
System.Net.IPAddress ip;
|
||||||
RegexOptions.IgnoreCase
|
if (System.Net.IPAddress.TryParse(addr, out ip))
|
||||||
| RegexOptions.CultureInvariant
|
{
|
||||||
| RegexOptions.IgnorePatternWhitespace
|
return ((ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) |
|
||||||
| RegexOptions.Compiled
|
(ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork));
|
||||||
);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId,
|
public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId,
|
||||||
bool addInstantAlias, bool ignoreGlobalDNSRecords)
|
bool addInstantAlias, bool ignoreGlobalDNSRecords)
|
||||||
|
@ -274,10 +279,19 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(d.ExternalIP))
|
if (!string.IsNullOrEmpty(d.ExternalIP))
|
||||||
{
|
{
|
||||||
if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (domain.ZoneItemId > 0)
|
||||||
|
{
|
||||||
|
StringDictionary settings = ServerController.GetServiceSettings(serviceId);
|
||||||
|
if (string.IsNullOrEmpty(settings["PublicSharedIP"]))
|
||||||
|
return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// prepare site bindings
|
// prepare site bindings
|
||||||
List<ServerBinding> bindings = new List<ServerBinding>();
|
List<ServerBinding> bindings = new List<ServerBinding>();
|
||||||
|
@ -681,7 +695,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(d.ExternalIP))
|
if (!string.IsNullOrEmpty(d.ExternalIP))
|
||||||
{
|
{
|
||||||
if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,6 +853,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (siteItem == null)
|
if (siteItem == null)
|
||||||
return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;
|
return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// place log record
|
// place log record
|
||||||
TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name);
|
TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name);
|
||||||
TaskManager.ItemId = siteItemId;
|
TaskManager.ItemId = siteItemId;
|
||||||
|
@ -853,6 +869,15 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
if (ZoneInfo == null)
|
if (ZoneInfo == null)
|
||||||
throw new Exception("Parent zone not found");
|
throw new Exception("Parent zone not found");
|
||||||
|
|
||||||
|
|
||||||
|
if (ZoneInfo.ZoneItemId > 0)
|
||||||
|
{
|
||||||
|
StringDictionary settings = ServerController.GetServiceSettings(siteItem.ServiceId);
|
||||||
|
if (string.IsNullOrEmpty(settings["PublicSharedIP"]))
|
||||||
|
return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//cleanup certificates
|
//cleanup certificates
|
||||||
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
|
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
|
||||||
foreach (SSLCertificate c in certificates)
|
foreach (SSLCertificate c in certificates)
|
||||||
|
|
|
@ -5,12 +5,19 @@
|
||||||
</configSections>
|
</configSections>
|
||||||
<!-- Connection strings -->
|
<!-- Connection strings -->
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="EnterpriseServer" connectionString="Server=(local)\SQLExpress;Database=WebsitePanel;uid=sa;pwd=Password12" providerName="System.Data.SqlClient" />
|
<!--
|
||||||
|
<add name="EnterpriseServer" connectionString="server=HSTPROV01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=aj7ep6fyhmw3b5qeth7c;" />
|
||||||
|
<add name="EnterpriseServer" connectionString="server=HSTWSP01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=pserxfbnlc6hwmdedbp0;" providerName="System.Data.SqlClient" />
|
||||||
|
-->
|
||||||
|
<add name="EnterpriseServer" connectionString="server=HSTPROV01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=aj7ep6fyhmw3b5qeth7c;" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<!-- Encryption util settings -->
|
|
||||||
<add key="WebsitePanel.CryptoKey" value="1234567890" />
|
|
||||||
<!-- A1D4KDHUE83NKHddF -->
|
<!-- A1D4KDHUE83NKHddF -->
|
||||||
|
<!--
|
||||||
|
<add key="WebsitePanel.CryptoKey" value="3x7eqt7zabc5n5afs6dg" />
|
||||||
|
<add key="WebsitePanel.CryptoKey" value="fr2ym4wn2gmbrj7dz336" />
|
||||||
|
-->
|
||||||
|
<add key="WebsitePanel.CryptoKey" value="3x7eqt7zabc5n5afs6dg" />
|
||||||
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
<add key="WebsitePanel.EncryptionEnabled" value="true" />
|
||||||
<!-- Web Applications -->
|
<!-- Web Applications -->
|
||||||
<add key="WebsitePanel.EnterpriseServer.WebApplicationsPath" value="~/WebApplications" />
|
<add key="WebsitePanel.EnterpriseServer.WebApplicationsPath" value="~/WebApplications" />
|
||||||
|
|
|
@ -1059,6 +1059,9 @@
|
||||||
<data name="Error.610" xml:space="preserve">
|
<data name="Error.610" xml:space="preserve">
|
||||||
<value>Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator</value>
|
<value>Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Error.611" xml:space="preserve">
|
||||||
|
<value>Invalid public shared ip address in platform server configuration for shared IP address usage. Contact you platform administrator</value>
|
||||||
|
</data>
|
||||||
<data name="Error.700" xml:space="preserve">
|
<data name="Error.700" xml:space="preserve">
|
||||||
<value>Specified mail domain already exists on the service</value>
|
<value>Specified mail domain already exists on the service</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue