
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
cloudscribe.Web.SiteMap
Advanced tools
ASP.NET Core controller and models for generating an xml sitemap for search indexes http://www.sitemaps.org
ASP.NET Core MVC controller and models for generating a SiteMap for search engines. Submitting a sitemap to the major search engines is vital to the SEO of most web sites.
This was implemented in support of my cloudscribe SimpleContent project but has no dependencies on other cloudscribe projects and could be useful for many website projects.
What is currently provided is an mvc controller at /api/sitemap that can generate the xml sitemap from 1 or more IEnumerable. To use it in your own project you would implement ISiteMapNodeService which has one method, GetSiteMapNodes which returns an IEnumerable. You can register one or more implementations of ISiteMapNodeService with DI services and the controller will iterate through each of them to build the sitemap. There is also support for memory caching, but support for distributed cache has not been implemented yet.
Note that this project does not currently provide a sitemap solution for very large sites. A single sitemap which this project can generate dynamically, can only have up to 25,000 urls. If you have more that that you would need a differenet solution that generates a sitemap index which is a list of sitemap urls where each of the separate sitemaps can have up to 25,000 urls, and you can have up to 50,000 sitemaps listed in the index. I think if I were needing sitemaps that large I would create a process to generate the files as static xml files and serve those directly rather than generating the sitemap dynamically as in this project.
Prerequisites:
To install from nuget.org open the project.json file of your web application and in the dependencies section add:
"cloudscribe.Web.SiteMap": "1.0.0-*"
Visual Studio 2015 should restore the package automatically, you could also open a command prompt and use dnu restore in your project folder.
In your Startup.cs you will need this at the top:
using Microsoft.Framework.DependencyInjection.Extensions;
using cloudscribe.Web.SiteMap;
and in ConfigureServices you will need this:
services.AddScoped<ISiteMapNodeService, YourImplementationOfSiteMapNodeService>();
You will also need to define a cache profile named SiteMapCacheProfile as part of the MVC configuration like this:
services.Configure<MvcOptions>(options =>
{
options.CacheProfiles.Add("SiteMapCacheProfile",
new CacheProfile
{
Duration = 6000 //in seconds
});
});
services.AddMvc();
Follow me on twitter @cloudscribeweb and @joeaudette
FAQs
ASP.NET Core controller and models for generating an xml sitemap for search indexes http://www.sitemaps.org
We found that cloudscribe.web.sitemap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.