Commit Graph

442 Commits

Author SHA1 Message Date
Hannah Wolfe
bc29b14cde Merge pull request #1728 from mjbshaw/clean-admin-regex
Don't use unnecessary (and unescaped) regex
2013-12-22 07:46:31 -08:00
Michael Bradshaw
7ee3235a68 Don't use unnecessary (and unescaped) regex
closes #1731
2013-12-21 16:32:57 -07:00
Hannah Wolfe
a0424a733d Date helper fix, moment breaks with null values
fixes #1730
2013-12-21 21:43:38 +00:00
Hannah Wolfe
e9e99371a6 Merge pull request #1719 from ErisDS/fix-1718
Fix unhandled errors in mail.js
2013-12-21 12:51:35 -08:00
Hannah Wolfe
bdbeffb262 Merge pull request #1716 from ErisDS/post-order
API refactor / cleanup
2013-12-21 12:46:57 -08:00
Sebastian Gierlinger
17225d4928 Set cookie secure flag
closes #1680
- added secure flag for cookies if SSL is forced
2013-12-21 20:18:13 +00:00
Fabian Becker
c81c43a96a Complete subdir support.
fixes #527
- Fix image upload in backend
- Use config.paths().webroot where necessary
2013-12-21 19:43:58 +00:00
Hannah Wolfe
9ec7e4ea38 Merge pull request #1615 from gotdibbs/Issue1227
Switch from multipart to busboy
2013-12-21 10:25:05 -08:00
Hannah Wolfe
78737b35ff API refactor / cleanup
closes #1303

- removed where and orderBy from being passed from the API through to bookshelf, and ultimately knex
- ordering is now consistent across both front and backend, which fixes #1303
- validated / cleaned up all the API parameters
- added API tests for the status and staticPages parameters
2013-12-20 13:07:01 +00:00
Hannah Wolfe
3863f09c5c Fix unhandled errors in mail.js
fixes #1718

- check for existence of mail before using properties
- return the promise properly
2013-12-20 12:57:21 +00:00
Hannah Wolfe
c518e14bfb Merge pull request #1687 from sebgie/issue#1685
Fix 'dbHash' not found
2013-12-20 04:36:44 -08:00
John O'Nolan
fd2a2ad037 Update Ghost logo image fixture 2013-12-19 15:21:26 +00:00
Hannah Wolfe
9c96ec1990 Merge pull request #1677 from nickpfisterer/default-fixture-update
Update default fixture to give clearer direction
2013-12-19 07:07:46 -08:00
William Dibbern
bf7692b151 Switch from multipart to busboy
Fixes #1227

- Removed deprecated `multipart` references.
- Setup `busboy` to pass along file streams and do a naive parse of form
values.
- Updated logic in file storage and db import to handle file streams
instead of the temporary files created by `multipart`.
2013-12-17 17:24:30 -06:00
Sebastian Gierlinger
05ca5edeeb Remove fixed scheme from gravatar url
no issue
- removed scheme from gravatar url

Reason:
Gravatar supports ssl and the fixed scheme will cause ‚insecure
content‘ warnings.
2013-12-17 17:21:00 +01:00
Nick Pfisterer
f7e63eecaa Update default fixture to give better direction
closes #1561
- altered perspective of intro paragraph to reading from the blog
instead of from the content page
- added copy directing users to sign in to the admin area at /ghost/ and
edit the post before reading the 'Getting Started' section
- this should give the Markdown lessons better context and avoid users
getting confused as to what 'the left hand panel of Ghost' is
2013-12-16 18:18:35 -08:00
Sebastian Gierlinger
7ae543289d Fix 'dbHash' not found
closes #1685
- changed dbHash initialization from db direct access to api access
- added dbHash to default-settings.json
- added dbHash to tests
2013-12-16 11:16:06 +01:00
Hannah Wolfe
1c52e3a980 Merge pull request #1636 from hswolff/standardize-path-access
Standardize file path access throughout ghost
2013-12-15 06:42:34 -08:00
Hannah Wolfe
088dac6099 Merge pull request #1675 from sebgie/issue#1640
Improve Helpers
2013-12-15 03:41:03 -08:00
Hannah Wolfe
db362b30cd Bug fixes, undefined should not be a string 2013-12-15 11:36:01 +00:00
Patrick Garman
a914077145 Add Force SSL Configuration/Middleware
Solves #1300
- Adds forceAdminSSL bool config value
- Adds checkSSL middleware
- Adds redirectSSL helper function
2013-12-15 10:01:02 +00:00
Sebastian Gierlinger
05810b318c Improve Helpers
closes #1640
closes #1672
- changed to include config using require
- deleted has_tag helper
- deleted json helper
- removed fileStorage and ghostScriptTags helpers from frontend
- added fileStorage and url helper to admin
2013-12-14 17:28:54 +01:00
Hannah Wolfe
51b9f8972b Merge pull request #1662 from PaulAdamDavis/master
Fixed admin 404 page broken image refrence
2013-12-13 15:11:44 -08:00
Hannah Wolfe
409cc34c1d Merge pull request #1651 from hswolff/issue-1645
Update config.theme() after every settings edit
2013-12-13 15:05:18 -08:00
Harry Wolff
9090764052 Standardize file path access throughout ghost
resolves #1390

