Browse Source

Small cleanups and fixes

tags/3.0.0^2
Teknikode 6 months ago
parent
commit
6865b5c5bc

+ 1
- 0
.gitignore View File

@@ -268,3 +268,4 @@ __pycache__/
**/tempkey.rsa
/ServiceWorker/Properties/launchSettings.json
/IdentityServer/App_Data/Config.json
/ServiceWorker/Output

IdentityServer/Properties/PublishProfiles/Teknik Identity Development.pubxml → IdentityServer/Properties/PublishProfiles/Teknik Identity - Development.pubxml View File


+ 27
- 0
IdentityServer/Properties/PublishProfiles/Teknik Identity - Production.pubxml View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://auth.teknik.io/</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ProjectGuid>eb46e1eb-fdc2-4168-a0ad-8b284d44b13e</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>
<MSDeployServiceURL>ams1.teknik.io</MSDeployServiceURL>
<DeployIisAppPath>TeknikIdentity</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>Administrator</UserName>
<_SavePWD>True</_SavePWD>
</PropertyGroup>
</Project>

+ 13
- 0
ServiceWorker/Properties/PublishProfiles/Teknik Service Worker.pubxml View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PublishDir>Output\</PublishDir>
</PropertyGroup>
</Project>

+ 4
- 4
Teknik/Areas/Error/Controllers/ErrorController.cs View File

@@ -61,7 +61,7 @@ namespace Teknik.Areas.Error.Controllers
{
Response.StatusCode = StatusCodes.Status401Unauthorized;

ViewBag.Title = "401";
ViewBag.Title = "Unauthorized";
ViewBag.Description = "Unauthorized";

LogError(LogLevel.Error, "Unauthorized");
@@ -77,7 +77,7 @@ namespace Teknik.Areas.Error.Controllers
{
Response.StatusCode = StatusCodes.Status403Forbidden;

ViewBag.Title = "403";
ViewBag.Title = "Access Denied";
ViewBag.Description = "Access Denied";

LogError(LogLevel.Error, "Access Denied");
@@ -93,7 +93,7 @@ namespace Teknik.Areas.Error.Controllers
{
Response.StatusCode = StatusCodes.Status404NotFound;

ViewBag.Title = "404";
ViewBag.Title = "Not Found";
ViewBag.Description = "Uh Oh, can't find it!";

LogError(LogLevel.Warning, "Page Not Found");
@@ -124,7 +124,7 @@ namespace Teknik.Areas.Error.Controllers

Response.StatusCode = StatusCodes.Status500InternalServerError;

ViewBag.Title = "500";
ViewBag.Title = "Server Error";
ViewBag.Description = "Something Borked";
LogError(LogLevel.Error, "Server Error", exception);

+ 8
- 0
Teknik/Areas/User/Controllers/UserController.cs View File

@@ -1210,6 +1210,10 @@ namespace Teknik.Areas.Users.Controllers
return Json(new { error = "You must enter an authorization callback URL" });
if (!callbackUrl.IsValidUrl())
return Json(new { error = "Invalid callback URL" });
if (!string.IsNullOrEmpty(homepageUrl) && !homepageUrl.IsValidUrl())
return Json(new { error = "Invalid homepage URL" });
if (!string.IsNullOrEmpty(logoUrl) && !logoUrl.IsValidUrl())
return Json(new { error = "Invalid logo URL" });

// Validate the code with the identity server
var result = await IdentityHelper.CreateClient(_config, User.Identity.Name, name, homepageUrl, logoUrl, callbackUrl, "openid", "role", "account-info", "security-info", "teknik-api.read", "teknik-api.write");
@@ -1271,6 +1275,10 @@ namespace Teknik.Areas.Users.Controllers
return Json(new { error = "You must enter an authorization callback URL" });
if (!callbackUrl.IsValidUrl())
return Json(new { error = "Invalid callback URL" });
if (!string.IsNullOrEmpty(homepageUrl) && !homepageUrl.IsValidUrl())
return Json(new { error = "Invalid homepage URL" });
if (!string.IsNullOrEmpty(logoUrl) && !logoUrl.IsValidUrl())
return Json(new { error = "Invalid logo URL" });

Client foundClient = await IdentityHelper.GetClient(_config, User.Identity.Name, clientId);


+ 1
- 1
Teknik/Areas/User/Utility/UserHelper.cs View File

@@ -678,7 +678,7 @@ If you recieved this email and you did not reset your password, you can ignore t
}
catch (Exception ex)
{
throw new Exception("Unable to disable email account.", ex);
throw new Exception("Unable to get email account status.", ex);
}
return false;
}

+ 2
- 1
Teknik/Areas/User/Views/User/ViewProfile.cshtml View File

@@ -1,6 +1,7 @@
@model Teknik.Areas.Users.ViewModels.ProfileViewModel

@using Teknik.Utilities.Cryptography
@using Teknik.Areas.Users.Utility

<div class="container">
@if (!Model.Error)
@@ -95,7 +96,7 @@
{
<li class="list-group-item text-right"><span class="pull-left"><strong>Public Key</strong></span> <a href="#" data-toggle="modal" data-target="#pgpSignature">@pgpFingerprint64.AddStringAtInterval(4, " ")</a></li>
}
@if (!string.IsNullOrEmpty(Model.Email) && Config.EmailConfig.Enabled)
@if (!string.IsNullOrEmpty(Model.Email) && Config.EmailConfig.Enabled && UserHelper.UserEmailEnabled(Config, Model.Email))
{
<li class="list-group-item text-right"><span class="pull-left"><strong>Email</strong></span> @(Html.Raw(User.Identity.IsAuthenticated ? $"<a href=\"mailto:{Model.Email}\">{Model.Email}</a>" : $"{Model.Username} at {Config.EmailConfig.Domain}"))</li>
}

Teknik/Properties/PublishProfiles/Teknik Development (AMS1).pubxml → Teknik/Properties/PublishProfiles/Teknik - Development.pubxml View File


Teknik/Properties/PublishProfiles/FolderProfile.pubxml → Teknik/Properties/PublishProfiles/Teknik - Production.pubxml View File

@@ -5,18 +5,23 @@ by editing this MSBuild file. In order to learn more about this please visit htt
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<SiteUrlToLaunchAfterPublish>https://www.teknik.io/</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ProjectGuid>1e52f0d0-9e89-4022-a905-c685ef3564e1</ProjectGuid>
<SelfContained>false</SelfContained>
<_IsPortable>true</_IsPortable>
<publishUrl>bin\Release\netcoreapp2.1\publish\</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<MSDeployServiceURL>ams1.teknik.io</MSDeployServiceURL>
<DeployIisAppPath>Teknik</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>Administrator</UserName>
<_SavePWD>True</_SavePWD>
</PropertyGroup>
</Project>

+ 803
- 803
Teknik/package-lock.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save