2016-09-13 18:20:44 +03:00
|
|
|
{
|
|
|
|
"paths": {
|
|
|
|
"appRoot": ".",
|
|
|
|
"corePath": "core/",
|
|
|
|
"clientAssets": "core/built/assets",
|
|
|
|
"helperTemplates": "core/server/helpers/tpl/",
|
2017-12-06 19:37:54 +03:00
|
|
|
"adminViews": "core/server/web/admin/views/",
|
2017-03-14 12:06:42 +03:00
|
|
|
"defaultViews": "core/server/views/",
|
YAML settings loader and parser
closes #9528
These code changes introduce a YAML parser which will load and parse YAML files from the `/content/settings` directory. There are three major parts involved:
1. `ensure-settings.js`: this fn takes care that on bootstrap, the supported files are present in the `/content/settings` directory. If the files are not present, they get copied back from our default files. The default files to copy from are located in `core/server/services/settings`.
2. `loader.js`: the settings loader reads the requested `yaml` file from the disk and passes it to the yaml parser, which returns a `json` object of the file. The settings loader throws an error, if the file is not accessible, e. g. because of permission errors.
3. `yaml-parser`: gets passed a `yaml` file and returns a `json` object. If the file is not parseable, it returns a clear error that contains the information, what and where the parsing error occurred (e. g. line number and reason).
- added a `get()` fn to settings services, that returns the settings object that's asked for. e. g. `settings.get('routes').then(()...` will return the `routes` settings.
- added a `getAll()` fn to settings services, that returns all available settings in an object. The object looks like: `{routes: {routes: {}, collections: {}, resources: {}}, globals: {value: {}}`, assuming that we have to supported settings `routes` and `globals`.
Further additions:
- config `contentPath` for `settings`
- config overrides for default `yaml` files location in `/core/server/services/settings`
**Important**: These code changes are in preparation for Dynamic Routing and not yet used. The process of copying the supported `yaml` files (in this first step, the `routes.yaml` file) is not yet activated.
2018-04-13 04:34:03 +03:00
|
|
|
"defaultSettings": "core/server/services/settings/",
|
2016-09-13 23:24:57 +03:00
|
|
|
"internalAppPath": "core/server/apps/",
|
2017-05-15 13:52:01 +03:00
|
|
|
"internalStoragePath": "core/server/adapters/storage/",
|
|
|
|
"internalSchedulingPath": "core/server/adapters/scheduling/",
|
2017-04-07 15:21:41 +03:00
|
|
|
"migrationPath": "core/server/data/migrations",
|
|
|
|
"publicFilePath": "core/server/public"
|
2016-09-13 18:20:44 +03:00
|
|
|
},
|
2017-05-29 22:48:42 +03:00
|
|
|
"apps": {
|
|
|
|
"internal": [
|
|
|
|
"private-blogging",
|
|
|
|
"subscribers",
|
2017-12-14 17:44:01 +03:00
|
|
|
"amp"
|
2017-05-29 22:48:42 +03:00
|
|
|
]
|
|
|
|
},
|
2016-09-13 18:20:44 +03:00
|
|
|
"routeKeywords": {
|
|
|
|
"tag": "tag",
|
|
|
|
"author": "author",
|
|
|
|
"page": "page",
|
|
|
|
"preview": "p",
|
|
|
|
"private": "private",
|
|
|
|
"subscribe": "subscribe",
|
2017-07-31 12:00:03 +03:00
|
|
|
"amp": "amp",
|
2018-03-27 17:16:15 +03:00
|
|
|
"primaryTagFallback": "all",
|
|
|
|
"primaryAuthorFallback": "all"
|
2016-09-13 18:20:44 +03:00
|
|
|
},
|
|
|
|
"slugs": {
|
2017-08-22 19:21:24 +03:00
|
|
|
"reserved": ["admin", "app", "apps", "categories",
|
2016-09-13 18:20:44 +03:00
|
|
|
"category", "dashboard", "feed", "ghost-admin", "login", "logout",
|
|
|
|
"page", "pages", "post", "posts", "public", "register", "setup",
|
|
|
|
"signin", "signout", "signup", "user", "users", "wp-admin", "wp-login"],
|
|
|
|
"protected": ["ghost", "rss", "amp"]
|
|
|
|
},
|
|
|
|
"uploads": {
|
|
|
|
"subscribers": {
|
|
|
|
"extensions": [".csv"],
|
|
|
|
"contentTypes": ["text/csv", "application/csv", "application/octet-stream"]
|
|
|
|
},
|
|
|
|
"images": {
|
|
|
|
"extensions": [".jpg", ".jpeg", ".gif", ".png", ".svg", ".svgz"],
|
|
|
|
"contentTypes": ["image/jpeg", "image/png", "image/gif", "image/svg+xml"]
|
|
|
|
},
|
2017-01-26 12:01:52 +03:00
|
|
|
"icons": {
|
|
|
|
"extensions": [".png", ".ico"],
|
|
|
|
"contentTypes": ["image/png", "image/x-icon", "image/vnd.microsoft.icon"]
|
|
|
|
},
|
2016-09-13 18:20:44 +03:00
|
|
|
"db": {
|
|
|
|
"extensions": [".json", ".zip"],
|
2017-11-22 20:30:53 +03:00
|
|
|
"contentTypes": ["text/plain", "application/octet-stream", "application/json", "application/zip", "application/x-zip-compressed"]
|
2016-09-13 18:20:44 +03:00
|
|
|
},
|
|
|
|
"themes": {
|
|
|
|
"extensions": [".zip"],
|
2016-09-13 18:41:14 +03:00
|
|
|
"contentTypes": ["application/zip", "application/x-zip-compressed", "application/octet-stream"]
|
2017-09-21 18:01:03 +03:00
|
|
|
},
|
|
|
|
"redirects": {
|
|
|
|
"extensions": [".json"],
|
2017-11-22 20:30:53 +03:00
|
|
|
"contentTypes": ["text/plain", "application/octet-stream", "application/json"]
|
2016-09-13 18:20:44 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"times": {
|
|
|
|
"cannotScheduleAPostBeforeInMinutes": 2,
|
2017-04-05 23:58:26 +03:00
|
|
|
"publishAPostBySchedulerToleranceInMinutes": 2,
|
|
|
|
"getImageSizeTimeoutInMS": 5000
|
2016-09-13 18:20:44 +03:00
|
|
|
},
|
|
|
|
"maintenance": {
|
|
|
|
"enabled": false
|
|
|
|
}
|
|
|
|
}
|