https://github.com/silverstripe/cwp-core
CWP basic compatibility module
https://github.com/silverstripe/cwp-core
cwp hacktoberfest silverstripe
Last synced: 8 months ago
JSON representation
CWP basic compatibility module
- Host: GitHub
- URL: https://github.com/silverstripe/cwp-core
- Owner: silverstripe
- License: bsd-3-clause
- Created: 2017-12-07T03:48:27.000Z (over 8 years ago)
- Default Branch: 3
- Last Pushed: 2025-01-16T22:02:50.000Z (over 1 year ago)
- Last Synced: 2025-03-17T11:11:23.381Z (over 1 year ago)
- Topics: cwp, hacktoberfest, silverstripe
- Language: JavaScript
- Size: 365 KB
- Stars: 3
- Watchers: 10
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# CWP Core Module
[](https://github.com/silverstripe/cwp-core/actions/workflows/ci.yml)
## About this module
This module includes core configuration that integrates a Silverstripe CMS project with the underlying infrastructure of Silverstripe Cloud Platform CCL (formally Revera). Most NZ public sector projects will have this module included after installing the [silverstripe/recipe-ccl recipe module](https://github.com/silverstripe/recipe-ccl).
## Installation
```sh
composer require cwp/cwp-core
```
## Configuration
There are some settings that can be modified in this module, depending on requirements. These are listed below.
### XSS Protection
By default, sites using this module instruct newer browsers to protect against cross-site scripting (XSS) attacks. This is done using an HTTP header (X-XSS-Protection). More information on this header can be found on the [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) site. To disable this feature, add the following to your YML configuration:
```yaml
CWP\Core\Control\InitialisationMiddleware:
xss_protection_enabled: false
```
### Egress Proxy settings
An egress proxy is enabled for all external requests made by Silverstripe CMS sites running on Silverstripe Cloud CCL. This means that by default, all HTTP requests made using `curl` or PHP's stream functions are routed via a proxy. In some cases this may not be desired (e.g. if you wish to communicate with localhost). By default, there are two exceptions to this proxy: `services.cwp.govt.nz` and `localhost`. These cover all standard platform use cases (e.g. searching via Solr).
You can disable the egress proxy entirely by adding the following YML configuration:
```yaml
CWP\Core\Control\InitialisationMiddleware:
egress_proxy_default_enabled: false
```
You can also add to the list of domains to disable the proxy by adding the following YML configuration:
```yaml
CWP\Core\Control\InitialisationMiddleware:
egress_proxy_exclude_domains:
- example.com
```
## Contributing
### Translations
Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code.
Please use [https://www.transifex.com/projects/p/silverstripe-cwp-core](https://www.transifex.com/projects/p/silverstripe-cwp-core) to contribute translations, rather than sending pull requests with YAML files.