Home

>

Tools

>

Ghost

>

Releases

>

1.0.0-alpha.5

Ghost Release: 1.0.0-alpha.5

Pre Release

Tag Name: 1.0.0-alpha.5

Release Date: 10/18/2016

Ghost LogoGhost

Open-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.

TL;DR

Ghost 1.0.0-alpha.5 introduces significant architectural improvements with the new knex-migrator for database management, Express app refactoring for better performance, and enhancements to the editor including a new markdown card. This alpha release focuses on code organization, middleware optimization, and improved token handling, making Ghost more modular and maintainable as it progresses toward version 1.0.0.

Highlight of the Release

    • Introduction of knex-migrator for database management outside of Ghost core
    • Major Express app refactoring with separation into admin, blog, and API apps
    • New markdown card added to the editor
    • Unified token endpoint for all authentication flows
    • Improved error handling and logging

Migration Guide

Migrating to knex-migrator

If you've been using Ghost's internal database migration system, you'll need to adapt to the new knex-migrator package:

  1. The database initialization process has changed significantly
  2. The bootup script has been removed in favor of knex-migrator
  3. If you have custom database migrations, they will need to be adapted to the new format

Authentication Endpoint Changes

  • The /authentication/ghost endpoint has been removed
  • All authentication flows (password, refresh token, and ghost.org authorization code) now use /authentication/token
  • If you're using the Ghost authentication API directly, update your code to use the unified endpoint with the appropriate grant_type

Express App Structure Changes

If you've built custom middleware or extensions that rely on Ghost's middleware structure:

  1. The middleware/index.js file has been removed
  2. Code is now organized into separate Express apps (admin, blog, API)
  3. Error handling is now specific to each app type (HTML vs JSON)
  4. Review the new structure in server/app.js to understand how to integrate your code

Upgrade Recommendations

As this is an alpha release (1.0.0-alpha.5), it is not recommended for production use. This release is strictly for development and testing purposes only.

Developers interested in testing the new features and providing feedback should:

  1. Install in a development environment separate from production
  2. Test the new database initialization with knex-migrator
  3. Explore the new Express app architecture
  4. Try out the new markdown card in the editor

If you're currently using a previous alpha version (1.0.0-alpha.4), upgrading to this version is recommended to test the latest improvements and provide feedback to the Ghost team.

For production blogs, continue using the latest stable release (0.11.x) until Ghost 1.0.0 is officially released.

Bug Fixes

Authentication & Security

  • Fixed token expiration time to correctly return seconds (3600) instead of a JavaScript date representation
  • Improved URL validation for subscriber forms to prevent invalid submissions

Error Handling

  • Fixed error output format for standalone errors
  • Ensured proper body printing of standalone errors in logs
  • Fixed uncapitalize middleware to correctly use request properties

Database & Models

  • Fixed issues with creating tables when running initialization twice
  • Improved Gravatar handling to prevent crashes when environment variables are undefined
  • Fixed User model status checks

Scheduling

  • Decreased timeout for scheduling to fix Travis CI issues
  • Modified scheduled post fetching to remove problematic filters

New Features

Database Management

  • Added knex-migrator as a dependency to handle database initialization outside of Ghost core
  • Removed the internal "sephiroth" database migration system in favor of the new npm package
  • Improved database initialization with better error handling and migration capabilities

Editor Enhancements

  • Added a new markdown card to the mobiledoc editor
  • Integrated CodeMirror for the HTML editor to improve code editing experience
  • Fixed scrolling issues in the editor

Authentication Improvements

  • Consolidated authentication endpoints into a single /authentication/token endpoint
  • Added support for the authorization_code grant type
  • Improved token handling and expiration time management

Architecture Improvements

  • Introduced separate Express apps for admin, blog, and API
  • Co-located related code in dedicated directories (/admin, /blog)
  • Added independent error handling for HTML and API JSON responses

Security Updates

No specific security fixes were mentioned in this release. The improvements to URL validation for subscriber forms could be considered a security enhancement, but it wasn't explicitly labeled as a security fix in the commit messages.

Performance Improvements

Middleware Optimization

  • Removed the monolithic middleware/index.js file in favor of modular app-specific middleware
  • Optimized bodyParser usage to only include it where necessary
  • Grouped static/asset-related middleware together for better organization

Model Improvements

  • Registered events in the base model instead of individual models
  • Improved User model with parallel execution of onSaving tasks
  • Optimized password handling in the User model

Error Handling

  • Separated error handling for HTML and API JSON responses
  • Improved error inheritance from GhostError prototype
  • Added code property to errors for better error identification

Impact Summary

Ghost 1.0.0-alpha.5 represents a significant step forward in the architectural evolution of Ghost as it moves toward version 1.0.0. The most impactful changes are:

  1. Database Management: The introduction of knex-migrator as an external dependency provides a more robust and maintainable way to handle database migrations and initialization.

  2. Express App Architecture: The refactoring of Ghost's middleware into separate Express apps (admin, blog, API) creates a more modular and maintainable codebase with clearer separation of concerns.

  3. Authentication Flow: The consolidation of authentication endpoints and improved token handling simplifies the authentication process and fixes issues with token expiration.

  4. Editor Improvements: The addition of the markdown card and CodeMirror integration enhances the content creation experience.

These changes lay important groundwork for Ghost 1.0.0, making the codebase more maintainable and modular while improving the developer and user experience. The focus on architectural improvements in this alpha release demonstrates Ghost's commitment to building a solid foundation for future development.

Full Release Notes

This is the fifth of a series of weekly alpha builds we'll be releasing as we work towards Ghost 1.0.0.

This release is strictly for development and testing only, and must not be used for production blogs

This alpha contains:

  • add knex-migrator dependency to run database initialisation outside of Ghost (https://github.com/TryGhost/knex-migrator)
  • updates to the new editor: added markdown card
  • refactorings in Ghost: middleware factoring, express app refactoring
  • optimisations for Ghost token handling
  • lot's of small bug fixes

You can read more about our plans for Ghost v1.0 and the v0.11 LTS version in the LTS blog post. There's also more information on the alpha page.

You can see the full change log for the details of every change included in this release.

Statistics:

File Changed127
Line Additions3,460
Line Deletions1,797
Line Changes5,257
Total Commits39

User Affected:

  • New database initialization system using knex-migrator
  • Improved middleware organization and Express app architecture
  • Better token handling and authentication flow
  • More modular codebase with clearer separation of concerns

Contributors:

kirrg001greenkeeperio-botErisDSkevinansfielddisordinary