Ghost/core/server/api
Katharina Irrgang a68592a6b9 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937)
* 🔥  kill apiUrl helper, use urlFor helper instead

More consistency of creating urls.
Creates an easier ability to add config changes.

Attention: urlFor function is getting a little nesty, BUT that is for now wanted to make easier and centralised changes to the configs.
The url util need's refactoring anyway.

* 🔥  urlSSL

Remove all urlSSL usages.
Add TODO's for the next commit to re-add logic for deleted logic.

e.g.

- cors helper generated an array of url's to allow requests from the defined config url's -> will be replaced by the admin url if available
- theme handler prefered the urlSSL in case it was defined -> will be replaced by using the urlFor helper to get the blog url (based on the request secure flag)

The changes in this commit doesn't have to be right, but it helped going step by step.
The next commit is the more interesting one.

* 🔥    remove forceAdminSSL, add new admin url and adapt logic

I wanted to remove the forceAdminSSL as separate commit, but was hard to realise.
That's why both changes are in one commit:

1. remove forceAdminSSL
2. add admin.url option

- fix TODO's from last commits
- rewrite the ssl middleware!
- create some private helper functions in the url helper to realise the changes
- rename some wordings and functions e.g. base === blog (we have so much different wordings)
- i would like to do more, but this would end in a non readable PR
- this commit contains the most important changes to offer admin.url option

* 🤖  adapt tests

IMPORTANT
- all changes in the routing tests were needed, because each routing test did not start the ghost server
- they just required the ghost application, which resulted in a random server port
- having a random server port results in a redirect, caused by the ssl/redirect middleware

* 😎  rename check-ssl middleware

* 🎨  fix theme-handler because of master rebase
2017-02-03 18:13:22 +00:00
..
app.js 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
authentication.js 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935) 2017-02-02 18:51:35 +00:00
clients.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
configuration.js 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00: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 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935) 2017-02-02 18:51:35 +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 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00: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