Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintegrate Akistmet Spam protection #599

Open
poppastring opened this issue Nov 20, 2021 · 6 comments
Open

Reintegrate Akistmet Spam protection #599

poppastring opened this issue Nov 20, 2021 · 6 comments
Assignees

Comments

@poppastring
Copy link
Owner

poppastring commented Nov 20, 2021

This was missed in the transition but we should protect spam

https://akismet.com/
https://akismet.com/development/api/#detailed-docs
https://akismet.com/development/api/#comment-check

@thousandtyone
Copy link
Contributor

If no one else has taken this up, I would love to work on this! Okay to take this up and submit a PR?

@poppastring
Copy link
Owner Author

@thousandtyone Please feel free! :)

@thousandtyone
Copy link
Contributor

thousandtyone commented Jan 21, 2022

Thanks, I could see an Akismet project / implementation only existing on the past version. Instead of starting fresh, I've been able to port it to .NET core pretty simply. Need a couple of more days to integrate and test end to end. Will keep this thread updated as I make progress.

@thousandtyone
Copy link
Contributor

Tested the existing implementation after porting it to .NET Core and it works flawlessly. I've integrated that with the current project after porting to .NET Core. Will submit a PR tomorrow.

@thousandtyone
Copy link
Contributor

thousandtyone commented Jan 28, 2022

Adding PR - Here is a basic documentation of the implementation.

Once this PR is merged the following site.config settings which already existed in the config file should now open up in site admin:
image

Akismet will be used only if 'Enable Spam Blocking Service' is enabled. If that setting is not turned on, there will be no spam filtering using Akismet and spam will be allowed.

However if that setting is turned on you need to type in your key in your Akismet key in 'Akismet API Key' field. Once you do this spam will start getting filtered using Akismet. You now have two options. You can choose to moderate comments that are marked as spam or just disallow them without any moderation.

Without moderation the spam poster will get a validation which prevents them from posting spam:
image

With Moderation the users will not get any errors but the comment marked as spam will be held up for moderation:
image

The user has an option of clicking the thumbs up icon to approve it or deleting it.

Posting the PR for this implementation.

@thousandtyone
Copy link
Contributor

I have submitted the PR but it keeps failing with this log in the pipeline:

2022-01-28T20:39:26.9131489Z ##[section]Starting: DotNetCoreCLI
2022-01-28T20:39:26.9250902Z ==============================================================================
2022-01-28T20:39:26.9251488Z Task : .NET Core
2022-01-28T20:39:26.9251855Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2022-01-28T20:39:26.9252389Z Version : 2.198.0
2022-01-28T20:39:26.9252661Z Author : Microsoft Corporation
2022-01-28T20:39:26.9253034Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2022-01-28T20:39:26.9253428Z ==============================================================================
2022-01-28T20:39:27.3607660Z [command]C:\Windows\system32\chcp.com 65001
2022-01-28T20:39:27.3712512Z Active code page: 65001
2022-01-28T20:39:27.3742137Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2022-01-28T20:39:28.7256705Z [command]C:\hostedtoolcache\windows\dotnet\dotnet.exe publish D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj --configuration Release --output D:\a\1\a/dasblog-core_20220128.4 --self-contained --no-build --no-restore
2022-01-28T20:39:28.8986300Z Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
2022-01-28T20:39:28.8987756Z Copyright (C) Microsoft Corporation. All rights reserved.
2022-01-28T20:39:28.8988373Z
2022-01-28T20:39:31.2032819Z C:\hostedtoolcache\windows\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(248,5): error MSB3030: Could not copy the file "D:\a\1\s\source\Subtext.Akismet\bin\Release\net6.0\Subtext.Akismet.dll" because it was not found. [D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj]
2022-01-28T20:39:31.2426036Z ##[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1
2022-01-28T20:39:31.2429760Z ##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
2022-01-28T20:39:31.2434427Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2022-01-28T20:39:31.2437654Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\source\DasBlog.Web.UI\DasBlog.Web.csproj
2022-01-28T20:39:31.2571238Z ##[section]Finishing: DotNetCoreCLI

The Same command however works locally for me:

image

Not sure if I did something wrong or it's an issue with the pipeline in general. The whole flow is working perfectly on my machine and even seems to be passing build and test cases in the pipeline. Not sure why publish is failing. Right now I tried the same set of commands the pipeline is firing on my local machine and it all seems to work. If there is something that needs to be fixed at my end please do let me know and I'll be happy to fix. Not sure why the publish is unable to find the akismet dll on the pipeline box. I am leaving the PR open. It'll be really nice if you can review it once and please do let me know if I am doing something wrong or it's some issue that needs to be fixed on the pipeline. If I need to fix it, I'll do that right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants