mirror of
https://github.com/bitwarden/server.git
synced 2025-04-22 05:25:10 -05:00
new uri settings
This commit is contained in:
parent
5deccf122a
commit
ee9d8a074d
@ -178,9 +178,9 @@ namespace Bit.Api
|
|||||||
{
|
{
|
||||||
var options = new IdentityServerAuthenticationOptions
|
var options = new IdentityServerAuthenticationOptions
|
||||||
{
|
{
|
||||||
Authority = globalSettings.BaseIdentityUri,
|
Authority = globalSettings.BaseServiceUri.InternalIdentity,
|
||||||
AllowedScopes = new string[] { "api" },
|
AllowedScopes = new string[] { "api" },
|
||||||
RequireHttpsMetadata = !env.IsDevelopment(),
|
RequireHttpsMetadata = false && !env.IsDevelopment(),
|
||||||
ApiName = "api",
|
ApiName = "api",
|
||||||
NameClaimType = ClaimTypes.Email,
|
NameClaimType = ClaimTypes.Email,
|
||||||
// Suffix until we retire the old jwt schemes.
|
// Suffix until we retire the old jwt schemes.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://preview-vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://preview-api.bitwarden.com",
|
"vault": "https://preview-vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://preview-identity.bitwarden.com",
|
"api": "https://preview-api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://preview-identity.bitwarden.com",
|
||||||
"appId": "https://preview-vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://preview-identity.bitwarden.com"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://api.bitwarden.com",
|
"vault": "https://vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://identity.bitwarden.com",
|
"api": "https://api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://identity.bitwarden.com",
|
||||||
"appId": "https://vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://identity.bitwarden.com"
|
||||||
},
|
},
|
||||||
"braintree": {
|
"braintree": {
|
||||||
"production": true
|
"production": true
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://api.bitwarden.com",
|
"vault": "https://vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://identity.bitwarden.com",
|
"api": "https://api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://identity.bitwarden.com",
|
||||||
"appId": "https://vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://identity.bitwarden.com"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"selfHosted": false,
|
"selfHosted": false,
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "http://localhost:4000",
|
"vault": "http://localhost:4001",
|
||||||
"baseIdentityUri": "http://localhost:33656",
|
"api": "http://localhost:4000",
|
||||||
|
"identity": "http://localhost:33656",
|
||||||
|
"identityInternal": "http://localhost:33656"
|
||||||
|
},
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
@ -41,9 +44,6 @@
|
|||||||
"duo": {
|
"duo": {
|
||||||
"aKey": "SECRET"
|
"aKey": "SECRET"
|
||||||
},
|
},
|
||||||
"u2f": {
|
|
||||||
"appId": "https://localhost:4001/app-id.json"
|
|
||||||
},
|
|
||||||
"braintree": {
|
"braintree": {
|
||||||
"production": false,
|
"production": false,
|
||||||
"merchantId": "SECRET",
|
"merchantId": "SECRET",
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://api.bitwarden.com",
|
"vault": "https://vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://identity.bitwarden.com",
|
"api": "https://api.bitwarden.com",
|
||||||
|
"identity": "https://identity.bitwarden.com",
|
||||||
|
"identityInternal": "https://identity.bitwarden.com"
|
||||||
|
},
|
||||||
"braintree": {
|
"braintree": {
|
||||||
"production": true
|
"production": true
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"selfHosted": false,
|
"selfHosted": false,
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "http://localhost:4000",
|
"vault": "http://localhost:4001",
|
||||||
"baseIdentityUri": "http://localhost:33656",
|
"api": "http://localhost:4000",
|
||||||
|
"identity": "http://localhost:33656",
|
||||||
|
"identityInternal": "http://localhost:33656"
|
||||||
|
},
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
|
@ -4,10 +4,8 @@
|
|||||||
{
|
{
|
||||||
public bool SelfHosted { get; set; }
|
public bool SelfHosted { get; set; }
|
||||||
public virtual string SiteName { get; set; }
|
public virtual string SiteName { get; set; }
|
||||||
public virtual string BaseVaultUri { get; set; }
|
|
||||||
public virtual string BaseApiUri { get; set; }
|
|
||||||
public virtual string BaseIdentityUri { get; set; }
|
|
||||||
public virtual string StripeApiKey { get; set; }
|
public virtual string StripeApiKey { get; set; }
|
||||||
|
public virtual BaseServiceUriSettings BaseServiceUri { get; set; } = new BaseServiceUriSettings();
|
||||||
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
||||||
public virtual MailSettings Mail { get; set; } = new MailSettings();
|
public virtual MailSettings Mail { get; set; } = new MailSettings();
|
||||||
public virtual StorageSettings Storage { get; set; } = new StorageSettings();
|
public virtual StorageSettings Storage { get; set; } = new StorageSettings();
|
||||||
@ -18,9 +16,16 @@
|
|||||||
public virtual NotificationHubSettings NotificationHub { get; set; } = new NotificationHubSettings();
|
public virtual NotificationHubSettings NotificationHub { get; set; } = new NotificationHubSettings();
|
||||||
public virtual YubicoSettings Yubico { get; set; } = new YubicoSettings();
|
public virtual YubicoSettings Yubico { get; set; } = new YubicoSettings();
|
||||||
public virtual DuoSettings Duo { get; set; } = new DuoSettings();
|
public virtual DuoSettings Duo { get; set; } = new DuoSettings();
|
||||||
public virtual U2fSettings U2f { get; set; } = new U2fSettings();
|
|
||||||
public virtual BraintreeSettings Braintree { get; set; } = new BraintreeSettings();
|
public virtual BraintreeSettings Braintree { get; set; } = new BraintreeSettings();
|
||||||
|
|
||||||
|
public class BaseServiceUriSettings
|
||||||
|
{
|
||||||
|
public string Vault { get; set; }
|
||||||
|
public string Api { get; set; }
|
||||||
|
public string Identity { get; set; }
|
||||||
|
public string InternalIdentity { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class SqlServerSettings
|
public class SqlServerSettings
|
||||||
{
|
{
|
||||||
public string ConnectionString { get; set; }
|
public string ConnectionString { get; set; }
|
||||||
@ -86,11 +91,6 @@
|
|||||||
public string AKey { get; set; }
|
public string AKey { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class U2fSettings
|
|
||||||
{
|
|
||||||
public string AppId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BraintreeSettings
|
public class BraintreeSettings
|
||||||
{
|
{
|
||||||
public bool Production { get; set; }
|
public bool Production { get; set; }
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
using System;
|
namespace Bit.Core.Models.Mail
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Bit.Core.Models.Mail
|
|
||||||
{
|
{
|
||||||
public class BaseMailModel
|
public class BaseMailModel
|
||||||
{
|
{
|
||||||
|
private string _webVaultUrl;
|
||||||
|
|
||||||
public string SiteName { get; set; }
|
public string SiteName { get; set; }
|
||||||
public string WebVaultUrl { get; set; }
|
public string WebVaultUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _webVaultUrl;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_webVaultUrl = string.Concat(value, "/#");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
Token = WebUtility.UrlEncode(token),
|
Token = WebUtility.UrlEncode(token),
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("VerifyEmail", model);
|
message.HtmlContent = _engine.Parse("VerifyEmail", model);
|
||||||
@ -54,7 +54,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
FromEmail = fromEmail,
|
FromEmail = fromEmail,
|
||||||
ToEmail = toEmail,
|
ToEmail = toEmail,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("ChangeEmailAlreadyExists", model);
|
message.HtmlContent = _engine.Parse("ChangeEmailAlreadyExists", model);
|
||||||
@ -68,7 +68,7 @@ namespace Bit.Core.Services
|
|||||||
var model = new EmailTokenViewModel
|
var model = new EmailTokenViewModel
|
||||||
{
|
{
|
||||||
Token = token,
|
Token = token,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("ChangeEmail", model);
|
message.HtmlContent = _engine.Parse("ChangeEmail", model);
|
||||||
@ -84,7 +84,7 @@ namespace Bit.Core.Services
|
|||||||
var model = new EmailTokenViewModel
|
var model = new EmailTokenViewModel
|
||||||
{
|
{
|
||||||
Token = token,
|
Token = token,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("TwoFactorEmail", model);
|
message.HtmlContent = _engine.Parse("TwoFactorEmail", model);
|
||||||
@ -100,7 +100,7 @@ namespace Bit.Core.Services
|
|||||||
var model = new MasterPasswordHintViewModel
|
var model = new MasterPasswordHintViewModel
|
||||||
{
|
{
|
||||||
Hint = hint,
|
Hint = hint,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("MasterPasswordHint", model);
|
message.HtmlContent = _engine.Parse("MasterPasswordHint", model);
|
||||||
@ -113,7 +113,7 @@ namespace Bit.Core.Services
|
|||||||
var message = CreateDefaultMessage("Your Master Password Hint", email);
|
var message = CreateDefaultMessage("Your Master Password Hint", email);
|
||||||
var model = new BaseMailModel
|
var model = new BaseMailModel
|
||||||
{
|
{
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("NoMasterPasswordHint", model);
|
message.HtmlContent = _engine.Parse("NoMasterPasswordHint", model);
|
||||||
@ -129,7 +129,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
OrganizationName = organizationName,
|
OrganizationName = organizationName,
|
||||||
UserEmail = userEmail,
|
UserEmail = userEmail,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("OrganizationUserInvited", model);
|
message.HtmlContent = _engine.Parse("OrganizationUserInvited", model);
|
||||||
@ -143,7 +143,7 @@ namespace Bit.Core.Services
|
|||||||
var model = new OrganizationUserConfirmedViewModel
|
var model = new OrganizationUserConfirmedViewModel
|
||||||
{
|
{
|
||||||
OrganizationName = organizationName,
|
OrganizationName = organizationName,
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("OrganizationUserConfirmed", model);
|
message.HtmlContent = _engine.Parse("OrganizationUserConfirmed", model);
|
||||||
@ -162,7 +162,7 @@ namespace Bit.Core.Services
|
|||||||
OrganizationUserId = orgUser.Id.ToString(),
|
OrganizationUserId = orgUser.Id.ToString(),
|
||||||
Token = token,
|
Token = token,
|
||||||
OrganizationNameUrlEncoded = WebUtility.UrlEncode(organizationName),
|
OrganizationNameUrlEncoded = WebUtility.UrlEncode(organizationName),
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("OrganizationUserInvited", model);
|
message.HtmlContent = _engine.Parse("OrganizationUserInvited", model);
|
||||||
@ -175,7 +175,7 @@ namespace Bit.Core.Services
|
|||||||
var message = CreateDefaultMessage("Welcome", user.Email);
|
var message = CreateDefaultMessage("Welcome", user.Email);
|
||||||
var model = new BaseMailModel
|
var model = new BaseMailModel
|
||||||
{
|
{
|
||||||
WebVaultUrl = _globalSettings.BaseVaultUri,
|
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||||
SiteName = _globalSettings.SiteName
|
SiteName = _globalSettings.SiteName
|
||||||
};
|
};
|
||||||
message.HtmlContent = _engine.Parse("Welcome", model);
|
message.HtmlContent = _engine.Parse("Welcome", model);
|
||||||
|
@ -196,7 +196,7 @@ namespace Bit.Core.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddSubstitution(message, "{{siteName}}", _globalSettings.SiteName);
|
AddSubstitution(message, "{{siteName}}", _globalSettings.SiteName);
|
||||||
AddSubstitution(message, "{{baseVaultUri}}", _globalSettings.BaseVaultUri);
|
AddSubstitution(message, "{{baseVaultUri}}", string.Concat(_globalSettings.BaseServiceUri.Vault, "/#"));
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ namespace Bit.Core.Utilities
|
|||||||
|
|
||||||
public static string U2fAppIdUrl(GlobalSettings globalSettings)
|
public static string U2fAppIdUrl(GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
return globalSettings.U2f.AppId;
|
return string.Concat(globalSettings.BaseServiceUri.Vault, "/app-id.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string RandomString(int length, bool alpha = true, bool upper = true, bool lower = true,
|
public static string RandomString(int length, bool alpha = true, bool upper = true, bool lower = true,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://preview-vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://preview-api.bitwarden.com",
|
"vault": "https://preview-vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://preview-identity.bitwarden.com",
|
"api": "https://preview-api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://preview-identity.bitwarden.com",
|
||||||
"appId": "https://preview-vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://preview-identity.bitwarden.com"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://api.bitwarden.com",
|
"vault": "https://vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://identity.bitwarden.com",
|
"api": "https://api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://identity.bitwarden.com",
|
||||||
"appId": "https://vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://identity.bitwarden.com"
|
||||||
},
|
},
|
||||||
"braintree": {
|
"braintree": {
|
||||||
"production": true
|
"production": true
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"baseVaultUri": "https://vault.bitwarden.com/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "https://api.bitwarden.com",
|
"vault": "https://vault.bitwarden.com",
|
||||||
"baseIdentityUri": "https://identity.bitwarden.com",
|
"api": "https://api.bitwarden.com",
|
||||||
"u2f": {
|
"identity": "https://identity.bitwarden.com",
|
||||||
"appId": "https://vault.bitwarden.com/app-id.json"
|
"identityInternal": "https://identity.bitwarden.com"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"selfHosted": false,
|
"selfHosted": false,
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseServiceUri": {
|
||||||
"baseApiUri": "http://localhost:4000",
|
"vault": "http://localhost:4001",
|
||||||
"baseIdentityUri": "http://localhost:33656",
|
"api": "http://localhost:4000",
|
||||||
|
"identity": "http://localhost:33656",
|
||||||
|
"identityInternal": "http://localhost:33656"
|
||||||
|
},
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
"connectionString": "SECRET"
|
"connectionString": "SECRET"
|
||||||
@ -37,9 +40,6 @@
|
|||||||
"duo": {
|
"duo": {
|
||||||
"aKey": "SECRET"
|
"aKey": "SECRET"
|
||||||
},
|
},
|
||||||
"u2f": {
|
|
||||||
"appId": "https://localhost:4001/app-id.json"
|
|
||||||
},
|
|
||||||
"braintree": {
|
"braintree": {
|
||||||
"production": false,
|
"production": false,
|
||||||
"merchantId": "SECRET",
|
"merchantId": "SECRET",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user