Skip to content

UI updates based on site configuration - #824

Merged
poppastring merged 5 commits into
mainfrom
improving-support-options
May 8, 2026
Merged

poppastring merged 5 commits into
mainfrom
improving-support-options

Conversation

@poppastring

Copy link
Copy Markdown
Owner

PR Classification

Implements conditional API exposure, security improvements, and UI updates based on site configuration.

PR Summary

This pull request adds conditional support for legacy blogging APIs, introduces login rate limiting, and updates UI elements to reflect configuration settings.

  • SubscriptionManager.cs, FeedController.cs: Only advertise and enable Blogger, MetaWeblog, and Moveable Type APIs if EnableBloggerApi is true; return 404 for disabled endpoints.
  • Program.cs, AccountController.cs: Add IP-based rate limiting to the login endpoint with a 429 response on excessive attempts.
  • BlogPostViewModelCreator.cs and tests: Default new posts' AllowComments to the site-wide EnableComments setting.
  • _Admin_BlogEditing.cshtml: Disable PreferredBloggingAPI dropdown when Blogger API is disabled.
  • _Layout.cshtml: Display current commit hash for authorized users; update cookie SameSite policy to Lax.

Inject AppVersionInfo into the layout and add a footer line displaying the current Dasblog-Core commit. The commit hash is shown as a link to the corresponding commit on GitHub, providing users with a direct reference to the running code version.
Introduced ASP.NET Core rate limiting for login attempts, restricting to 10 attempts per 15 minutes per IP. Returns 429 with Retry-After header on limit exceeded. Applied via middleware and controller attribute.
BlogPostViewModelCreator now uses IDasBlogSettings to set AllowComments based on the site's EnableComments configuration. Updated unit tests to mock and inject this dependency.
APIs for Blogger, MetaWeblog, and Moveable Type are now only advertised and enabled if EnableBloggerApi is true. RSD output and XML-RPC endpoints reflect this setting. Admin UI disables PreferredBloggingAPI selection when APIs are unavailable. Unit tests cover both enabled and disabled cases. Minor copyright updates.
Changed MinimumSameSitePolicy from None to Lax in AddDasBlogSecurity to enhance cookie security and help mitigate CSRF attacks.
@poppastring
poppastring merged commit a042138 into main May 8, 2026
3 checks passed
@poppastring
poppastring deleted the improving-support-options branch May 8, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant