postnhost 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +27 -0
  4. data/app/assets/builds/postnhost/application.css +1 -1
  5. data/app/controllers/postnhost/api/base_controller.rb +34 -0
  6. data/app/controllers/postnhost/api/v1/commands_controller.rb +27 -0
  7. data/app/controllers/postnhost/api/v1/mcp_controller.rb +53 -0
  8. data/app/controllers/postnhost/api_tokens_controller.rb +34 -0
  9. data/app/controllers/postnhost/articles/translations_controller.rb +2 -9
  10. data/app/controllers/postnhost/articles_controller.rb +5 -6
  11. data/app/controllers/postnhost/categories/translations_controller.rb +2 -9
  12. data/app/controllers/postnhost/management_preview_controller.rb +17 -0
  13. data/app/controllers/postnhost/oauth/authorizations_controller.rb +50 -0
  14. data/app/controllers/postnhost/oauth/metadata_controller.rb +25 -0
  15. data/app/controllers/postnhost/oauth/public_controller.rb +16 -0
  16. data/app/controllers/postnhost/oauth/registrations_controller.rb +29 -0
  17. data/app/controllers/postnhost/oauth/tokens_controller.rb +19 -0
  18. data/app/controllers/postnhost/pages/translations_controller.rb +2 -9
  19. data/app/controllers/postnhost/sessions_controller.rb +2 -1
  20. data/app/models/postnhost/api_token.rb +26 -0
  21. data/app/models/postnhost/oauth_client.rb +29 -0
  22. data/app/models/postnhost/oauth_grant.rb +32 -0
  23. data/app/models/postnhost/user.rb +3 -0
  24. data/app/services/postnhost/api/v1/openapi.rb +27 -0
  25. data/app/services/postnhost/management/catalog.rb +151 -0
  26. data/app/services/postnhost/management/command.rb +174 -0
  27. data/app/services/postnhost/management/content_actions.rb +75 -0
  28. data/app/services/postnhost/management/input.rb +49 -0
  29. data/app/services/postnhost/management/mcp.rb +54 -0
  30. data/app/services/postnhost/management/preview.rb +25 -0
  31. data/app/services/postnhost/management/resources.rb +30 -0
  32. data/app/services/postnhost/management/schema_fields.rb +25 -0
  33. data/app/services/postnhost/management/serializer.rb +40 -0
  34. data/app/services/postnhost/management/settings_actions.rb +64 -0
  35. data/app/services/postnhost/management/upload.rb +18 -0
  36. data/app/services/postnhost/translation/enqueue.rb +59 -0
  37. data/app/views/layouts/postnhost/_sidebar.html.erb +7 -0
  38. data/app/views/postnhost/api_tokens/index.html.erb +92 -0
  39. data/app/views/postnhost/oauth/authorizations/new.html.erb +18 -0
  40. data/config/routes.rb +21 -0
  41. data/db/migrate/20261008120000_create_api_tokens.rb +12 -0
  42. data/db/migrate/20261025120000_add_mcp_oauth.rb +23 -0
  43. data/lib/postnhost/engine.rb +7 -0
  44. data/lib/postnhost/oauth_discovery.rb +22 -0
  45. data/lib/postnhost/version.rb +1 -1
  46. metadata +32 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1558c66e1ac90ab08507a78ffea0bac3294003f1ac89107090a2e0dd27e234d8
4
- data.tar.gz: 95d7eaa5879b8b964c21a50b73ee87a941b577341b6a0a55f824fb7bdbedc1eb
3
+ metadata.gz: eeff5b8e47da4271aa4b1b5240c98fa2e5fcf89ef59ea86f775c41c7fbf3c64e
4
+ data.tar.gz: 8784beb69048bba221cfbda8306a57eb1366b470996b02b4325bb2dec8feaacc
5
5
  SHA512:
6
- metadata.gz: 54a365175843db9416fa0be1725e0acd6cc86574b81f8b8e6dccec2c4dc029161998bbd9901d1ed0c62768f30a46234b622b533395211f63d23592cd4910267c
7
- data.tar.gz: 759fec551c44bd9060c87d183468aed04875881733e163262bf01100562837f2b6c1999379a80204ce1e5b603d26a0f1e36f74510173349d9a0596ffed0e8cfb
6
+ metadata.gz: 8317f464ba035086b326e0537c157f8957ad250080201d32af7e74955e0909e546f59e13bf2dfcbdd648e4476be75a3bbf6dea0fcee4df3ed90a47fb04c718d0
7
+ data.tar.gz: db9ff2f49ee7727d9e8156288de193e01992eef8f0b1cf06aa59fe9a41339b46bc8d5370d9c1cf72f45edceaeac8953bc8dcfd36b717c8194090b443a199dac1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  All notable changes to PostnHost are documented in this file.
4
4
 
