Skip to content

Commit

Permalink
Add appsettings (deploy azure)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoang Nguyen Nhat committed Mar 31, 2022
1 parent eadb895 commit e8eb23a
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ public override async Task<ActionResult<PaginationModel<ReadViewModel>>> Get()
bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate);
bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate);
string keyword = Request.Query[MixRequestQueryKeywords.Keyword];
string createdBy = _mixIdentityHelper.GetClaim(User, MixClaims.Username);
Expression<Func<MixPage, bool>> predicate = model =>
model.Specificulture == _lang
&& (User.IsInRole(MixDefaultRoles.SuperAdmin) || model.CreatedBy == User.Claims.FirstOrDefault(c => c.Type == "Username").Value)
&& (User.IsInRole(MixDefaultRoles.SuperAdmin) || User.IsInRole(MixDefaultRoles.Admin) || model.CreatedBy == createdBy)
&& (!isStatus || model.Status == status)
&& (!isFromDate || model.CreatedDateTime >= fromDate)
&& (!isToDate || model.CreatedDateTime <= toDate)
Expand Down
2 changes: 1 addition & 1 deletion src/Mix.Cms.Api/Controllers/v1/ApiAccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ public async Task<ActionResult<RepositoryResponse<AccessTokenViewModel>>> Regist
[HttpPost]
public async Task<RepositoryResponse<bool>> ManageUserInRole([FromBody] UserRoleModel model)
{
var role = await _roleManager.FindByIdAsync(model.RoleId);
var result = new RepositoryResponse<bool>();

var role = await _roleManager.FindByIdAsync(model.RoleId);
List<string> errors = new List<string>();

if (role == null)
Expand Down
180 changes: 180 additions & 0 deletions src/Mix.Cms.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"ConnectionStrings": {
"MixAccountConnection": null,
"MixCmsConnection": null,
"MixMessengerConnection": null
},
"GlobalSettings": {
"IsInit": true,
"InitStatus": 0,
"IsMaintenance": false,
"IsRewrite": true,
"IsHttps": false,
"IsCache": true,
"ResponseCache": 5,
"IsRegistration": true,
"MaxPageSize": 100,
"ImageSize": 2000,
"DefaultAvatar": "/mix-app/assets/img/user.png",
"DefaultCulture": "en-us",
"DefaultTemplate": "_Blank",
"DefaultTemplateContent": "<div></div>",
"DefaultTheme": "Default_Blank",
"DefaultContentStatus": "Published",
"DefaultBlankTemplateFolder": "Themes/Default_Blank",
"DefaultTemplateFolder": "Themes/Default",
"DefaultTemplateLayout": "_Layout",
"DefaultPostAttr": "[]",
"SortBy": "Priority",
"SortDirection": "Asc",
"Language": "en-us",
"UploadFolder": "Content/Uploads",
"ThemeId": "1",
"Domain": "",
"TemplateExtension": ".cshtml",
"TagPageSize": "20",
"SearchPageSize": "20",
"IsEncryptApi": true,
"ApiEncryptKey": "RHZhMEFvckY0VUF3Ynd2YUZZTnRIdz09LGx3dk82QlR0WHlPUG5FWC8rUFV2bU1pdUpIMnVQTEF5TW9kMFpPdU5aMlU9",
"LastUpdateConfiguration": null,
"DatabaseProvider": "SQLITE",
"AllowedHosts": [],
"Smtp": {
"Server": "",
"Port": 587,
"SSL": true,
"User": "",
"Password": "",
"From": "[email protected]",
"FromName": "mix-core"
},
"PortalThemeSettings": {
"primaryColorHue": 90,
"primaryColorSaturation": 35,
"primaryColorBrightness": 50,
"bgColor": "#fbfbfb",
"textColor": "#404040",
"primaryColor": "#47c5d1",
"bgColorHover": "#d1e0de",
"borderColor": "#d1e0de",
"borderColorHover": "#e0e4e7",
"linkColor": "#47c5d1",
"linkColorHover": "#404040",
"linkColorActive": "#404040",
"textColorHover": "#008b8b",
"fontFamily": "",
"fontSizeH1": "16",
"fontSize": "12"
}
},

"MixConfigurations": {
"IsCache": true,
"MixCacheMode": "Json",
"MixCacheConnectionString": "",
"MixCacheDbProvider": "",
"MixCacheFolder": "MixContent/cache",
"JsonDataFolder": "MixContent/data",
"MixLogsFolder": "MixContent/logs",
"ImageSizes": {
"XXS": {
"width": 30
},
"XS": {
"width": 100
},
"S": {
"width": 300
},
"M": {
"width": 600
},
"L": {
"width": 1000
},
"XL": {
"width": 2000
}
}
},
"Authentication": {
"AccessTokenExpiration": 20,
"RefreshTokenExpiration": 120,
"ValidateIssuer": false,
"ValidateAudience": false,
"ValidateLifetime": true,
"ValidateIssuerSigningKey": true,
"TokenType": "Bearer",
"Audience": "mix-core",
"SecretKey": "mixcore-secret-key",
"Issuer": "mix-core",
"Issuers": "mix-core",
"Audiences": "mix-core",
"Facebook": {
"AppId": "",
"AppSecret": ""
},
"Google": {
"AppId": "",
"AppSecret": ""
},
"Twitter": {
"AppId": "",
"AppSecret": ""
},
"Microsoft": {
"AppId": "",
"AppSecret": ""
}
},
"IpSecuritySettings": {
"IsRetrictIp": true,
"AllowedPortalIps": [],
"AllowedIps": [],
"ExceptIps": []
},
"Cloudflare": {
"ApiToken": "",
"ApiKey": {
"GlobalKey": "",
"OriginKey": ""
}
},
"Translator": {},
"LocalSettings": {
"en-us": {
"ContactAddress": "",
"ContactEmail": "",
"ContactPhone": "",
"Facebook": "",
"FacebookAppId": "",
"Favicon": "",
"LanguageVersion": "1",
"Logo": "",
"SettingVersion": "1",
"Theme": "Default",
"ThemeId": "1"
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"JWTSettings": {
"SecretKey": "sw-cms-secret-key",
"Issuer": "sw-cms",
"Audience": "sw-client"
},
"Language": "en-us",
"EPPlus": {
"ExcelPackage": {
"LicenseContext": "NonCommercial" //The license context used
}
},
"Quartz": {
"quartz.scheduler.instanceName": "Mixcore Cms Scheduler"
}
}

0 comments on commit e8eb23a

Please sign in to comment.