Browse Source

Removed tracking attributes from all files.

Stopped some app_data files from overwriting publish dir files.
tags/3.0.0^2
Teknikode 1 year ago
parent
commit
21a3a31f02

+ 0
- 1
Teknik/App_Data/referrerBlacklist.txt View File

@@ -1 +0,0 @@
xn--cckl0itdpc9763ahlyc.tv

+ 0
- 3
Teknik/Areas/API/Controllers/APIv1Controller.cs View File

@@ -44,7 +44,6 @@ namespace Teknik.Areas.API.Controllers

[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> UploadAsync(APIv1UploadModel model)
{
try
@@ -197,7 +196,6 @@ namespace Teknik.Areas.API.Controllers

[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Paste(APIv1PasteModel model)
{
try
@@ -242,7 +240,6 @@ namespace Teknik.Areas.API.Controllers

[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Shorten(APIv1ShortenModel model)
{
try

+ 0
- 1
Teknik/Areas/About/Controllers/AboutController.cs View File

@@ -22,7 +22,6 @@ namespace Teknik.Areas.About.Controllers
public AboutController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index([FromServices] Config config)
{
ViewBag.Title = "About - " + config.Title;

+ 1
- 2
Teknik/Areas/Abuse/Controllers/AbuseController.cs View File

@@ -20,8 +20,7 @@ namespace Teknik.Areas.Abuse.Controllers
public class AbuseController : DefaultController
{
public AbuseController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 0
- 3
Teknik/Areas/Admin/Controllers/AdminController.cs View File

@@ -27,7 +27,6 @@ namespace Teknik.Areas.Admin.Controllers
public AdminController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base (logger, config, dbContext) { }

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public ActionResult Dashboard()
{
DashboardViewModel model = new DashboardViewModel();
@@ -35,7 +34,6 @@ namespace Teknik.Areas.Admin.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public ActionResult UserSearch()
{
UserSearchViewModel model = new UserSearchViewModel();
@@ -43,7 +41,6 @@ namespace Teknik.Areas.Admin.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public ActionResult UserInfo(string username)
{
if (UserHelper.UserExists(_dbContext, username))

+ 0
- 2
Teknik/Areas/Blog/Controllers/BlogController.cs View File

@@ -29,7 +29,6 @@ namespace Teknik.Areas.Blog.Controllers
{
public BlogController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Blog(string username)
{
@@ -119,7 +118,6 @@ namespace Teknik.Areas.Blog.Controllers
}

#region Posts
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Post(string username, int id)
{

+ 0
- 1
Teknik/Areas/Contact/Controllers/ContactController.cs View File

@@ -25,7 +25,6 @@ namespace Teknik.Areas.Contact.Controllers
{
public ContactController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 1
- 2
Teknik/Areas/Dev/Controllers/DevController.cs View File

@@ -16,8 +16,7 @@ namespace Teknik.Areas.Dev.Controllers
public class DevController : DefaultController
{
public DevController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 1
- 2
Teknik/Areas/FAQ/Controllers/FAQController.cs View File

@@ -16,8 +16,7 @@ namespace Teknik.Areas.FAQ.Controllers
public class FAQController : DefaultController
{
public FAQController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 10
- 21
Teknik/Areas/Help/Controllers/HelpController.cs View File

@@ -17,7 +17,6 @@ namespace Teknik.Areas.Help.Controllers
{
public HelpController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{
@@ -25,8 +24,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View(model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult API(string version, string service)
{
@@ -43,8 +41,7 @@ namespace Teknik.Areas.Help.Controllers
}
return RedirectToRoute("Error.Http404");
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Blog()
{
@@ -52,8 +49,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Blog.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Git()
{
@@ -61,8 +57,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Git.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult IRC()
{
@@ -70,8 +65,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/IRC.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Mail()
{
@@ -79,8 +73,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Mail.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Markdown()
{
@@ -88,8 +81,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Markdown.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Mumble()
{
@@ -97,8 +89,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Mumble.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult RSS()
{
@@ -106,8 +97,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/RSS.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Tools()
{
@@ -115,8 +105,7 @@ namespace Teknik.Areas.Help.Controllers
HelpViewModel model = new HelpViewModel();
return View("~/Areas/Help/Views/Help/Tools.cshtml", model);
}

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Upload()
{

+ 1
- 2
Teknik/Areas/Home/Controllers/HomeController.cs View File

@@ -21,8 +21,7 @@ namespace Teknik.Areas.Home.Controllers
public class HomeController : DefaultController
{
public HomeController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 2
- 4
Teknik/Areas/Paste/Controllers/PasteController.cs View File

@@ -26,8 +26,7 @@ namespace Teknik.Areas.Paste.Controllers
public class PasteController : DefaultController
{
public PasteController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{
@@ -36,8 +35,7 @@ namespace Teknik.Areas.Paste.Controllers
PasteCreateViewModel model = new PasteCreateViewModel();
return View(model);
}

[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
public IActionResult ViewPaste(string type, string url, string password)
{

+ 1
- 4
Teknik/Areas/Podcast/Controllers/PodcastController.cs View File

@@ -27,8 +27,7 @@ namespace Teknik.Areas.Podcast.Controllers
public class PodcastController : DefaultController
{
public PodcastController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{
@@ -63,7 +62,6 @@ namespace Teknik.Areas.Podcast.Controllers
}

#region Podcasts
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult View(int episode)
{
@@ -84,7 +82,6 @@ namespace Teknik.Areas.Podcast.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Download(int episode, string fileName)

+ 0
- 1
Teknik/Areas/Privacy/Controllers/PrivacyController.cs View File

@@ -17,7 +17,6 @@ namespace Teknik.Areas.Privacy.Controllers
{
public PrivacyController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 3
- 6
Teknik/Areas/RSS/Controllers/RSSController.cs View File

@@ -30,8 +30,7 @@ namespace Teknik.Areas.RSS.Controllers
public class RSSController : DefaultController
{
public RSSController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
public async Task Index()
{
@@ -48,8 +47,7 @@ namespace Teknik.Areas.RSS.Controllers
await xmlWriter.FlushAsync();
}
}

[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
public async Task Blog(string username)
{
@@ -154,8 +152,7 @@ namespace Teknik.Areas.RSS.Controllers

}
}

[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
public async Task Podcast()
{

+ 2
- 4
Teknik/Areas/Shortener/Controllers/ShortenerController.cs View File

@@ -21,8 +21,7 @@ namespace Teknik.Areas.Shortener.Controllers
public class ShortenerController : DefaultController
{
public ShortenerController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{
@@ -30,8 +29,7 @@ namespace Teknik.Areas.Shortener.Controllers
ShortenViewModel model = new ShortenViewModel();
return View(model);
}

[ServiceFilter(typeof(TrackLink))]
[AllowAnonymous]
public IActionResult RedirectToUrl(string url)
{

+ 1
- 2
Teknik/Areas/Stats/Controllers/StatsController.cs View File

@@ -22,8 +22,7 @@ namespace Teknik.Areas.Stats.Controllers
public class StatsController : DefaultController
{
public StatsController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 0
- 1
Teknik/Areas/TOS/Controllers/TOSController.cs View File

@@ -17,7 +17,6 @@ namespace Teknik.Areas.TOS.Controllers
{
public TOSController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{

+ 0
- 2
Teknik/Areas/Upload/Controllers/UploadController.cs View File

@@ -32,7 +32,6 @@ namespace Teknik.Areas.Upload.Controllers
public UploadController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Index()
{
@@ -142,7 +141,6 @@ namespace Teknik.Areas.Upload.Controllers

// User did not supply key
[HttpGet]
[ServiceFilter(typeof(TrackDownload))]
[AllowAnonymous]
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Download(string file)

+ 7
- 18
Teknik/Areas/User/Controllers/UserController.cs View File

@@ -35,8 +35,7 @@ namespace Teknik.Areas.Users.Controllers

private static readonly UsedCodesManager usedCodesManager = new UsedCodesManager();
private const string _AuthSessionKey = "AuthenticatedUser";

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult GetPremium()
{
@@ -48,7 +47,6 @@ namespace Teknik.Areas.Users.Controllers
}

// GET: Profile/Profile
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult ViewProfile(string username)
{
@@ -106,14 +104,12 @@ namespace Teknik.Areas.Users.Controllers
}
return View(model);
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult Settings()
{
return Redirect(Url.SubRouteUrl("user", "User.SecuritySettings"));
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult ProfileSettings()
{
string username = User.Identity.Name;
@@ -139,8 +135,7 @@ namespace Teknik.Areas.Users.Controllers

return Redirect(Url.SubRouteUrl("error", "Error.Http403"));
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult SecuritySettings()
{
string username = User.Identity.Name;
@@ -181,8 +176,7 @@ namespace Teknik.Areas.Users.Controllers

return Redirect(Url.SubRouteUrl("error", "Error.Http403"));
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult InviteSettings()
{
string username = User.Identity.Name;
@@ -229,8 +223,7 @@ namespace Teknik.Areas.Users.Controllers

return Redirect(Url.SubRouteUrl("error", "Error.Http403"));
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult BlogSettings()
{
string username = User.Identity.Name;
@@ -255,8 +248,7 @@ namespace Teknik.Areas.Users.Controllers

return Redirect(Url.SubRouteUrl("error", "Error.Http403"));
}

[ServiceFilter(typeof(TrackPageView))]
public IActionResult UploadSettings()
{
string username = User.Identity.Name;
@@ -282,7 +274,6 @@ namespace Teknik.Areas.Users.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult ViewRawPGP(string username)
{
@@ -301,7 +292,6 @@ namespace Teknik.Areas.Users.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Login(string ReturnUrl)
{
@@ -412,7 +402,6 @@ namespace Teknik.Areas.Users.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult Register(string inviteCode, string ReturnUrl)
{

+ 1
- 5
Teknik/Areas/Vault/Controllers/VaultController.cs View File

@@ -28,8 +28,7 @@ namespace Teknik.Areas.Vault.Controllers
public class VaultController : DefaultController
{
public VaultController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult ViewVault(string id)
{
@@ -107,7 +106,6 @@ namespace Teknik.Areas.Vault.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult NewVault()
{
@@ -118,7 +116,6 @@ namespace Teknik.Areas.Vault.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
[AllowAnonymous]
public IActionResult NewVaultFromService(string type, string items)
{
@@ -156,7 +153,6 @@ namespace Teknik.Areas.Vault.Controllers
}

[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult EditVault(string url, string type, string items)
{
ViewBag.Title = "Edit Vault";

+ 3
- 3
Teknik/Startup.cs View File

@@ -63,9 +63,9 @@ namespace Teknik
services.AddScoped<Config, Config>(opt => Config.Load(dataDir));

// Add Tracking Filter scopes
services.AddScoped<TrackDownload>();
services.AddScoped<TrackLink>();
services.AddScoped<TrackPageView>();
//services.AddScoped<TrackDownload>();
//services.AddScoped<TrackLink>();
//services.AddScoped<TrackPageView>();

// Create the Database Context
services.AddDbContext<TeknikEntities>(options => options

+ 5
- 0
Teknik/Teknik.csproj View File

@@ -84,21 +84,26 @@

<ItemGroup>
<Content Update="App_Data\Config.json">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="App_Data\ConnectionStrings.config">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="App_Data\MachineKey.config">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Update="App_Data\ipBlacklist.txt">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="App_Data\referrerBlacklist.txt">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="App_Data\reservedUsernames.txt">

Loading…
Cancel
Save