Browse Source

Finished most of the Paste service.

tags/2.0.3
Teknikode 4 years ago
parent
commit
e84752a9c0

+ 4
- 0
Teknik/App_Start/BundleConfig.cs View File

@@ -25,6 +25,10 @@ namespace Teknik
"~/Scripts/common.js",
"~/Scripts/respond.js"));

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.validate*"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

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

@@ -15,7 +15,8 @@ namespace Teknik.Areas.Error.Controllers
{
ViewBag.Title = "Exception - " + Config.Title;

Response.StatusCode = 200;
if (Response != null)
Response.StatusCode = 200;

ErrorViewModel model = new ErrorViewModel();
model.Exception = exception;
@@ -28,7 +29,8 @@ namespace Teknik.Areas.Error.Controllers
{
ViewBag.Title = "Http Exception - " + Config.Title;

Response.StatusCode = (exception as HttpException).GetHttpCode();
if (Response != null)
Response.StatusCode = (exception as HttpException).GetHttpCode();

ErrorViewModel model = new ErrorViewModel();
model.Description = exception.Message;
@@ -43,7 +45,8 @@ namespace Teknik.Areas.Error.Controllers
ViewBag.Title = "403 - " + Config.Title;
ViewBag.Message = "Access Denied";

Response.StatusCode = 404;
if (Response != null)
Response.StatusCode = 403;

ErrorViewModel model = new ErrorViewModel();
model.Exception = exception;
@@ -57,7 +60,8 @@ namespace Teknik.Areas.Error.Controllers
ViewBag.Title = "404 - " + Config.Title;
ViewBag.Message = "Uh Oh, can't find it!";
Response.StatusCode = 404;
if (Response != null)
Response.StatusCode = 404;

ErrorViewModel model = new ErrorViewModel();
model.Exception = exception;
@@ -71,7 +75,8 @@ namespace Teknik.Areas.Error.Controllers
ViewBag.Title = "500 - " + Config.Title;
ViewBag.Message = "Something Borked";

Response.StatusCode = 500;
if (Response != null)
Response.StatusCode = 500;

ErrorViewModel model = new ErrorViewModel();
model.Exception = exception;

+ 29
- 0
Teknik/Areas/Paste/Content/Paste.css View File

@@ -0,0 +1,29 @@
pre {
background-color: #ffffff;
}

pre code,
pre .line-number {
/* Ukuran line-height antara teks di dalam tag <code> dan <span class="line-number"> harus sama! */
font:normal normal 12px/14px "Courier New",Courier,Monospace;
color:black;
display:block;
}

pre .line-number {
float:left;
margin:0 1em 0 -1em;
padding-top: 5px;
border-right:1px solid;
text-align:right;
}

pre .line-number span {
display:block;
padding:0 .5em 0 1em;
}

pre .cl {
display:block;
clear:both;
}

+ 108
- 91
Teknik/Areas/Paste/Controllers/PasteController.cs View File

@@ -5,6 +5,7 @@ using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Error.Controllers;
using Teknik.Areas.Paste.ViewModels;
using Teknik.Controllers;
using Teknik.Helpers;
@@ -20,12 +21,12 @@ namespace Teknik.Areas.Paste.Controllers
public ActionResult Index()
{
ViewBag.Title = Config.Title + " Paste";
PasteViewModel model = new PasteViewModel();
PasteCreateViewModel model = new PasteCreateViewModel();
return View(model);
}

[AllowAnonymous]
public ActionResult ViewPaste(string url, string pass)
public ActionResult ViewPaste(string type, string url, string password)
{
Models.Paste paste = db.Pastes.Where(p => p.Url == url).FirstOrDefault();
if (paste != null)
@@ -40,132 +41,148 @@ namespace Teknik.Areas.Paste.Controllers
// The paste has a password set
if (!string.IsNullOrEmpty(paste.HashedPassword))
{
if (string.IsNullOrEmpty(pass) || Helpers.SHA384.Hash(paste.Key, pass) != paste.HashedPassword)
if (string.IsNullOrEmpty(password) || Helpers.SHA384.Hash(paste.Key, password) != paste.HashedPassword)
{
PasswordViewModel passModel = new PasswordViewModel();
passModel.Url = url;
passModel.CallingView = "ViewPaste";
passModel.CallingAction = Url.SubRouteUrl("paste", "Paste.View");
// Redirect them to the password request page
return View("~/Areas/Paste/Views/Paste/PasswordNeeded", passModel);
return View("~/Areas/Paste/Views/Paste/PasswordNeeded.cshtml", passModel);
}
// Now we decrypt the content
byte[] data = Encoding.UTF8.GetBytes(paste.Content);
byte[] ivBytes = Encoding.UTF8.GetBytes(paste.IV);
byte[] encData = AES.Decrypt(data, AES.CreateKey(pass, paste.IV, paste.KeySize), ivBytes);
model.Content = Encoding.UTF8.GetString(encData);
byte[] data = Encoding.Unicode.GetBytes(paste.Content);
byte[] ivBytes = Encoding.Unicode.GetBytes(paste.IV);
byte[] keyBytes = AES.CreateKey(password, ivBytes, paste.KeySize);
byte[] encData = AES.Decrypt(data, keyBytes, ivBytes);
model.Content = Encoding.Unicode.GetString(encData);
}

return View(model);
return View("~/Areas/Paste/Views/Paste/" + type + ".cshtml", model);
}
return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
}

[AllowAnonymous]
public ActionResult Simple(string url, string pass)
public ActionResult Raw(string url, string password)
{
PasteViewModel model = new PasteViewModel();
return View(model);
}

[AllowAnonymous]
public ActionResult Raw(string url, string pass)
{
PasteViewModel model = new PasteViewModel();
return View(model);

// Create File
var cd = new System.Net.Mime.ContentDisposition
Models.Paste paste = db.Pastes.Where(p => p.Url == url).FirstOrDefault();
if (paste != null)
{
FileName = upload.Url,
Inline = true
};
string content = paste.Content;

Response.AppendHeader("Content-Disposition", cd.ToString());
// The paste has a password set
if (!string.IsNullOrEmpty(paste.HashedPassword))
{
if (string.IsNullOrEmpty(password) || Helpers.SHA384.Hash(paste.Key, password) != paste.HashedPassword)
{
PasswordViewModel passModel = new PasswordViewModel();
passModel.Url = url;
passModel.CallingAction = Url.SubRouteUrl("paste", "Paste.Raw");
// Redirect them to the password request page
return View("~/Areas/Paste/Views/Paste/PasswordNeeded.cshtml", passModel);
}
// Now we decrypt the content
byte[] data = Encoding.Unicode.GetBytes(paste.Content);
byte[] ivBytes = Encoding.Unicode.GetBytes(paste.IV);
byte[] keyBytes = AES.CreateKey(password, ivBytes, paste.KeySize);
byte[] encData = AES.Decrypt(data, keyBytes, ivBytes);
content = Encoding.Unicode.GetString(encData);
}

return File(data, upload.ContentType);
return Content(content, "text/plain");
}
return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
}