update all string based references to file paths
to use the ./core/server/config/paths file
so that it is the single source of truth
2013-12-12 21:27:07 -05:00
Hannah Wolfe
968176c7d7 Merge pull request #1606 from Gotvitch/issue1203
Bug fixes for partial views
2013-12-12 14:36:47 -08:00
Paul Adam Davis
c1b1b7ace9 Fixed admin 404 page broken image refrence 2013-12-12 21:21:58 +00:00
Seb Gotvitch
fef9b4be25 Bug fixes for partial views
closes #1203
- Update express-hbs module to the new version (0.5.2)
- Use two instance of hbs one for the theme and an other for the admin
- Template helpers are register as partial view
- Partial views of the theme are reload when the theme changed

Remove clear partial cache in handlebars

This code will be move in `express-hbs`.
This doesn't cause a problem to remove this line but it is not clean.

Remove unused hbs instance

Resolve conflict
2013-12-12 12:11:02 -05:00
Sebastian Gierlinger
acce957f7e Change message when unsupported node version is used
no issue
- changed ‚the latest‘ to ‚a supported‘

Reason: the user is asked to update to the **latest** version of
node.js when v0.11.* is installed but v0.10.* is required
2013-12-12 17:47:35 +01:00
Harry Wolff
058b82bba1 Update config.theme() after every settings edit
fixes #1645

- removes server.get('ghost root') as it is only an alias
to config.paths().path, and adds unnecessary indirection
- removes config.theme().path as its just an alias to
config.paths().path, updated all relevant references
- update config.theme.update to only require the api/settings object,
and no longer need the config object
- modify api/settings.edit to call config.theme.update so that
the themeObject is ready for next rendering of template
2013-12-12 08:25:08 -05:00
Harry Wolff
9bbf400dfc Fix loading of static pages in frontend controller
fixes #1644

