https://github.com/nextmcloud/nmc_marketing
To add custom CSP rules specific to Next Magenta Cloud application
https://github.com/nextmcloud/nmc_marketing
contentsecuritypolicy magentacloud
Last synced: 3 months ago
JSON representation
To add custom CSP rules specific to Next Magenta Cloud application
- Host: GitHub
- URL: https://github.com/nextmcloud/nmc_marketing
- Owner: nextmcloud
- License: agpl-3.0
- Created: 2023-04-12T09:48:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T09:42:09.000Z (over 1 year ago)
- Last Synced: 2025-04-02T00:22:51.730Z (about 1 year ago)
- Topics: contentsecuritypolicy, magentacloud
- Language: PHP
- Homepage:
- Size: 417 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# nmc_marketing
We have shown consent layer as soon as the login page opens. For telecom login and admin login consent layer shown . We are getting some errors in browser console regarding content security which blocking functionality. Cookies not getting set after consent layer acceptance .
To solve this issue NMC Marketing app developed which will add csp rules
### Enabling APP
From settings app search for NMC marketing app and enable it.
### Config Changes
Add below in server config
'trusted_font_urls'=>array(0 => 'https://ebs10.telekom.de/opt-in/',),
'trusted_image_urls'=>array(0 => 'https://pix.telekom.de/',1=>'http://fbc.wcfbc.net/',)
```php
// config/config.php
...,
// In order to deactivate the consent layer for the mobile clients we have to configure the identifiable user agents of those clients
'nmc_marketing.mobile_user_agents' => [
'/^Mozilla\/5\.0 \(Android\) Nextcloud\-android\/(?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)).*$/',
'/^Mozilla\/5\.0 \(iOS\) Nextcloud\-iOS\/(?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)).*$/',
]
```
### App Repository
https://github.com/nextmcloud/nmc_marketing/tree/nmcfeat/master
### TestCases
> 
Execute test case steps:
From server directory Execute below command
./phpunit --configuration tests/phpunit-autotest.xml apps/nmc_marketing/tests/CSPListenerTest.php
Php unit install steps(https://phpunit.de/getting-started/phpunit-9.html):-
Note:- Execute all commands at server level
1.wget -O phpunit https://phar.phpunit.de/phpunit-9.phar
2.chmod +x phpunit
Check php unit version:-
./phpunit --version