Skip to content

Commit

Permalink
WIP: Stop recommending imagemagick in the admin pages
Browse files Browse the repository at this point in the history
This tempts admins into installing insecure packages to make the
warning go away, even going so far as to [impurely modify running
containers](nextcloud/docker#1414 (comment)).

Changing the warning to trigger if the php-imagick module is loaded is
more in line with the actual upstream recommendation, and hopefully
helps unsuspecting users who have hacked around the warning in the
past realize this.

Draft because:

- [ ] Untested (will try building this all this evening)
- [ ] Translations are missing, covered are:
  - [x] English
  - [x] German

Band-aid for nextcloud#1414, while we wait for a proper solution with libvips
or somesuch.
  • Loading branch information
TLATER committed Feb 25, 2022
1 parent 22a9c54 commit 0254a40
Show file tree
Hide file tree
Showing 76 changed files with 81 additions and 81 deletions.
4 changes: 2 additions & 2 deletions apps/settings/lib/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,8 @@ protected function isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(): bool {
return false;
}

protected function imageMagickLacksSVGSupport(): bool {
return extension_loaded('imagick') && count(\Imagick::queryFormats('SVG')) === 0;
protected function imageMagickLoaded(): bool {
return extension_loaded('imagick');
}

/**
Expand Down
8 changes: 4 additions & 4 deletions core/js/setupchecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,13 @@
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
if (data.imageMagickLacksSVGSupport) {
if (data.imageMagickLoaded) {
messages.push({
msg: t(
'core',
'Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it.'
),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
'Imagemagick is in use for document preview. This is not recommended out of security concerns, see the document preview documentation here:'
) + " <a href='https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/previews_configuration.html'>https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/previews_configuration.html</a>",
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
})
}
if (data.pendingBigIntConversionColumns.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion core/l10n/ar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/l10n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"Missing optional column \"{columnName}\" in table \"{tableName}\"." : "العمود الاختياري \"{columnName}\" مفقود في الجدول \"{tableName}\".",
"The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running \"occ db:add-missing-columns\" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability." : "تفتقد قاعدة البيانات إلى بعض الأعمدة الاختيارية. نظرًا لحقيقة أن إضافة أعمدة على الجداول الكبيرة قد تستغرق بعض الوقت لم تتم إضافتها تلقائيًا عندما يمكن أن تكون اختيارية. من خلال تشغيل \"occ db: add-missing-columns\" ، يمكن إضافة الأعمدة المفقودة يدويًا أثناء استمرار تشغيل الخادم. بمجرد إضافة الأعمدة ، قد تعمل بعض الميزات على تحسين الاستجابة أو قابلية الاستخدام.",
"This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them." : "يفتقد هذا المثال إلى بعض وحدات PHP الموصى بها. للحصول على أداء أفضل وتوافق أفضل ، يوصى بشدة بتثبيتها.",
"Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it." : "الحزمة php-imagick في هذا الخادم لا تدعم SVG. لتوافق افضل من المستحسن دعمها.",
"Imagemagick is in use for document preview. This is not recommended out of security concerns, see the document preview documentation here:" : "الحزمة php-imagick في هذا الخادم لا تدعم SVG. لتوافق افضل من المستحسن دعمها.",
"Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read {linkstart}the documentation page about this ↗{linkend}." : "تفتقد بعض الأعمدة في قاعدة البيانات إلى تحويل كبير إلى عدد صحيح. نظرًا لحقيقة أن تغيير أنواع الأعمدة في الجداول الكبيرة قد يستغرق بعض الوقت لم يتم تغييرها تلقائيًا. من خلال تشغيل \"occ db: convert-filecache-bigint\" يمكن تطبيق هذه التغييرات المعلقة يدويًا. يجب إجراء هذه العملية أثناء الحالة غير متصل. لمزيد من التفاصيل ، اقرأ {linkstart} صفحة التوثيق حول هذا الموضوع ↗ {linkend}.",
"SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend." : "يتم استخدام SQLite حاليًا كقاعدة بيانات خلفية. بالنسبة لعمليات التثبيت الأكبر ، نوصي بالتبديل إلى خلفية قاعدة بيانات مختلفة.",
"This is particularly recommended when using the desktop client for file synchronisation." : "يوصى بهذا بشكل خاص عند استخدام تطبيق سطح المكتب لمزامنة الملفات.",
Expand Down
2 changes: 1 addition & 1 deletion core/l10n/bg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/l10n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"Missing optional column \"{columnName}\" in table \"{tableName}\"." : "Липсва изборна колона „{columnName}“ в таблица „{tableName}“.",
"The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running \"occ db:add-missing-columns\" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability." : "В базата данни липсват някои изборни колони. Поради факта, че добавянето на колони в големи таблици може да отнеме известно време, те не се добавят автоматично, когато могат да бъдат по избор. Чрез стартиране на \"occ db: add-missing-колони\" тези липсващи колони могат да бъдат добавени ръчно, докато екземплярът продължава да работи. След като колоните бъдат добавени, някои функции могат да подобрят отзивчивостта или използваемостта.",
"This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them." : "В този екземпляр липсват някои препоръчани PHP модули. За подобрена производителност и по-добра съвместимост е силно препоръчително да ги инсталирате.",
"Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it." : "Модулът php-imagick в този случай няма поддръжка на SVG. За по-добра съвместимост се препоръчва да го инсталирате.",
"Imagemagick is in use for document preview. This is not recommended out of security concerns, see the document preview documentation here:" : "Модулът php-imagick в този случай няма поддръжка на SVG. За по-добра съвместимост се препоръчва да го инсталирате.",
"Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read {linkstart}the documentation page about this ↗{linkend}." : "В някои колони от базата данни липсва преобразуване в big int. Поради факта, че промяната на типовете колони в големи таблици може да отнеме известно време, те не се променят автоматично. Чрез стартиране на 'occ db:convert-filecache-bigint' тези чакащи промени могат да бъдат приложени ръчно. Тази операция трябва да се извърши, докато екземплярът е офлайн. За повече подробности прочетете {linkstart}страницата с документация за това ↗{linkend}. ",
"SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend." : "Понастоящем SQLite се използва като вътрешна база данни. За по-големи инсталации ви препоръчваме да превключите към друг сървър на базата данни.",
"This is particularly recommended when using the desktop client for file synchronisation." : "Препоръчително, особено ако ползвате клиента за настолен компютър.",
Expand Down
2 changes: 1 addition & 1 deletion core/l10n/ca.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0254a40

Please sign in to comment.