2016-09-13 17:20:44 +02:00
|
|
|
{
|
|
|
|
"paths": {
|
|
|
|
"appRoot": ".",
|
|
|
|
"corePath": "core/",
|
|
|
|
"clientAssets": "core/built/assets",
|
|
|
|
"helperTemplates": "core/server/helpers/tpl/",
|
2017-12-06 17:37:54 +01:00
|
|
|
"adminViews": "core/server/web/admin/views/",
|
2017-03-14 09:06:42 +00: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 09:34:03 +08:00
|
|
|
"defaultSettings": "core/server/services/settings/",
|
2016-09-13 22:24:57 +02:00
|
|
|
"internalAppPath": "core/server/apps/",
|
2017-05-15 19:52:01 +09:00
|
|
|
"internalStoragePath": "core/server/adapters/storage/",
|
|
|
|
"internalSchedulingPath": "core/server/adapters/scheduling/",
|
2017-04-07 19:21:41 +07:00
|
|
|
"migrationPath": "core/server/data/migrations",
|
|
|
|
"publicFilePath": "core/server/public"
|
2016-09-13 17:20:44 +02:00
|
|
|
},
|
2017-05-29 21:48:42 +02:00
|
|
|
"apps": {
|
|
|
|
"internal": [
|
|
|
|
"private-blogging",
|
|
|
|
"subscribers",
|
2019-01-17 12:03:40 +01:00
|
|
|
"amp"
|
2017-05-29 21:48:42 +02:00
|
|
|
]
|
|
|
|
},
|
2016-09-13 17:20:44 +02:00
|
|
|
"slugs": {
|
2017-08-22 12:21:24 -04:00
|
|
|
"reserved": ["admin", "app", "apps", "categories",
|
2016-09-13 17:20:44 +02: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 16:01:52 +07:00
|
|
|
"icons": {
|
|
|
|
"extensions": [".png", ".ico"],
|
|
|
|
"contentTypes": ["image/png", "image/x-icon", "image/vnd.microsoft.icon"]
|
|
|
|
},
|
2016-09-13 17:20:44 +02:00
|
|
|
"db": {
|
|
|
|
"extensions": [".json", ".zip"],
|
2017-11-22 17:30:53 +00:00
|
|
|
"contentTypes": ["text/plain", "application/octet-stream", "application/json", "application/zip", "application/x-zip-compressed"]
|
2016-09-13 17:20:44 +02:00
|
|
|
},
|
|
|
|
"themes": {
|
|
|
|
"extensions": [".zip"],
|
2016-09-13 17:41:14 +02:00
|
|
|
"contentTypes": ["application/zip", "application/x-zip-compressed", "application/octet-stream"]
|
2017-09-21 17:01:03 +02:00
|
|
|
},
|
|
|
|
"redirects": {
|
|
|
|
"extensions": [".json"],
|
2017-11-22 17:30:53 +00:00
|
|
|
"contentTypes": ["text/plain", "application/octet-stream", "application/json"]
|
2018-07-12 13:40:37 +02:00
|
|
|
},
|
|
|
|
"routes": {
|
|
|
|
"extensions": [".yaml"],
|
2018-09-10 20:00:56 +02:00
|
|
|
"contentTypes": ["text/plain", "text/yaml", "application/octet-stream", "application/yaml", "application/x-yaml"]
|
2016-09-13 17:20:44 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"times": {
|
|
|
|
"cannotScheduleAPostBeforeInMinutes": 2,
|
2017-04-05 22:58:26 +02:00
|
|
|
"publishAPostBySchedulerToleranceInMinutes": 2,
|
|
|
|
"getImageSizeTimeoutInMS": 5000
|
2016-09-13 17:20:44 +02:00
|
|
|
},
|
|
|
|
"maintenance": {
|
|
|
|
"enabled": false
|
2018-09-25 01:19:21 +05:30
|
|
|
},
|
|
|
|
"api": {
|
|
|
|
"versions": {
|
2018-10-17 09:23:56 +02:00
|
|
|
"all": ["v0.1", "v2"],
|
2018-10-16 15:20:51 +05:30
|
|
|
"v2": {
|
2018-09-25 01:19:21 +05:30
|
|
|
"admin": "v2/admin",
|
2018-12-11 15:18:07 +07:00
|
|
|
"content": "v2/content",
|
|
|
|
"members": "v2/members"
|
2018-09-25 01:19:21 +05:30
|
|
|
},
|
2018-10-16 15:20:51 +05:30
|
|
|
"v0.1": {
|
2018-09-25 01:19:21 +05:30
|
|
|
"admin": "v0.1",
|
|
|
|
"content": "v0.1"
|
2018-09-27 23:04:12 +05:30
|
|
|
}
|
2018-09-25 01:19:21 +05:30
|
|
|
}
|
2016-09-13 17:20:44 +02:00
|
|
|
}
|
|
|
|
}
|