Commit Graph

6889 Commits

Author SHA1 Message Date
Hannah Wolfe
c74f65683e 🎨 Change asset path to /ghost/assets (#7504)
closes #7503

- Update this server-side to serve assets from ghost/assets
- a Ghost-Admin PR changes the client to always request them from there
2016-10-07 17:05:36 -05:00
Austin Burdine
2550cdcac6 Update Ghost-Admin: asset path change 2016-10-07 21:22:26 +00:00
Greenkeeper
8f42678ba6 chore(package): update gulp-nodemon to version 2.2.1 (#7455)
https://greenkeeper.io/
2016-10-07 18:22:04 +01:00
Hannah Wolfe
74b5d67001 ⬆️ deps: bookshelf@0.10.2 2016-10-07 16:44:29 +01:00
Greenkeeper
d6b1b06024 chore(package): update lodash to version 4.16.4 (#7505)
https://greenkeeper.io/
2016-10-07 16:30:18 +01:00
Hannah Wolfe
2ca5bc2f35 Upgrading Casper to 1.3.3 2016-10-07 16:13:33 +01:00
Greenkeeper
4b7d4b6ed7 chore(package): update sqlite3 to version 3.1.6 (#7513)
https://greenkeeper.io/
2016-10-07 11:37:13 +01:00
Katharina Irrgang
f9561eed29 🎨 use nullable(false) for knex schema builder (#7511)
refs #7470
2016-10-07 10:17:39 +01:00
Katharina Irrgang
c8691a85c5 🐛 tests: fix fork config (#7508)
closes #7506
2016-10-06 20:40:01 +01:00
Hannah Wolfe
a98efe1b68 🔥 Remove deprecated pageUrl helper (#7509)
closes #2217

- This helper has been deprecated in favour of `page_url` for more than 2 years!!!
- Ghost 1.0.0 is the end of all of this 💩
2016-10-06 20:47:37 +02:00
Katharina Irrgang
e2e83a0f7b Migration: New database versioning (#7499)
refs #7489

- new database versioning scheme which is based upon the Ghost version, and so easier to reason about
- massive refactor of all the version related code 

Summary of changes:

*   new error: DatabaseNotSeeded
* 🎨  change versioning module
  - versioning is based on Ghost Version
* 🎨  change bootUp file
  - add big picture description
  - version error get's trigger from versioning module
* 🎨  default setting for database version is null
  - very important change: this is caused by the big picture
  - see bootUp description
  - the database version get's set by the seed script later
  - db version is by default null
  - 1. population happens (we ensure that this has finished, by checking if each table exists)   
  - 2. seeds happening (we ensure that seeds happend if database version is set to X.X)
* 🎨  temporary change for population logic
  - set database version after population happens
  - ensure population of default settings happend before
  - both: get's removed in next iteration
* 🎨  adapt tests && mark TODO's
* 🎨  err instance checking
2016-10-06 14:50:55 +01:00
Katharina Irrgang
d81bc91bd2 Error creation (#7477)
refs #7116, refs #2001

- Changes the way Ghost errors are implemented to benefit from proper inheritance
- Moves all error definitions into a single file
- Changes the error constructor to take an options object, rather than needing the arguments to be passed in the correct order.
- Provides a wrapper so that any errors that haven't already been converted to GhostErrors get converted before they are displayed.

Summary of changes:

* 🐛  set NODE_ENV in config handler
*   add GhostError implementation (core/server/errors.js)
  - register all errors in one file
  - inheritance from GhostError
  - option pattern
* 🔥  remove all error files
*   wrap all errors into GhostError in case of HTTP
* 🎨  adaptions
  - option pattern for errors
  - use GhostError when needed
* 🎨  revert debug deletion and add TODO for error id's
2016-10-06 13:27:35 +01:00
Katharina Irrgang
32700a0e5a 🔥 remove all migration files (#7498)
refs #7489
- a simple PR to remove all the old migration files
- remove related tests
2016-10-05 19:57:32 +01:00
Katharina Irrgang
bb07096b9d 🐛 argv config overrides (#7493)
refs #7492

- this is just a temporary solution
2016-10-05 15:55:39 +01:00
Katharina Irrgang
c4e47c9555 🔥 remove implementation of validate themes (#7490)
no issue

- theme validation is handled by gscan
2016-10-05 15:04:03 +01:00
Hannah Wolfe
7dba7b52f8 💄 Misc cleanup in middleware, helpers & apps (#7479)
no issue

- unsued code:
  - there are no public assets anymore, might need to use this instead of shared in future, but for now lets remove it to reduce confusion
  - the `input password` box was incorrectly registered as an admin helper, thinking that was needed in order to render the default template. This isn't needed.
- apps:
  - small structure & comment update to amp app
  - moving input_password helper into private blogging app
  - refactor helpers in subscribers app
2016-10-04 19:09:18 +02:00
vitalie maldur
763305a74d Fix broken troubleshooting link in contributing.md (#7481)
closes #7480
2016-10-04 18:04:18 +01:00
Katharina Irrgang
1882278b5b 🎨 configurable logging with bunyan (#7431)
- 🛠  add bunyan and prettyjson, remove morgan

-   add logging module
  - GhostLogger class that handles setup of bunyan
  - PrettyStream for stdout

-   config for logging
  - @TODO: testing level fatal?

-   log each request via GhostLogger (express middleware)
  - @TODO: add errors to output

- 🔥  remove errors.updateActiveTheme
  - we can read the value from config

- 🔥  remove 15 helper functions in core/server/errors/index.js
  - all these functions get replaced by modules:
    1. logging
    2. error middleware handling for html/json
    3. error creation (which will be part of PR #7477)

-   add express error handler for html/json
  - one true error handler for express responses
  - contains still some TODO's, but they are not high priority for first implementation/integration
  - this middleware only takes responsibility of either rendering html responses or return json error responses

- 🎨  use new express error handler in middleware/index
  - 404 and 500 handling

- 🎨  return error instead of error message in permissions/index.js
  - the rule for error handling should be: if you call a unit, this unit should return a custom Ghost error

- 🎨  wrap serve static module
  - rule: if you call a module/unit, you should always wrap this error
  - it's always the same rule
  - so the caller never has to worry about what comes back
  - it's always a clear error instance
  - in this case: we return our notfounderror if serve static does not find the resource
  - this avoid having checks everywhere

- 🎨  replace usages of errors/index.js functions and adapt tests
  - use logging.error, logging.warn
  - make tests green
  - remove some usages of logging and throwing api errors -> because when a request is involved, logging happens automatically

- 🐛  return errorDetails to Ghost-Admin
  - errorDetails is used for Theme error handling

- 🎨  use 500er error for theme is missing error in theme-handler

- 🎨  extend file rotation to 1w
2016-10-04 16:33:43 +01:00
Kevin Ansfield
dea984565d Version bump to 1.0.0-alpha.3 2016-10-03 19:19:22 +01:00
Kevin Ansfield
75b33d07a9 Updated Ghost-Admin to 1.0.0-alpha.3 2016-10-03 19:19:22 +01:00
Ryan McCarvill
be666b1b1a Update Ghost Editor to 0.0.8 #7429 (#7474)
This release includes:

    Ghost Editor, this is required to get access to the built in cards

Ghost Editor includes:

    Responsive toolbars 🔨 🔧
    Both Ember and Plain javascript cards 🎴
    An embeded HTML card ✍️

This is still an early release, but things are moving in the right direction. :)

We're still defining the spec for the UI, so expect drastic changes over the next couple of weeks.

This is going to be a great writing experience and we can't wait to show what we have planned.
2016-10-03 15:42:34 +01:00
Hannah Wolfe
e40290af5d 🎨 Use GhostAuth name and example emails (#7475)
refs #7452

- remove references to 'patronus' in favour of GhostAuth, Note: this will require databases to be deleted ;)
- remove email addresses from test data
2016-10-03 15:11:43 +01:00
Aileen Nowak
92be253c27 🛠 Gulp help (#7462)
refs #7427
needs #7458

Adds a `gulp help` task which description and available options for each gulp task.
2016-10-03 15:08:40 +01:00
Hannah Wolfe
b1c77a2279 ⏱ 🛠 Add debug@2.2.0 & wire up in key places (#7469)
refs #2001, #7116

- added debug and wired it up:
  - across several key parts of the boot process
  - throughout the middleware loading
  - for requests
  - at render points for key routes
2016-10-03 10:33:14 +02:00
Aileen Nowak
43a2220298 🛠 Gulp lint task (#7458)
refs #7427

Adds a `gulp lint` task, as well as subtasks `gulp jshint`, `gulp jscs` and `gulp json` which can be started independently.
2016-10-03 10:30:22 +02:00
Hannah Wolfe
c87e680764 Upgrading Casper to 1.3.2 2016-10-02 17:58:14 +01:00
Katharina Irrgang
1867e1a75e 🎨 run database population in transaction (#7448)
* 🎨  run database population in transaction

refs #6574, refs #7432

- create transaction for creating tables
- if an error occurs or a container get's destroyed before population finishes, transaction is rolled back

* 🎨  simplify transaction creation and test
2016-09-30 14:05:17 +01:00
Hannah Wolfe
6842259a7a 🛠 Make greenkeeper ignore grunt dependencies (#7463)
closes #7436

- We're moving away from grunt, so lets not worry about version bumps for now
2016-09-30 14:38:14 +02:00
Kevin Ansfield
599d5cf87d Update Ghost-Admin: Ghost OAuth 2016-09-30 12:48:04 +01:00
Katharina Irrgang
6473c9e858 Ghost OAuth (#7451)
issue #7452

Remote oauth2 authentication with Ghost.org.

This PR supports:

- oauth2 login or local login
- authentication on blog setup
- authentication on invite
- normal authentication
- does not contain many, many tests, but we'll improve in the next alpha weeks
2016-09-30 12:45:59 +01:00
Hannah Wolfe
3e727d01f7 Refresh assetHash on theme activation (#7464)
closes #7423

- asset hashes have never been refreshed properly!
- Ghost(Pro)'s 1-theme-only limitation has been hiding this bug for 3 years 🙄
2016-09-30 13:13:16 +02:00
Greenkeeper
45e50820dc chore(package): update mocha to version 3.1.0 (#7447)
https://greenkeeper.io/
2016-09-30 10:58:42 +01:00
Greenkeeper
8255af7a55 chore(package): update knex to version 0.12.2 (#7450)
https://greenkeeper.io/
2016-09-30 10:58:34 +01:00
Aileen Nowak
7f3876e456 🛠 Improve existing gulp tasks (#7444)
refs #7427

- Deleting the `built` or `dist` directory doesn't result in an error, when running `gulp dev`
- Adds default task as `gulp dev`
- Adds abbreviations for the repositories in `gulp setup` task (`--ghost` -> `-g`, `--admin` -> `-a` and `--casper` -> `-c`) to type less 😊
- Installs dependencies on `gulp dev`, if called with `--deps` or `-d`
- Sets `verbose` option nodemon to default (=`false`) to have less unneccessary logging.
- Will do a delete of all dependencies and install them again ('FFS'), if `gulp deps` is called with a force flag.
- Will update submodules not matter what, if `gulp submodules` is called with a force flag. Calling `gulp submodules` without the force flag will only update/initiate the submodules, if the folders don't exist.
- Better logging messages and sequential task handling.
- Removes `gulp-shell` as dependency, as this is on gulp's blacklist
- Refactors code, that used `gulp-shell` to use `child_process.exec` or `spawn` instead.
- Exits properly if node crashes
-----------------------

Tasks available after this PR:

- `gulp server`: Starts a nodemon server with livereload of the ghost core only. No client build here.

- `gulp dev`: [ --deps | -d ] Starts development mode for Ghost, incl. client build and livereload for both. Will also update the submodules if the directories are missing. If called with with `--deps` flag, it will install client and core dependencies.

- `gulp submodules`: [ --force | -f ] Will update the submodules, if directories are missing. Will update no matter what, if called with force flag.

- `gulp deps`: [ --force | -f ] Will update client and core dependencies. Does a fresh install of both (delete, cache clear and install) if called with force flag.

- `gulp setup`: </br>[ --ghost | -g 'branch' or 'pr/1234' ]
		[ --admin | -a 'branch' or 'pr/1234' ]
		[ --casper | -c 'branch' or 'pr/1234' ]
		[ --force | -f ]
		Takes various - optional - parameters. If called without parameters, this task will update submodules first (if directory doesn't exist) and then install client and core dependendies.
		If called with branch 'master', submodules will be updated.
		Calling with the force flag will do a clean install of the dependencies.
		There's no autocomplete for branchnames at the moment 😔
		To check out a PR (e. g. `--ghost pr/7444`), it is necessary, that you add an additional fetch line in the `.git/config` file for each repository: `fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*`. See https://dev.ghost.org/easy-git-pr-test/ for further information.
2016-09-29 19:32:17 +02:00
Sebastian Gierlinger
02c7d039d8 Merge pull request #7446 from kirrg001/fix/circular-dependency-bootup
🐛  fix circular dependency in new bootUp script
2016-09-27 13:10:07 +02:00
kirrg001
d0356a257e 🐛 fix circular dependency in new bootUp script
closes #7440
2016-09-27 12:18:45 +02:00
kirrg001
1a93cfd67e Version bump to 1.0.0-alpha.2 2016-09-26 19:22:11 +02:00
kirrg001
5e8baace22 Updated Ghost-Admin to 1.0.0-alpha.2 2016-09-26 19:22:11 +02:00
Aileen Nowak
3ee7f5cdbd 🛠 Gulp setup (#7439)
refs #7427

With this PR, we'll get some development tooling magic:
`gulp setup`
Will update dependecies and submodules (if submodule branches are on master) for
currently chosen branches.

`gulp setup --force`
Will delete all dependencies and install them again, incl. submodules for
currently chosen branches.

`gulp setup --ghost some-branch --admin some-branch --casper some-branch`
Will checkout the branches for each repository.
Can also be used to checkout only selected branches e. g.
`gulp setup --admin some-branch`
Will leave the current branch for `ghost` and `casper`, but checkout the named
branch for admin. Will also install dependencies.

`gulp setup --admin pr/123 --ghost pr/1234 --casper pr/123`
Will fetch the named PR of the repository and checkout to this new branch.
Will also install dependencies. NOTE: This works only with an additional fetch line
in the .git/config file for each repository: `fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*`.
See https://dev.ghost.org/easy-git-pr-test/ for further information.

All the combinations above can be executed with the `--force` or `-f` flag, which
will delete the dependencies and install them again, but for the chosen branches.
2016-09-26 18:17:40 +02:00
Ryan McCarvill
7edc518d5a [WIP] Mobile-Doc based renderer (#7437)
Refs #7429

Added mobile-doc renderer

------------

- Added generic mobiledoc-renderer
- Kept the existing showdown editor for legacy mode.
2016-09-26 15:23:49 +02:00
Hannah Wolfe
6c24084e68 Merge pull request #7422 from kirrg001/feature/users-invites-separation
🎨  Separate invites from user

refs #7420

- remove invite logic from user
- add invite model and adapt affected logic for inviting team members
2016-09-26 13:26:01 +01:00
Hannah Wolfe
b729597bf5 🔥 Remove the contributor list from Gruntfile (#7428)
refs #7427

- Moving all release-specific code out of the core repository
- Also found a different way to do this, without needing API access :)
2016-09-26 07:16:55 -05:00
Greenkeeper
f0a4186f9c chore(package): update intl to version 1.2.5 (#7411)
https://greenkeeper.io/
2016-09-26 11:13:38 +02:00
Hannah Wolfe
b0af496c98 💄 Ensure all middleware use named functions (#7434)
no issue

- anonymous functions are hard to debug in memory traces etc
- having anonymous middleware functions makes it hard to inspect or debug the middleware stack (something I like to do)
- these 2 are the only ones atm, including all 3rd party middleware
2016-09-26 11:10:44 +02:00
kirrg001
b79a18ca8f 🎨 Separate invites from user
refs #7420
- remove invite logic from user
- add invite model and adapt affected logic for inviting team members
2016-09-26 11:08:43 +02:00
Hannah Wolfe
6d092ada99 Merge pull request #7402 from kirrg001/tooling/latest-lodash-bookshelf-knex
🛠  update lodash,knex and bookshelf to latest versions
2016-09-26 09:39:57 +01:00
kirrg001
6c100a171e 🛠 update lodash,knex and bookshelf to latest versions
refs #7189
- we had a memory leak after upgrading to knex 0.11.x
- knex has published a new version 0.12.x
- the memory leak does not longer exists
- knex has reverted their pool logic, see https://github.com/tgriesser/knex/pull/1665
2016-09-26 10:20:55 +02:00
Hannah Wolfe
1c6f9b85f4 Merge pull request #7407 from AileenCGN/let-grunt-die
🛠 Gulp tooling for Ghost
2016-09-23 13:46:42 +01:00
Greenkeeper
34363ec2c3 chore(package): update superagent to version 2.3.0 (#7413)
https://greenkeeper.io/
2016-09-23 13:58:11 +02:00
Hannah Wolfe
264661ee09 🐛 Refresh assetHash on theme override (#7430)
closes #7423

- Extend our dirty theme override cache clear hack to also reset the asset hash
_ This brings alpha into line with the LTS branch
- This still needs a rewrite for Ghost 1.0.0 🙄
2016-09-23 13:05:44 +02:00