[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Paste(string content, string title, string syntax, string password, bool hide = false)
public ActionResult Download(string url, string password)
{
Models.Paste paste = db.Pastes.Create();
paste.DatePosted = DateTime.Now;
paste.Url = Utility.RandomString(Config.PasteConfig.UrlLength);

// Set the hashed password if one is provided and encrypt stuff
if (!string.IsNullOrEmpty(password))
Models.Paste paste = db.Pastes.Where(p => p.Url == url).FirstOrDefault();
if (paste != null)
{
string key = Utility.RandomString(Config.PasteConfig.KeySize / 8);
string iv = Utility.RandomString(Config.PasteConfig.BlockSize / 8);
paste.HashedPassword = Helpers.SHA384.Hash(key, password);

// Encrypt Content
byte[] data = Encoding.UTF8.GetBytes(content);
byte[] keyBytes = AES.CreateKey(password, iv, Config.PasteConfig.KeySize);
byte[] ivBytes = Encoding.UTF8.GetBytes(iv);
byte[] encData = AES.Encrypt(data, keyBytes, ivBytes);
content = Encoding.UTF8.GetString(encData);

paste.Key = key;
paste.KeySize = Config.PasteConfig.KeySize;
paste.IV = iv;
paste.BlockSize = Config.PasteConfig.BlockSize;
}
byte[] fileData = Encoding.Unicode.GetBytes(paste.Content);

paste.Content = content;
paste.Title = title;
paste.Syntax = syntax;
// The paste has a password set
if (!string.IsNullOrEmpty(paste.HashedPassword))
{
if (string.IsNullOrEmpty(password) || Helpers.SHA384.Hash(paste.Key, password) != paste.HashedPassword)
{
PasswordViewModel passModel = new PasswordViewModel();
passModel.Url = url;
passModel.CallingAction = Url.SubRouteUrl("paste", "Paste.Download");
// Redirect them to the password request page
return View("~/Areas/Paste/Views/Paste/PasswordNeeded.cshtml", passModel);
}
// Now we decrypt the content
byte[] data = Encoding.Unicode.GetBytes(paste.Content);
byte[] ivBytes = Encoding.Unicode.GetBytes(paste.IV);
byte[] keyBytes = AES.CreateKey(password, ivBytes, paste.KeySize);
fileData = AES.Decrypt(data, keyBytes, ivBytes);
}

//Create File
var cd = new System.Net.Mime.ContentDisposition
{
FileName = url,
Inline = true
};

db.Pastes.Add(paste);
db.SaveChanges();
Response.AppendHeader("Content-Disposition", cd.ToString());

return Redirect(Url.SubRouteUrl("paste", "Paste.View", new { url = paste.Url }));
return File(fileData, "text/plain");
}
return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
}

[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult SubmitPassword(string url, string password)
public ActionResult Paste([Bind(Include = "Content, Title, Syntax, Password, Hide")]PasteCreateViewModel model)
{
Models.Paste paste = db.Pastes.Where(p => p.Url == url).FirstOrDefault();
if (paste != null)
if (ModelState.IsValid)
{
if (Helpers.SHA384.Hash(paste.Key, password) == paste.HashedPassword)
try
{
return View(model);
}
}
return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
}
Models.Paste paste = db.Pastes.Create();
paste.DatePosted = DateTime.Now;
paste.Url = Utility.RandomString(Config.PasteConfig.UrlLength);

private PasteViewModel GetPasteModel(Models.Paste paste, string pass)
{
PasteViewModel model = new PasteViewModel();
model.Url = paste.Url;
model.Content = paste.Content;
model.Title = paste.Title;
model.Syntax = paste.Syntax;
model.DatePosted = paste.DatePosted;

// The paste has a password set
if (!string.IsNullOrEmpty(paste.HashedPassword))
{
if (string.IsNullOrEmpty(pass) || Helpers.SHA384.Hash(paste.Key, pass) != paste.HashedPassword)
// Set the hashed password if one is provided and encrypt stuff
if (!string.IsNullOrEmpty(model.Password))
{
string key = Utility.RandomString(Config.PasteConfig.KeySize / 8);
string iv = Utility.RandomString(Config.PasteConfig.BlockSize / 8);
paste.HashedPassword = Helpers.SHA384.Hash(key, model.Password);

// Encrypt Content
byte[] data = Encoding.Unicode.GetBytes(model.Content);
byte[] ivBytes = Encoding.Unicode.GetBytes(iv);
byte[] keyBytes = AES.CreateKey(model.Password, ivBytes, Config.PasteConfig.KeySize);
byte[] encData = AES.Encrypt(data, keyBytes, ivBytes);
model.Content = Encoding.Unicode.GetString(encData);

paste.Key = key;
paste.KeySize = Config.PasteConfig.KeySize;
paste.IV = iv;
paste.BlockSize = Config.PasteConfig.BlockSize;
}

paste.Content = model.Content;
paste.Title = model.Title;
paste.Syntax = model.Syntax;
paste.Hide = model.Hide;

db.Pastes.Add(paste);
db.SaveChanges();

return Redirect(Url.SubRouteUrl("paste", "Paste.View", new { url = paste.Url, password = model.Password }));
}
catch (Exception ex)
{
// Redirect them to password page
return Redirect(Url.SubRouteUrl("error", "Error.500", new { exception = ex }));
}
// Now we decrypt the content
byte[] data = Encoding.UTF8.GetBytes(paste.Content);
byte[] ivBytes = Encoding.UTF8.GetBytes(paste.IV);
byte[] encData = AES.Decrypt(data, AES.CreateKey(pass, paste.IV, paste.KeySize), ivBytes);
model.Content = Encoding.UTF8.GetString(encData);
}

return model;
return View("~/Areas/Paste/Views/Paste/Index.cshtml", model);
}
}
}

+ 21
- 11
Teknik/Areas/Paste/PasteAreaRegistration.cs View File

@@ -24,31 +24,38 @@ namespace Teknik.Areas.Paste
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.View", // Route name
"Paste.Simple", // Route name
new List<string>() { "dev", "paste", "p" },
"{id}", // URL with parameters
new { controller = "Paste", action = "ViewPaste" }, // Parameter defaults
"Simple/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Simple", password = UrlParameter.Optional }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.Simple", // Route name
"Paste.Raw", // Route name
new List<string>() { "dev", "paste", "p" },
"Simple/{id}", // URL with parameters
new { controller = "Paste", action = "Simple" }, // Parameter defaults
"Raw/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "Raw", password = UrlParameter.Optional }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.Raw", // Route name
"Paste.Download", // Route name
new List<string>() { "dev", "paste", "p" },
"Raw/{id}", // URL with parameters
new { controller = "Paste", action = "Raw" }, // Parameter defaults
"Download/{url}/{password}", // URL with parameters
new { controller = "Paste", action = "Download", password = UrlParameter.Optional }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.Action", // Route name
new List<string>() { "dev", "paste", "p" },
"Action/{action}", // URL with parameters
new { controller = "Paste", action = string.Empty }, // Parameter defaults
new { controller = "Paste", action = "Index" }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);
context.MapSubdomainRoute(
"Paste.View", // Route name
new List<string>() { "dev", "paste", "p" },
"{url}/{password}", // URL with parameters
new { controller = "Paste", action = "ViewPaste", type = "Full", password = UrlParameter.Optional }, // Parameter defaults
new[] { typeof(Controllers.PasteController).Namespace }
);

@@ -56,9 +63,12 @@ namespace Teknik.Areas.Paste
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/paste").Include(
"~/Scripts/Highlight/highlight.pack.js",
"~/Areas/Paste/Scripts/Paste.js"));
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/highlight").Include(
"~/Scripts/Highlight/highlight.pack.js"));
// Register Style Bundles
BundleTable.Bundles.Add(new StyleBundle("~/Content/paste").Include(
"~/Content/Highlight/default.css"));
"~/Content/Highlight/github-gist.css",
"~/Areas/Paste/Content/Paste.css"));
}
}
}

+ 1
- 1
Teknik/Areas/Paste/ViewModels/PasswordViewModel.cs View File

@@ -11,6 +11,6 @@ namespace Teknik.Areas.Paste.ViewModels
{
public string Url { get; set; }

public string CallingView { get; set; }
public string CallingAction { get; set; }
}
}

+ 25
- 0
Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.ViewModels;

namespace Teknik.Areas.Paste.ViewModels
{
public class PasteCreateViewModel : ViewModelBase
{
[Required]
[AllowHtml]
public string Content { get; set; }

public string Title { get; set; }

public string Syntax { get; set; }

public string Password { get; set; }

public bool Hide { get; set; }
}
}

+ 2
- 0
Teknik/Areas/Paste/ViewModels/PasteViewModel.cs View File

@@ -13,6 +13,8 @@ namespace Teknik.Areas.Paste.ViewModels
public string Content { get; set; }
public string Title { get; set; }
public string Syntax { get; set; }
public string Password { get; set; }
public bool Hide { get; set; }
public DateTime DatePosted { get; set; }
}
}

+ 41
- 0
Teknik/Areas/Paste/Views/Paste/Full.cshtml View File

@@ -0,0 +1,41 @@
@model Teknik.Areas.Paste.ViewModels.PasteViewModel

@Styles.Render("~/Content/paste")
@Scripts.Render("~/bundles/paste")

@{
string syntax = string.Empty;
if (Model.Syntax != "auto-select")
{
syntax = Model.Syntax;
}
}
<div class="container">
<div class="row text-center">
<div class="col-sm-12 text-center">
<h2><b>@((string.IsNullOrEmpty(Model.Title)) ? "Untitled" : Model.Title)</b> <small>- Posted on @Model.DatePosted.ToString("dddd, MMMM d, yyyy") at @Model.DatePosted.ToString("h:mm:ss tt") - Format: @Model.Syntax</small></h2>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-1 col-sm-offset-1 text-center">
<a class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Simple", new { url = Model.Url })">Simple</a>
</div>
<div class="col-sm-1 text-center">
<a class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Raw", new { url = Model.Url })">Raw</a>
</div>
<div class="col-sm-1 text-center">
<a class="btn btn-default" href="@Url.SubRouteUrl("paste", "Paste.Download", new { url = Model.Url })">Download</a>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<pre><code class="@syntax">@Model.Content</code></pre>
</div>
</div>
</div>

<script>
hljs.initHighlighting();
</script>

+ 7
- 7
Teknik/Areas/Paste/Views/Paste/Index.cshtml View File

@@ -1,4 +1,4 @@
@model Teknik.Areas.Paste.ViewModels.PasteViewModel
@model Teknik.Areas.Paste.ViewModels.PasteCreateViewModel

@using Teknik.Helpers

@@ -12,22 +12,22 @@
@Html.AntiForgeryToken()
<div class="form-group">
<div class="col-sm-10 col-sm-offset-1">
<textarea class="form-control" name="content" id="content" rows="20"></textarea>
<textarea class="form-control" name="Content" id="content" rows="20"></textarea>
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 col-sm-offset-1 control-label">Title</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="title" id="title" placeholder="My Awesome Paste">
<input type="text" class="form-control" name="Title" id="title" placeholder="My Awesome Paste">
</div>
<div class="col-sm-1 col-sm-offset-2">
<button type="submit" class="btn btn-primary">Submit Paste</button>
<button type="submit" class="btn btn-primary" id="pasteSubmit">Submit Paste</button>
</div>
</div>
<div class="form-group">
<label for="syntax" class="col-sm-2 col-sm-offset-1 control-label">Syntax</label>
<div class="col-sm-4">
<select class="form-control" name="syntax" id="syntax">
<select class="form-control" name="Syntax" id="syntax">
<option value="auto-select">Auto Select</option>
@foreach (KeyValuePair<string, string> format in Constants.HIGHLIGHTFORMATS)
{
@@ -39,14 +39,14 @@
<div class="form-group">
<label for="password" class="col-sm-2 col-sm-offset-1 control-label">Password</label>
<div class="col-sm-4">
<input type="password" class="form-control" name="password" id="password" placeholder="Secret">
<input type="password" class="form-control" name="Password" id="password" placeholder="Secret">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
<div class="checkbox">
<label>
<input type="checkbox" name="hide" id="hide"> Hide from Public List
<input type="checkbox" name="Hide" id="hide"> Hide from Public List
</label>
</div>
</div>

+ 1
- 1
Teknik/Areas/Paste/Views/Paste/PasswordNeeded.cshtml View File

@@ -3,7 +3,7 @@
<div class="container">
<div class="row text-center">
<div class="col-sm-6 col-sm-offset-3">
<form class="form-inline" method="post" action="@Url.SubRouteUrl("paste", "Paste.Action", new { action = "SubmitPassword" })">
<form class="form-inline" method="post" action="@Model.CallingAction">
<h3><span class="glyphicon glyphicon-warning-sign"></span> This paste is password protected.</h3>
<input type="hidden" name="url" value="@Model.Url">
<div class="well no-padding">

+ 33
- 0
Teknik/Areas/Paste/Views/Paste/Simple.cshtml View File

@@ -0,0 +1,33 @@
@model Teknik.Areas.Paste.ViewModels.PasteViewModel
@{
Layout = "";
string syntax = string.Empty;
if (Model.Syntax != "auto-select")
{
syntax = Model.Syntax;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="@Model.Config.Description" />
<meta name="author" content="@Model.Config.Author" />
<title>@ViewBag.Title</title>
<link rel="shortcut icon" href="/Images/favicon.ico" type="image/x-icon" />

@Styles.Render("~/Content/paste")
@Scripts.Render("~/bundles/highlight")

</head>
<body data-twttr-rendered="true">
<pre><code class="@syntax">@Model.Content</code></pre>
<script>
hljs.initHighlightingOnLoad();

function pageloadStopTimer() { }
</script>
</body>
</html>

+ 0
- 1
Teknik/Areas/Paste/Views/Paste/ViewPaste.cshtml View File

@@ -1 +0,0 @@


+ 6
- 2
Teknik/Helpers/Crypto.cs View File

@@ -62,9 +62,13 @@ namespace Teknik.Helpers

public static byte[] CreateKey(string password, string iv, int keySize = 256)
{
const int Iterations = 300;
byte[] ivBytes = Encoding.UTF8.GetBytes(iv);
var keyGenerator = new Rfc2898DeriveBytes(password, ivBytes, Iterations);
return CreateKey(password, ivBytes, keySize);
}
public static byte[] CreateKey(string password, byte[] iv, int keySize = 256)
{
const int Iterations = 300;
var keyGenerator = new Rfc2898DeriveBytes(password, iv, Iterations);
return keyGenerator.GetBytes(keySize / 8);
}
}

BIN
Teknik/Scripts/_references.js View File


+ 0
- 5
Teknik/Scripts/jquery-2.1.4.min.js
File diff suppressed because it is too large
View File


+ 0
- 1
Teknik/Scripts/jquery-2.1.4.min.map
File diff suppressed because it is too large
View File


+ 6632
- 0
Teknik/Scripts/jquery-2.2.0-vsdoc.js
File diff suppressed because it is too large
View File


Teknik/Scripts/jquery-2.2.0.js
File diff suppressed because it is too large
View File


+ 4
- 0
Teknik/Scripts/jquery-2.2.0.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
Teknik/Scripts/jquery-2.2.0.min.map
File diff suppressed because it is too large
View File


+ 9
- 5
Teknik/Teknik.csproj View File

@@ -69,7 +69,7 @@
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RouteDebugger, Version=2.1.4.0, Culture=neutral, processorArchitecture=MSIL">
@@ -171,6 +171,7 @@
<Compile Include="Areas\Home\ViewModels\HomeViewModel.cs" />
<Compile Include="Areas\Paste\Controllers\PasteController.cs" />
<Compile Include="Areas\Paste\Models\Paste.cs" />
<Compile Include="Areas\Paste\ViewModels\PasteCreateViewModel.cs" />
<Compile Include="Areas\Paste\PasteAreaRegistration.cs" />
<Compile Include="Areas\Paste\ViewModels\PasswordViewModel.cs" />
<Compile Include="Areas\Paste\ViewModels\PasteViewModel.cs" />
@@ -228,6 +229,7 @@
<Content Include="Areas\Help\Content\Help.css" />
<Content Include="Areas\Home\Content\Home.css" />
<Content Include="Areas\Home\Scripts\Home.js" />
<Content Include="Areas\Paste\Content\Paste.css" />
<Content Include="Areas\Paste\Scripts\Paste.js" />
<Content Include="Areas\Profile\Scripts\Profile.js" />
<Content Include="Areas\Upload\Scripts\Download.js" />
@@ -391,9 +393,10 @@
<Content Include="Areas\Paste\Views\web.config" />
<Content Include="Areas\Paste\Views\Paste\Index.cshtml" />
<Content Include="Areas\Paste\Views\_ViewStart.cshtml" />
<Content Include="Areas\Paste\Views\Paste\ViewPaste.cshtml" />
<Content Include="Areas\Paste\Views\Paste\Full.cshtml" />
<Content Include="Areas\Paste\Views\Paste\PasswordNeeded.cshtml" />
<Content Include="Areas\Error\Views\Error\Http403.cshtml" />
<Content Include="Areas\Paste\Views\Paste\Simple.cshtml" />
<None Include="Properties\PublishProfiles\Teknik Dev.pubxml" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
<Content Include="Scripts\bootbox\bootbox.min.js" />
@@ -409,8 +412,10 @@
<Content Include="Scripts\Dropzone\dropzone.js" />
<Content Include="Scripts\FileSaver.js" />
<Content Include="Scripts\Highlight\highlight.pack.js" />
<Content Include="Scripts\jquery-2.1.4.js" />
<Content Include="Scripts\jquery-2.1.4.min.js" />
<None Include="Scripts\jquery-2.2.0-vsdoc.js" />
<Content Include="Scripts\jquery-2.2.0.js" />
<Content Include="Scripts\jquery-2.2.0.min.js" />
<Content Include="Scripts\jquery-2.2.0.min.map" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
<Content Include="Scripts\jquery-ui.widgets.js" />
<Content Include="Scripts\jquery.blockUI.js" />
@@ -447,7 +452,6 @@
<Content Include="Areas\Profile\Views\Profile\Login.cshtml" />
<Content Include="Areas\Profile\Views\Profile\Register.cshtml" />
<Content Include="Areas\Dev\Views\Dev\Index.cshtml" />
<Content Include="Scripts\jquery-2.1.4.min.map" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\About\Models\" />

+ 39
- 39
Teknik/Web.config View File

@@ -1,88 +1,88 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings configSource="ConnectionStrings.config"/>
<connectionStrings configSource="ConnectionStrings.config" />
<!-- Create ConnectionStrings.config and add your connection string-->
<appSettings>
<add key="webpages:Version" value="3.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
<add key="RouteDebugger:Enabled" value="false"/>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="RouteDebugger:Enabled" value="false" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms"/>
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576"/>
<pages buffer="true" enableViewState="false"/>
<customErrors mode="Off" />
<authentication mode="Forms" />
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576" />
<pages buffer="true" enableViewState="false" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthentication"/>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
<add name="PerfModule" type="Teknik.Modules.PerformanceMonitorModule, Teknik"/>
<remove name="UrlRoutingModule-4.0"/>
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition=""/>
<remove name="FormsAuthentication" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
<add name="PerfModule" type="Teknik.Modules.PerformanceMonitorModule, Teknik" />
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff"/>
<mimeMap fileExtension="woff2" mimeType="application/font-woff"/>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" cacheControlCustom="public"/>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff" />
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" cacheControlCustom="public" />
</staticContent>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824"/>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb"/>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>

+ 2
- 2
Teknik/packages.config View File

@@ -7,7 +7,7 @@
<package id="FontAwesome" version="4.4.0" targetFramework="net452" userInstalled="true" />
<package id="GitVersionTask" version="3.3.0" targetFramework="net452" developmentDependency="true" />
<package id="Inferno" version="1.1.0" targetFramework="net452" userInstalled="true" />
<package id="jQuery" version="2.1.4" targetFramework="net452" userInstalled="true" />
<package id="jQuery" version="2.2.0" targetFramework="net452" userInstalled="true" />
<package id="jQuery.Validation" version="1.14.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" userInstalled="true" />
@@ -18,7 +18,7 @@
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net46" userInstalled="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" userInstalled="true" />
<package id="Modernizr" version="2.8.3" targetFramework="net452" userInstalled="true" />
<package id="Newtonsoft.Json" version="8.0.1" targetFramework="net452" userInstalled="true" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" userInstalled="true" />
<package id="Respond" version="1.4.2" targetFramework="net452" userInstalled="true" />
<package id="routedebugger" version="2.1.4" targetFramework="net452" userInstalled="true" />
<package id="WebGrease" version="1.6.0" targetFramework="net46" userInstalled="true" />

Loading…
Cancel
Save