Added clamav configuration in nextcloud

GON-3874-DD-moodle
Roger Garcia 2022-11-24 15:33:38 +01:00 committed by Evilham
parent fcfd5265a1
commit 07913ff7f8
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 11 additions and 1 deletions

12
dd-ctl
View File

@ -331,7 +331,7 @@ setup_nextcloud(){
done done
# Install and enable NextCloud apps # Install and enable NextCloud apps
for app in bruteforcesettings polls calendar spreed bbb mail ownpad onlyoffice; do for app in bruteforcesettings polls calendar spreed bbb mail ownpad onlyoffice files_antivirus; do
docker exec -i -u www-data dd-apps-nextcloud-app sh -s <<-EOF docker exec -i -u www-data dd-apps-nextcloud-app sh -s <<-EOF
php occ --no-warnings app:install "${app}" php occ --no-warnings app:install "${app}"
php occ --no-warnings app:enable "${app}" php occ --no-warnings app:enable "${app}"
@ -422,6 +422,16 @@ setup_nextcloud(){
EOF EOF
# ClamAV
docker exec -i -u www-data dd-apps-nextcloud-app sh -s <<-EOF
php occ --no-warnings config:app:set -n files_antivirus av_mode --value="daemon"
php occ --no-warnings config:app:set -n files_antivirus av_host --value="dd-apps-clamav"
php occ --no-warnings config:app:set -n files_antivirus av_port --value="3310"
php occ --no-warnings config:app:set -n files_antivirus av_infected_action --value="only_log"
php occ --no-warnings config:app:set -n files_antivirus av_stream_max_length --value="26214400"
php occ --no-warnings config:app:set -n files_antivirus av_max_file_size --value="-1"
EOF
# Allow nextcloud into other apps iframes # Allow nextcloud into other apps iframes
# Content-Security-Policy: frame-ancestors 'self' *.$DOMAIN; # Content-Security-Policy: frame-ancestors 'self' *.$DOMAIN;
docker exec dd-apps-nextcloud-app sed -i -e "/protected \\\$allowedFrameAncestors = \[/{n;s/\('\\\\\'self\\\\\'\)\('\)/\1 *.$DOMAIN\2/}" /var/www/html/lib/public/AppFramework/Http/ContentSecurityPolicy.php docker exec dd-apps-nextcloud-app sed -i -e "/protected \\\$allowedFrameAncestors = \[/{n;s/\('\\\\\'self\\\\\'\)\('\)/\1 *.$DOMAIN\2/}" /var/www/html/lib/public/AppFramework/Http/ContentSecurityPolicy.php