Commit Graph

1318 Commits

Author SHA1 Message Date
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
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
Hannah Wolfe
20f102808a Switch channel filters to use strings not literals
fixes #6247

- GQL has a bug where literals starting with numbers are incorrectly parsed
- Using strings instead of literals is a workaround, but is probably safer anyway
2015-12-20 16:03:39 +00:00
Hannah Wolfe
968349236d Merge pull request #6242 from halfdan/6205-last-limit
Fix broken @last for foreach with limit
2015-12-20 14:30:48 +00:00
rfpe
7abcc43907 Harvest server side strings
closes #5617
- Replace all hard-coded server-side strings with i18n translations
2015-12-19 12:12:16 +01:00
Fabian Becker
3b235b9acb Fix broken @last for foreach with limit
refs #6205
2015-12-18 15:55:12 +01:00
Fabian Becker
9899f8d4e7 Fix non-idempotent Ghost API helper
- Add test
- Don't override apiUrl

closes #6239
2015-12-18 15:02:05 +01:00
Sebastian Gierlinger
5256f6929c Merge pull request #6227 from ErisDS/stupid-bug-fix
Fixing bug with ghost-url overwriting url
2015-12-15 15:55:15 +01:00
Hannah Wolfe
e5b0609b33 Fixing bug with ghost-url overwriting url
refs #6223

- I made a stupid error, whereby apiUrl was always set to '' in themes
2015-12-15 14:16:00 +00:00
Sebastian Gierlinger
68a3c2527d Merge pull request #6225 from ErisDS/ghost-head-fix
Ensure `{{ghost_head}}` doesn't overwrite values
2015-12-15 15:13:17 +01:00
Hannah Wolfe
cbea617a24 Ensure {{ghost_head}} doesn't overwrite values
closes #6221

- clones contextObject so that updating values doesn't overwrite real data
2015-12-15 13:18:29 +00:00
Sebastian Gierlinger
efaa04ba61 Merge pull request #6223 from ErisDS/ghost-url
Prep shared API URL util for use on external sites
2015-12-15 14:17:41 +01:00