- Fixes bug in controller/frontend
- Created functional test for posts API to test for this bug
- Created unit tests for frontend controller
- Fixed a global variable leak in core/test/utils/fixtures/data-generator
that was leaking the DataGenerator globally
- Resolved issue that arose from fixing above bug
2013-12-09 22:38:25 -05:00
Harry Wolff
c8c02a65fa Remove ghost.js
fixes #1575
- Moves most code that was in ghost.js into ./core/server/index.js
- Creates ./core/server/config/theme.js to hold all theme configurations 
(which previously lived on ghost.blogGlobals())
- Removed ghost.server, passing it in as an argument where needed 
and allowing middleware to hold onto a reference for lazy use.
2013-12-07 10:10:02 -05:00
Sebastian Gierlinger
078f464197 remove ghost.settings and ghost.notifications
covers 90% of #755
- moved ghost.settings to api.settings
- moved ghost.notifications to api.notifications
- split up api/index.js to notifications.js, posts.js, settings.js,
tags.js and users.js
- added instance.globals as temp workaround for blogglobals (Known
issue: blog title and blog description are updated after restart only)
- added webroot to config() to remove `var root = ...`
- changed `e` and `url` helper to async
- updated tests
2013-12-06 09:51:35 +01:00
Hannah Wolfe
696cfe7018 Swap url.resolve for slash handling 2013-12-04 21:20:24 +00:00
Hannah Wolfe
d2d9db3067 Add url.resolve for password reset email url
fixes #1604
2013-12-01 17:46:10 +00:00
Hannah Wolfe
d69e87b625 Merge pull request #1594 from halfdan/1591-excerpt-helper
Fix excerpt/content helpers
2013-11-30 10:16:26 -08:00
Hannah Wolfe
7c3031507d Merge pull request #1593 from ErisDS/app-proxy-update
Direct api access for app proxy
2013-11-30 10:15:20 -08:00
Hannah Wolfe
4765ca2cce Merge pull request #1589 from javorszky/iss499
Adds login limiter
2013-11-30 10:14:55 -08:00
Fabian Becker
5c1091af10 Fix excerpt/content helpers
fixes #1591
- Convert quoted strings to numbers
- Update code examples
- Update helper tests
2013-11-29 18:58:58 +00:00
Hannah Wolfe
ed6455f5a4 Direct api access for app proxy
- proxy doesn't need a ghost object :)
2013-11-29 16:26:56 +00:00
Gabor Javorszky
c515e20ea3 Adds login limiter
Closes #499
* On wrong passwords, statuses: `active` -> `warn-1` -> `warn-2` -> `warn-3` -> `locked`
* On login check, if user's status is `locked`, login automatically fails and user is encouraged to reset password. Does not even bother to check for passwords.
* login attempts tell user how many attempts she has remaining in notification box
* successful login will reset status to `active`
* resetting password with forgotten password emailed token resets status to `active`
* complete with a test suite
2013-11-29 01:24:25 +00:00
Jakob Gillich
30861fbab8 Permalinks live reloading support
issue #1395
2013-11-28 21:24:31 +01:00
Hannah Wolfe
dedc5d9239 Update activeTheme path on theme switch
fixes #1583

- the active theme path wasn't getting updated when we were switching theme
2013-11-28 16:10:34 +00:00
Harry Wolff
37b2fd93d8 This commit removes a lot of code from ghost.js, including:
Move helper functions registerThemeHelper and registerAsyncThemeHelper
to the helpers module.
Also update the app proxy object to reflect this new code location,
and the tests to reflect that as well

Create ./sore/server/filters which houses all filter related behavior.
Was previously on the ghost singleton.
Also create the filters_spec file for testing
and update all code and tests to use new code location.

Create ./sore/server/helpers/template which houses all template related behavior.
Was previously on the ghost singleton.
Also create the helpers_template_spec file for testing
and update all code and tests to use new code location.

Move ghost.mail instance onto the mail module directly
and update related code and tests to use new location

Move Polyglot instance onto require module directly

Move ghost.availablePlugins to plugins module directly
2013-11-28 09:21:53 -05:00
enahs
dddf2ec5b2 More verbose error message for invalid JSON in config.js
if you enter an invalid json object such as:
```
{
server: "http://foo.com"
host: "0.0.0.0"
}
```
while configuring, you get errors but are still able to run forever and the message previously was not as indicative of other potential configuration problems.
2013-11-28 13:58:28 +00:00
rektide
42dc8b4a8f Accept a config filename as an optional parameter to Ghost start-up.
Closes #1110.
- Promotes config-loader from a validator, to the central place where configuration state is held
- Allow config-loader two means to be told of config file to be used:
  - A preferred first argument passed into Ghost
  - A secondary GHOST_CONFIG environmental variable
- Failing to see either of the above passed in, config-loader will continue to use "config.js"
- Config-loader validates the target configuration (unchanged) & then copies that object into it's own exports
- Components needing to read configuration now require config-loader to retrieve the configuration state
- Config file continues to be loaded via require(): this is assumed to be a static json file
2013-11-28 13:47:00 +00:00
Hannah Wolfe
7b2bf5b98c Merge pull request #1577 from halfdan/527-subdir-admin
Fix Admin interface with sub directories
2013-11-28 05:14:23 -08:00
Hannah Wolfe
6bb92b4394 Swapping url.resolve back out 2013-11-28 13:03:05 +00:00
Hannah Wolfe
76f3730427 Bug fixes for paths / windows & tests
- removed path.join used for urls
- made sure async tests fail/timeout correctly
2013-11-28 11:21:49 +00:00
Harry Wolff
89154ad997 Restore support for using ghost as a npm module fixes #1326 2013-11-27 17:39:14 +00:00