Ghost/core/server/api
Aileen Nowak 5c94151e14 Blog icon validations (#7893)
refs #7688

Adds an `uploads/icon/` endpoint to the api route to get a seperate entry point for blog icon validations. The blog icon validation will specifically check for images which have icon extensions (`.ico` & `.png`) and throw errors if:

- the icon file size is too big (>100kb)
- the icon is not a squaer
- the icon size is smaller than 32px
- the icon size is larger than 1000px
- the icon is not `.ico` or `.png` extension

TODOs for this PR:
- [X] get image dimensions
- [X] validate for image
	- [X] size
	- [X] form (must be square)
	- [X] type
	- [X] dimenstion (min 32px and max 1,000px)
- [X] return appropriate error messages
- [X] write tests

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

TODOs for #7688:
- [X] Figure out, which favicon should be used (uploaded or default) -> #7713
- [ ] Serve and redirect the favicon for any browser requests, incl. redirects -> #7700 [WIP]
- [X] Upload favicon via `general/settings` and implement basic admin validations -> TryGhost/Ghost-Admin#397
- [X] Build server side validations -> this PR
2017-01-26 10:01:52 +01:00
..
app.js Blog icon validations (#7893) 2017-01-26 10:01:52 +01:00
authentication.js 🎨 optimisations for brute (#7867) 2017-01-23 22:44:39 +01:00
clients.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
configuration.js More consistant usage of urlFor('home') (#7689) 2017-01-23 09:22:37 +01:00
db.js 🔥 😎 remove old migrations (#7887) 2017-01-25 13:47:49 +00:00
index.js 🎨 optimisations for brute (#7867) 2017-01-23 22:44:39 +01:00
invites.js 🐛 fix invite permissions for editor (#7889) 2017-01-25 12:07:31 +00:00
mail.js 🎨 replace process.env.NODE_ENV usages by config.get('env') (#7544) 2016-10-11 13:53:52 +01:00
notifications.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
posts.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
roles.js Refactor handlePermissions 2015-08-11 16:03:57 +02:00
schedules.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
settings.js 🐷 Rename 'favicon' to 'icon' (#7888) 2017-01-25 11:02:02 +01:00
slack.js Slack integration 2016-05-08 12:49:15 +02:00
slugs.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
subscribers.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
tags.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
themes.js 💄 Improve URL consistency, Part 1: urlJoin (#7668) 2016-11-14 14:38:55 +00:00
upload.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
users.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
utils.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00