Skip to content

feat(core): HTMLy 2026 Modernization Release v3.2.0 - Security, REST API v1, MCP Server, Webhooks, Admin UI & Fixes - #1062

Open
lightnet19 wants to merge 28 commits into
danpros:masterfrom
lightnet19:fix/1058-stale-draft-delete-safety
Open

feat(core): HTMLy 2026 Modernization Release v3.2.0 - Security, REST API v1, MCP Server, Webhooks, Admin UI & Fixes#1062
lightnet19 wants to merge 28 commits into
danpros:masterfrom
lightnet19:fix/1058-stale-draft-delete-safety

Conversation

@lightnet19

@lightnet19 lightnet19 commented Aug 8, 2026

Copy link
Copy Markdown

Summary of Improvements

  1. Stale Draft Deletion Safety Fix (Issue [BUG REPORT] Stale draft whose deletion will cause the deletion of an already published article. #1058): Corrected delete_post() to properly enforce that file deletions are strictly scoped to the /draft/ directory when deleting draft posts. Real path validation and extension constraints prevent accidental deletion of live posts sharing identical filenames with legacy drafts.
  2. 2026 Modernization Guidelines: Added exhaustive blueprints for REST API integrations, security practices, webhooks, and agent tools.
  3. Session & File Security Enhancements: Updated .htaccess, disabled directory listing, forced session expiration, and hardened install.php and upload.php entry points.
  4. REST API v1 Engine: Built an elegant API v1 with Bearer authentication and comprehensive CRUD operations for drafts, posts, categories, and tags.
  5. Model Context Protocol (MCP) Server: Implemented an MCP bridge for secure integration with LLMs and external agent tools.
  6. Robust Webhook System: Added events for content lifecycle actions with payload signing.
  7. Admin UI Improvements: Restructured layout, integrated an automated Setup flow, and added a quick-access Command Palette.

When a draft and a published post share the same filename, deleting
the stale draft entry from the admin draft list could accidentally
remove the already-published file instead of the actual draft.

Root cause: delete_post() validated only that the target file was
inside the /content/ directory, but did not verify it actually
resided in a /draft/ sub-folder when called from a draft-deletion
context.

Changes:
- admin.php: add optional \ parameter to delete_post().
  When true, the function resolves the real file path and aborts if
  the resolved path does not contain '/draft/', preventing any
  non-draft file from being removed through the draft UI.
- admin.php: add .md extension guard so only Markdown content files
  can ever be passed to unlink().
- htmly.php: both delete-post route handlers now detect whether the
  submitted file path contains '/draft/' and forward the resulting
  boolean as \ to delete_post().
…h header handling, and modern security headers
…ini.example & webhooks.ini.example templates
…rden session cookie security (httponly, secure, samesite)
…tion, HTTPS timeout requests, and secure session cookies
@lightnet19 lightnet19 changed the title Fix/1058 stale draft delete safety feat(core): HTMLy 2026 Modernization Release v3.2.0 - Security, REST API v1, MCP Server, Webhooks, Admin UI & Fixes Aug 8, 2026
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