Commit Graph

1328 Commits

Author SHA1 Message Date
Sebastian Gierlinger
81f119d098 Merge pull request #5888 from ErisDS/improve-fileserve
Serve immediate 404 for static files (no fallthru)
2016-02-23 17:15:21 +01:00
Hannah Wolfe
dcc8bcc4f1 Strutured data: Slack Unfurls & published_at fix
refs #6534

- fixes a bug where published_at was incorrectly falling back to the created_at date
- updated meta index to get author name
- add written by & filed under labels + data if the values are present (only on posts/pages)
- updated tests
2016-02-22 01:45:00 +01:00
Hannah Wolfe
a59cfc70a1 Serve immediate 404 for static files (no fallthru)
closes #5887

- make use of the new 'fallthrough' option which landed in express-static 1.10.0
- change local-file-store and middleware serving `/public/` and `/shared/` files to use the new `fallthrough: false` option
- 404s are now served directly, without slashes or uncapitalise getting triggered
2016-02-21 19:17:27 +00:00
Hannah Wolfe
d7b9eb6176 Fix facebook/twitter/schema description
refs #6534

- this is an initial fix for having no description at all unless a meta description is provided
- we may need to tweak the lengths / provide different lengths for different values in future
2016-02-18 12:11:46 +00:00
Hannah Wolfe
cdbec7a8ba Merge pull request #6532 from jaswilli/issue-6491
Provide entire model to validator
2016-02-18 09:12:06 +00:00
Hannah Wolfe
71062a0026 Merge pull request #6517 from halfdan/fix-6516
Use req.path instead of req.url to check for file extension
2016-02-18 08:37:32 +00:00
Hannah Wolfe
d1b56c23fe Merge pull request #6507 from cameronviner/6505
Clean up the after the shouldjs upgrade tests closes #6505
2016-02-18 07:44:23 +00:00
Jason Williams
b10da0569a Provide entire model to validator
Closes #6491
2016-02-17 17:30:16 -06:00
Fabian Becker
f14910fa8e Use req.path instead of req.url to check for file extension
fixes #6516
2016-02-17 19:24:49 +01:00
Hannah Wolfe
02199c6b02 Disambiguate between error code & status code
refs #6526

- Change our errors to use `statusCode` for the status code (like res.statusCode)
- Use statusCode for anything that's supposed to be the statusCode, rather than an error idenfier/code
- Update all the tests that check the key
- Route tests don't need fixing as the status codes are still returned correctly
2016-02-17 15:20:49 +00:00
Cameron Viner
8fd272476b Removed uneeded jshint comments in order to cleanup the tests
closes #6505
-Removed all of the /*jshint expr:true*/ comments from the tests
-Removed all of the should.equal(true, true) statements from the tests
-Removed should from the greenkeeper ignores
2016-02-17 12:52:43 +00:00
Hannah Wolfe
c301510cd1 Refactor gravatarLookup, remove request dependency
no issue

- request is quite a heavy dependency
- we were only using request in 3 places: a test, storing contrib images in the gruntfile & the gravatar lookup
- all 3 are relatively simple to do with the http/https module
- refactored all 3, removed request
2016-02-16 11:12:01 +00:00
Sebastian Gierlinger
3c5c5ad9d0 Merge pull request #6469 from ErisDS/dynamic-channel-routing
Dynamic channel routing
2016-02-15 19:27:41 +01:00
Hannah Wolfe
13c1742eb9 Make frontend routing dynamic & driven by channels
refs #5091

- Move renderChannel to own file
- Update channel config to have get/list methods
- Move main routes to be generated based on the list of channels
- Move RSS routes to be subroutes of channels
- Move redirect301 to be a shared util
- Add full test coverage
- Split frontend route tests into frontend & channels
2016-02-15 15:57:20 +00:00
Hannah Wolfe
54979049ee Migration related test improvements
refs #6301

- Don't hardcode the model fields in utils/api -> use the schema + modify the lists
   = We can now easily see what the differences between the schema and the API result are
- Don't hardcode the default DB version in the import/export tools
   = We don't have to update this every time we update the database version
2016-02-14 13:23:45 +00:00
Sebastian Gierlinger
21c272b03f Merge pull request #6495 from ErisDS/db-config
Move db connection out of config
2016-02-13 13:25:35 +01:00
Hannah Wolfe
1c85650108 Move db connection out of config
refs #5047

- database connections are not configuration
2016-02-12 13:56:23 +00:00
Hannah Wolfe
c3673be863 Don't include app fields
no issue

Including app fields along with tags & authors was a preoptimisation.
We don't use them yet, and having them results in database calls that are unnecessary.
2016-02-11 15:03:33 +00:00
Hannah Wolfe
c9e0a70d16 Merge pull request #6481 from jaswilli/issue-5350
Refactor mail service
2016-02-11 08:58:08 +00:00
Jason Williams
c52fd1df9f Refactor mail service
Closes #5350
- No longer necessary to initialize via async init().
- Adds a startup-check for mail configuration.
- Creates a notification in the admin client if
  mail transport is "direct" and sending a message fails.
2016-02-10 16:31:42 -06:00
Sebastian Gierlinger
823894b141 Merge pull request #6467 from ErisDS/drop-column-migration
Adding drop-column migration handling
2016-02-10 21:41:11 +01:00
Cameron Viner
faba83d5dc deps: should@8.2.1
closes #6448
-upgraded should.js to the latest version (8.2.1)
-Changed the tests so that they comply with the breaking changes introduced in the new version of should.js
-Installs the package should-http so should.be.json() can be used
-Installs the package should-sinon so that should.be.calledOnce() can be used
2016-02-09 13:39:10 +00:00
Hannah Wolfe
4ba0a745df Adding drop-column migration handling
refs #6301, #6165

- Adds detection and processing for column deletions
2016-02-09 12:11:49 +00:00
Sebastian Gierlinger
819116465e Merge pull request #6388 from ErisDS/schema-rejig
Reorganise & Rename server/data/ folder internals
2016-02-08 11:19:40 +01:00
Jason Williams
2528ce5304 deps: supertest@1.1.0
Closes #6449
- supertest now includes a `.then()` method and as a
  result, only one of either .then or .end may be called on
  a request object.
2016-02-07 13:10:27 -06:00
Hannah Wolfe
8b5ea4691a Merge pull request #6405 from jtwebman/ghost_head_refactor
Refactored ghost head helper
2016-02-05 11:12:26 +00:00
JT Turner
06d91ce046 Refactored ghost head helper
closes #6186
- Refactored ghost head helper to use the new metadata functions.
- Fix issue where tag should output description if missing meta description.
- Add test for tag description.
- Updated tests to look for author urls with a tailing backslash
- Fix author to output meta description first and then bio if missing.
2016-02-04 22:18:51 -08:00
Hannah Wolfe
1ad7a91f4d Reorganise & rename server/data/ folder internals
refs #6301

- In the migration folder, commands.js changed to builder.js to resolve conflict with the 'commands' inside data/utils/clients/.
- a new data/schema/ folder has been added to hold all the code related to the database schema
- data/utils/clients have been moved to data/schema/clients
- data/utils/index.js has become data/schema/commands.js
- data/schema.js has been split, the definition of the DB schema stays put, the additional checks have moved to data/schema/checks.js
- data/validation/index.js has become data/schema/versioning.js
- data/fixtures has moved to data/migration/fixtures
- data/default-settings.json has moved to data/schema/default-settings.json
2016-02-04 20:39:15 +00:00
Kevin P. Kucharczyk
dc957d7d2e Fix missing nav-current class bug when trailing slashes don't match
closes #6422
- trim trailing slashes before comparing URLs in navigation helper
- add test case to make sure nav-current is appended regardless of trailing slash presence
2016-02-02 11:47:13 +01:00
Hannah Wolfe
08e5848d4a Fix cache-control header for sitemaps
no issue

- sitemaps were getting max-age=undefined as they were depending on the wrong utils folder
- test + fix included
2016-01-25 17:56:05 +00:00
Hannah Wolfe
e5e375057e Merge pull request #6299 from acburdine/config-refactor
Refactor Config Service
2016-01-25 13:22:20 +00:00
Hannah Wolfe
4e355ecba9 Merge pull request #6374 from jtwebman/admin_error_no_theme
Fixed ghost admin error when missing theme folder.
2016-01-25 12:29:31 +00:00
Hannah Wolfe
c29187a5fe Merge pull request #6370 from jtwebman/meta_data_to_functions
Started moving meta data fetching to functions.
2016-01-25 12:16:20 +00:00
JT Turner
cdc98dce15 Fixed ghost admin error when missing theme folder.
closes #6368
- Add test to recreate the error in the static theme middleware.
- Updated static theme middleware to not error if missing theme folder.
2016-01-23 14:01:26 -08:00
JT Turner
1f4c01d207 Started moving meta data fetching to functions.
issue #6186
- Moved asset helper logic to a asset url function.
- Created author image function to be used in ghost_head helper.
- Created author url function to be used in the ghost_head helper.
- Created canonical url function to be used in the ghost_head helper.
- Moved meta_description helper logic to a function.
- Moved excerpt helper logic to a function.
- Created an index in data/meta to be used in ghost_head helper to get all data.
- Created keyword function to be used in the ghost_head helper.
- Created modified data function to be used in the ghost_head helper.
- Created next url function to be used in the ghost_head helper.
- Created ogType function to be used in the ghost_head helper.
- Created previous url function to be used in the ghost_head helper.
- Created published data function to be used in the ghost_head helper.
- Created rss url function to be used in the ghost_head helper.
- Created schema function to be used in the ghost_head helper.
- Created structured data function to be used in the ghost_head helper.
- Moved meta_title helper logic to a title function.
- Moved url helper logic to a url function.
- Wrote tests for all the new functions

This is just the first step. I plan on refactoring the ghost head to use these new functions.
2016-01-23 13:58:21 -08:00
Damien Dormal
58fe7af7d1 Cleanup and improved test coverage for mailer
closes #5489
- Remove unneeded Promise.promisify in mailer
- Remove noEmailTransportConfigured error as not relevant anymore (Direct is default)
- Clone message argument in mailer.send
- Move test from api_mail_spec to mail_spec
- Add default mail title test
2016-01-23 11:49:01 +08:00
Hannah Wolfe
57ae36ab21 Merge pull request #6341 from kevinansfield/fix-mixed-content-on-team-page
Move user/cover image files used in admin team area into the client folder
2016-01-21 09:46:00 +00:00
Hannah Wolfe
c549914ae8 Merge pull request #6316 from halfdan/5606-subdir
Make regex for subfolder deduplication more restrictive
2016-01-20 20:09:29 +00:00
Austin Burdine
7d304a046f refactor admin config to include explicit value types
closes #6266
- add "type" to valid keys in configuration api
- refactor ember config service to parse values based on provided type
2016-01-19 09:43:09 -06:00
Kevin Ansfield
da0a0c559b Move user/cover image files used in admin team area into the client folder
no issue
- fixes potential "mixed content" warnings if non-admin urls are redirected
2016-01-14 16:26:48 +00:00
Hannah Wolfe
4a7a19c86a Merge pull request #6070 from kevinkucharczyk/harvesting-server-side-strings
Harvest server side strings
2016-01-12 20:04:53 +00:00
JT Turner
e4c52a6915 Fix urlFor to handle secure correctly
issue #6270
- Exposed getBaseUrl on the config class.
- Fix formatting config index as array was more then 140 characters long.
- Updated getBaseUrl to handle secure by replacing http with https if true.
- Fixed ghost_head helper to output canonical base url no https.
- Fixed ghost_head helper to set secure correctly for the rss link.
- Fixed navigation helper to pass secure in each nav item, so that urlFor can u$
- Fixed {{url}} to pass secure correctly to config.urlFor.
- Fixed test to use urlSSL over https besides for canonical.
- Add tests for {{url}} and to make sure they output https for absolute and secure.
- Update twitter and og url to use the canonical url.
2016-01-11 19:40:30 -08:00
Hannah Wolfe
dfa74ffcd5 Merge pull request #6304 from halfdan/fix-6290
Disallow access to author/tag rss feeds if private blogging is on
2016-01-11 14:04:19 +00:00
Fabian Becker
c8e30f0182 Make regex for subfolder deduplication more restrictive
- Add subdir to protected slugs
- Fix regex for subfolder deduplication

fixes #5605
2016-01-11 12:46:59 +01:00
Hannah Wolfe
5e2523a305 Merge pull request #6273 from johnny94/add-attributes
Add attributes for `{{tags}}` and `{{#foreach}}` helpers
2016-01-11 10:24:04 +00:00
Szu Yaung
70327c2a74 Add attributes for {{tags}} and {{#foreach}} helpers
issue #6205
- added `from` and `to` attribute for `{{tags}}` and `{{#foreach}}` helpers.
- added tests for these new atttributes
2016-01-10 02:47:36 +08:00
Hannah Wolfe
5fdfc5a091 Merge pull request #6296 from jgable/imageTags
Refactor sitemap generation to include images consistently
2016-01-09 13:28:32 +00:00
Fabian Becker
8a16dd5d7e Disallow access to author/tag rss feeds if private blogging is on
- Also fixes an issue where posts/tags with slugs starting with rss/sitemap became inaccessible

fixes #6290
2016-01-07 15:03:39 +01:00
Jacob Gable
d1348d709f Refactor RSS Image node generation
fixes #6292

- Added createImageNodeFromDatum to BaseSiteMapGenerator
- Refactor some defaults code that was unnecessary
- Add tests for posts, tags, users and posts with images
2016-01-05 21:25:52 -08:00
Hannah Wolfe
c10eb58144 Add missing chars to slug generator
closes #6272

- curly braces and back-tick should also be replaced with a dash
- other symbols and chars in ascii table are either removed or replace
- not all the replacements are sensible, but better than having odd chars in the slug for now
2016-01-05 19:12:44 +00:00