5
+ ## [0.2.1] - 2026-11-03
6
+
7
+ ### Fixed
8
+
9
+ - Show all users' articles in the CMS article list and suggestion picker, including articles whose creator has been deleted.
10
+ - Preserve shared article suggestions when the editor displays validation errors.
11
+
12
+ ## [0.2.0] - 2026-10-24
13
+
14
+ ### Added
15
+
16
+ - Versioned JSON management API and Streamable HTTP MCP endpoint at `/api/v1/mcp`, relative to the engine mount path.
17
+ - 89 shared commands for CMS content, publishing, versions, uploads, translations, users, navigation, and settings, with command discovery and OpenAPI schemas.
18
+ - API & MCP dashboard for creating and revoking personal bearer tokens, with hashed token storage and one-time secret display.
19
+
20
+ ### Improved
21
+
22
+ - Paginated management lists use compact summaries and bounded database queries; full content remains available through individual record commands.
23
+ - UI and management commands share translation enqueueing, preserving successfully queued work and cleaning up placeholders when enqueueing fails.
24
+
25
+ ### Upgrading existing blogs
26
+
27
+ From your host application's directory, update any Gemfile constraint to allow PostnHost 0.2.0, then run:
28
+
29
+ ```bash
30
+ bundle update postnhost
31
+ bin/rails postnhost:install:migrations
32
+ bin/rails db:migrate
33
+ ```
34
+
35
+ Commit the copied `db/migrate/*_create_api_tokens.postnhost.rb` migration and updated schema with your application. During production deployment, run `RAILS_ENV=production bin/rails db:migrate` before restarting the app.
36
+
37
+ The new `CreateApiTokens` migration creates the `postnhost_api_tokens` table. Existing blog content requires no backfill.
38
+
5
39
  ## [0.1.1] - 2026-08-31
6
40
 
7
41
  ### Fixed
@@ -29,5 +63,7 @@ First open source release of PostnHost.
29
63
 
30
64
  Authored by Kirill Shevchenko (Ruby/Rails engineering) and Maxim Sova (technical SEO expertise).
31
65
 
66
+ [0.2.1]: https://github.com/postnhost/postnhost/compare/v0.2.0...v0.2.1
67
+ [0.2.0]: https://github.com/postnhost/postnhost/compare/v0.1.1...v0.2.0
32
68
  [0.1.1]: https://github.com/postnhost/postnhost/compare/v0.1.0...v0.1.1
33
69
  [0.1.0]: https://github.com/postnhost/postnhost/releases/tag/v0.1.0
data/README.md CHANGED
@@ -42,6 +42,7 @@ Mount this engine into an existing Rails app, or use the <a href="https://github
42
42
  - [Replacing favicon](#replacing-favicon)
43
43
  - [Host app i18n](#host-app-i18n-optional)
44
44
  - [Static pages](#static-pages-terms-privacy-etc)
45
+ - [API and MCP](#api-and-mcp)
45
46
  - [Routes](#routes)
46
47
  - [Production checklist](#production-checklist)
47
48
  - [Development](#development)
@@ -295,6 +296,32 @@ Link helpers:
295
296
  <%= link_to "Terms", postnhost.public_static_page_path(slug: "terms") %>
296
297
  ```
297
298
 
299
+ ## API and MCP
300
+
301
+ Manage CMS content and settings through the versioned JSON command API and the
302
+ Streamable HTTP MCP endpoint. Open **API & MCP** in the CMS to create or revoke
303
+ bearer tokens. The API and MCP share the same discoverable commands, input schemas,
304
+ and publishing workflows.
305
+
306
+ Discover commands at `/api/v1/commands`, OpenAPI at `/api/v1/openapi`, and
307
+ connect MCP clients to `/api/v1/mcp`, relative to the engine mount path.
308
+
309
+ MCP clients can authenticate through OAuth: add the endpoint URL, sign in to the
310
+ CMS in your browser, and approve the connection. OAuth grants full CMS access
311
+ with a single `mcp` scope. Access tokens do not expire; revoke individual
312
+ connections under **API & MCP**. No refresh tokens or copied secrets are needed.
313
+ Existing manually created bearer tokens remain supported.
314
+
315
+ The engine provides client registration, authorization-code exchange with S256
316
+ PKCE, and discovery metadata. Authorization codes expire after five minutes and
317
+ can only be used once. OAuth access tokens are bound to the MCP endpoint.
318
+ After upgrading, install and run the new engine migration:
319
+
320
+ ```bash
321
+ bin/rails postnhost:install:migrations
322
+ bin/rails db:migrate
323
+ ```
324
+
298
325
  ## Routes
299
326
 
300
327
  The engine mounts at `/blog` by default. You can change this in `config/routes.rb`: