0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server
Hannah Wolfe b00d9fee6d 🎨 ⏱ Cleanup / optimise the server.init() function (#7985)
refs #2182

* 🔥 Remove unused options from server init
- this is left over from old code and is now unused

* 🎨 Move knex-migrator check to db health

- Move complex check function into own module
- Call module from server/index.js
- This just improves the readability of server/index.js

* 🔥 Remove old comments

- These comments all make no sense now!

* 🎨 ⏱ Move model init out of promise chain

- Model.init() does not return a promise
- Therefore, we can move it to the top of the init function, outside of the promise change
- This should be a minor optimisation, and again improves readability /clarity of what's happening

*  ⁉️ Move DBHash init / first run to Settings model

- this structure is left over from when we had code we executed on the first run of Ghost
- the implementation used the API to initialise one setting before populateDefaults is called
- this had lots of dependencies - the whole model, API, and permissions structure had to be initialised for it to work
- the new implementation is simpler, it captures the dbHash getting initialised during populateDefaults()
- it also adds an event, so we can do first-run code later if we really want to (or maybe apps can?!)
- perhaps this is hiding behaviour, and there's a nicer way to do it, but populateDefaults seems like a sane place to populate a default setting 😁

* ⏱ Optimise require order so config is first

- the first require to config will cause the files to be read etc
- this ensures that it happens early, and isn't confusingly timed as part of loading a different module

* 🎨 Simplify settings model changes
2017-02-17 17:44:34 +01:00
..
admin 🚀 Allow ServiceWorker /ghost/ scope (#7967) 2017-02-11 14:43:09 +00:00
api 🎨 increase token expiry (#7971) 2017-02-10 13:35:58 +00:00
apps New buttons 🎨 (#8007) 2017-02-16 19:52:32 +00:00
auth 🎨 use passport-ghost retry hook (#8009) 2017-02-17 15:29:03 +01:00
blog 🎨 rename redirects middleware to custom-redirects 2017-02-07 20:05:50 +01:00
config ⏱ Boot time visibility amends (#7984) 2017-02-17 16:27:02 +01:00
controllers/frontend 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
data 🎨 ⏱ Cleanup / optimise the server.init() function (#7985) 2017-02-17 17:44:34 +01:00
events
helpers New buttons 🎨 (#8007) 2017-02-16 19:52:32 +00:00
mail 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
middleware 🎹 re-work url redirects (#7956) 2017-02-10 11:42:18 +00:00
models 🎨 ⏱ Cleanup / optimise the server.init() function (#7985) 2017-02-17 17:44:34 +01:00
permissions 🐛 fix invite permissions for editor (#7889) 2017-01-25 12:07:31 +00:00
scheduling Shows help message for broken require in scheduler adapter (#7706) 2017-01-16 21:49:41 +01:00
storage 🔥 remove imageRelPath (#7927) 2017-02-03 14:42:05 +00:00
themes 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
translations Add email validation in case of profile update (#7928) 2017-02-08 10:50:43 +01:00
utils 🎨 increase token expiry (#7971) 2017-02-10 13:35:58 +00:00
views
app.js 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
errors.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
filters.js
ghost-server.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
i18n.js
index.js 🎨 ⏱ Cleanup / optimise the server.init() function (#7985) 2017-02-17 17:44:34 +01:00
logging.js 🎨 remove domain string replacement for logging (#8011) 2017-02-17 15:29:25 +01:00
overrides.js 🛠 update lodash,knex and bookshelf to latest versions 2016-09-26 10:20:55 +02:00
update-check.js 🎨 send LTS parameter if requesting the update check service (#7954) 2017-02-07 19:51:19 +01:00